Employee_NewGroup.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using UAS_MES.DataOperate;
  10. using UAS_MES.Entity;
  11. namespace UAS_MES.Employee
  12. {
  13. public partial class Employee_NewGroup : CustomControl.BaseForm.BaseForm
  14. {
  15. DataHelper dh;
  16. public Employee_NewGroup()
  17. {
  18. InitializeComponent();
  19. }
  20. private void SaveGroup_Click(object sender, EventArgs e)
  21. {
  22. if (ug_code.Text != "" && ug_name.Text != "")
  23. {
  24. if (dh.CheckExist("cs$usergroup", "ug_code='" + ug_code.Text + "'"))
  25. MessageBox.Show("分组编号已存在");
  26. else if (dh.CheckExist("cs$usergroup", "ug_name='" + ug_name.Text + "'"))
  27. MessageBox.Show("分组名称已存在");
  28. else
  29. {
  30. dh.ExecuteSql("insert into cs$usergroup (ug_id,ug_code,ug_name,ug_inman,ug_indate) values(cs$usergroup_seq.nextval,'" + ug_code.Text + "','" + ug_name.Text + "','" + User.UserName + "',sysdate)", "insert");
  31. MessageBox.Show("新增分组成功");
  32. Close();
  33. }
  34. }
  35. else
  36. MessageBox.Show("请填写完整信息");
  37. }
  38. private void 新增分组_Load(object sender, EventArgs e)
  39. {
  40. dh = SystemInf.dh;
  41. }
  42. }
  43. }