Employee_PowerSarch.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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_NEW.DataOperate;
  10. using UAS_MES_NEW.Entity;
  11. using UAS_MES_NEW.PublicMethod;
  12. namespace UAS_MES_NEW.Employee
  13. {
  14. public partial class Employee_PowerSarch : Form
  15. {
  16. DataTable dt;
  17. DataHelper dh;
  18. DataTable Dbfind;
  19. AutoSizeFormClass asc = new AutoSizeFormClass();
  20. LogStringBuilder sql = new LogStringBuilder();
  21. public Employee_PowerSarch()
  22. {
  23. InitializeComponent();
  24. }
  25. private void 权限查看_Load(object sender, EventArgs e)
  26. {
  27. asc.controllInitializeSize(this);
  28. dh = SystemInf.dh;
  29. ug_code.FormName = Name;
  30. ug_code.TableName = "CS$USERGROUP";
  31. ug_code.SelectField = "ug_code # 分组编号,ug_name # 分组名称,ug_inman # 录入人,ug_indate #录入日期";
  32. ug_code.SetValueField = new string[] { "ug_code" };
  33. ug_code.DbChange += Ug_code_Dbchage;
  34. dt = (DataTable)dh.ExecuteSql("select DISTINCT sn_module from CS$SYSNAVATION where sn_using=1", "select");
  35. ItemObject item = new ItemObject("全部", "");
  36. sn_module.Items.Add(item);
  37. for (int i = 0; i < dt.Rows.Count; i++)
  38. {
  39. string sn_moudle = dt.Rows[i]["sn_module"].ToString();
  40. item = new ItemObject(sn_moudle, sn_moudle);
  41. sn_module.Items.Add(item);
  42. }
  43. }
  44. private void Ug_code_Dbchage(object sender, EventArgs e)
  45. {
  46. Dbfind = ug_code.ReturnData;
  47. BaseUtil.SetFormValue(this.Controls, Dbfind);
  48. }
  49. private void 权限查看_SizeChanged(object sender, EventArgs e)
  50. {
  51. asc.controlAutoSize(this);
  52. }
  53. private void Screen_Click(object sender, EventArgs e)
  54. {
  55. sql.Clear();
  56. sql.Append("select ug_code,sn_id,sn_module,sn_displayname,sn_caller,ugp_id,ugp_ifread,ugp_ifwrite,ugp_ifdelete,ugp_ifspecial,ugp_ifall ");
  57. sql.Append("from cs$usergroup left join cs$sysnavation on ug_code is not null left join cs$usergrouppower on ugp_groupcode like '%" + ug_code.Text + "%' ");
  58. sql.Append("and ugp_caller=sn_caller and ugp_groupcode=ug_code where sn_using=1 and sn_module like '%" + (sn_module.Text == "全部" ? "" : sn_module.Text) + "%' ");
  59. sql.Append("and ug_code like '%" + ug_code.Text + "%' order by ug_code,sn_modulecode,sn_detno");
  60. dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
  61. BaseUtil.FillDgvWithDataTable(PowerSearchDGV, dt);
  62. }
  63. private void ug_code_KeyDown(object sender, KeyEventArgs e)
  64. {
  65. Screen.PerformClick();
  66. }
  67. private void ug_code_UserControlTextChanged(object sender, EventArgs e)
  68. {
  69. Screen.PerformClick();
  70. }
  71. private void sn_module_SelectedIndexChanged(object sender, EventArgs e)
  72. {
  73. Screen.PerformClick();
  74. }
  75. }
  76. }