锐腾搅拌上料功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.2 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using DevExpress.XtraEditors;
  9. using ICSSoft.Frame.User.BLL;
  10. using ICSSoft.Base.Language.Tool;
  11. using ICSSoft.Base.UserControl.MessageControl;
  12. using System.Data.SqlClient;
  13. using ICSSoft.Base.Config.AppConfig;
  14. using ICSSoft.Base.Report.Filter;
  15. using ICSSoft.Base.Config.DBHelper;
  16. using ICSSoft.Base.UserControl.FormControl;
  17. using ICSSoft.Base.ReferForm.AppReferForm;
  18. using ICSSoft.Base.Lable.PrintTool;
  19. using ICSSoft.Frame.Data.DAL;
  20. using ICSSoft.Frame.Data.BLL;
  21. using ICSSoft.Frame.Data.Entity;
  22. namespace ICSSoft.Frame.APP
  23. {
  24. public partial class FormICSTeamGroupAdd : DevExpress.XtraEditors.XtraForm
  25. {
  26. bool add = false;
  27. public FormICSTeamGroupAdd()
  28. {
  29. InitializeComponent();
  30. add = true;
  31. lblTitle.Text = "新增";
  32. txtMUSERName.Text = AppConfig.UserName;
  33. txtMTIME.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  34. }
  35. public FormICSTeamGroupAdd(string id)
  36. {
  37. InitializeComponent();
  38. add = false;
  39. lblTitle.Text = "修改";
  40. LoadData(id);
  41. }
  42. private void LoadData(string id)
  43. {
  44. ICSSGroup info = ICSTeamGroupBLL.SelectByID(id);
  45. if (info == null)
  46. {
  47. throw new Exception("该数据已被删除!");
  48. }
  49. txtTeamGroupCode.Text = info.SGroup;
  50. txtTeamGroupDesc.Text = info.SGroupDESC;
  51. txtMUSERName.Text = info.MUSERName;
  52. txtMTIME.Text = info.MTIME.ToString("yyyy-MM-dd HH:mm:ss");
  53. txtTeamGroupCode.Properties.ReadOnly = true;
  54. }
  55. #region 关闭
  56. private void btnClose_Click(object sender, EventArgs e)
  57. {
  58. this.Close();
  59. this.DialogResult = DialogResult.Cancel;
  60. }
  61. private void btnCancle_Click(object sender, EventArgs e)
  62. {
  63. this.Close();
  64. this.DialogResult = DialogResult.Cancel;
  65. }
  66. #endregion
  67. private void btnOK_Click(object sender, EventArgs e)
  68. {
  69. try
  70. {
  71. if (string.IsNullOrWhiteSpace(txtTeamGroupCode.Text))
  72. {
  73. throw new Exception("组代码为必填项");
  74. }
  75. if (string.IsNullOrWhiteSpace(txtTeamGroupDesc.Text))
  76. {
  77. throw new Exception("组描述为必填项");
  78. }
  79. ICSSGroup g = new ICSSGroup();
  80. g.SGroup = txtTeamGroupCode.Text.Trim().ToUpper();
  81. g.SGroupDESC = txtTeamGroupDesc.Text.Trim().ToUpper();
  82. g.MUSER = AppConfig.UserCode;
  83. g.MUSERName = AppConfig.UserName;
  84. g.MTIME = AppConfig.GetSeverDateTime("yyyy-MM-dd HH:mm:ss");
  85. g.WorkPoint = AppConfig.WorkPointCode;
  86. ICSTeamGroupBLL.Edit(g);
  87. ICSBaseSimpleCode.AppshowMessageBox(lblTitle.Text + "成功");
  88. }
  89. catch (Exception ex)
  90. {
  91. ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
  92. }
  93. }
  94. }
  95. }