123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using UAS_MES_NEW.DataOperate;
- using UAS_MES_NEW.Entity;
- using UAS_MES_NEW.PublicMethod;
- namespace UAS_MES_NEW.Employee
- {
- public partial class Employee_PowerSarch : Form
- {
- DataTable dt;
- DataHelper dh;
- DataTable Dbfind;
- AutoSizeFormClass asc = new AutoSizeFormClass();
- LogStringBuilder sql = new LogStringBuilder();
- public Employee_PowerSarch()
- {
- InitializeComponent();
- }
- private void 权限查看_Load(object sender, EventArgs e)
- {
- asc.controllInitializeSize(this);
- dh = SystemInf.dh;
- ug_code.FormName = Name;
- ug_code.TableName = "CS$USERGROUP";
- ug_code.SelectField = "ug_code # 分组编号,ug_name # 分组名称,ug_inman # 录入人,ug_indate #录入日期";
- ug_code.SetValueField = new string[] { "ug_code" };
- ug_code.DbChange += Ug_code_Dbchage;
- dt = (DataTable)dh.ExecuteSql("select DISTINCT sn_module from CS$SYSNAVATION where sn_using=1", "select");
- ItemObject item = new ItemObject("全部", "");
- sn_module.Items.Add(item);
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- string sn_moudle = dt.Rows[i]["sn_module"].ToString();
- item = new ItemObject(sn_moudle, sn_moudle);
- sn_module.Items.Add(item);
- }
- }
- private void Ug_code_Dbchage(object sender, EventArgs e)
- {
- Dbfind = ug_code.ReturnData;
- BaseUtil.SetFormValue(this.Controls, Dbfind);
- }
- private void 权限查看_SizeChanged(object sender, EventArgs e)
- {
- asc.controlAutoSize(this);
- }
- private void Screen_Click(object sender, EventArgs e)
- {
- sql.Clear();
- 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 ");
- 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 + "%' ");
- 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) + "%' ");
- sql.Append("and ug_code like '%" + ug_code.Text + "%' order by ug_code,sn_modulecode,sn_detno");
- dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
- BaseUtil.FillDgvWithDataTable(PowerSearchDGV, dt);
- }
- private void ug_code_KeyDown(object sender, KeyEventArgs e)
- {
- Screen.PerformClick();
- }
- private void ug_code_UserControlTextChanged(object sender, EventArgs e)
- {
- Screen.PerformClick();
- }
- private void sn_module_SelectedIndexChanged(object sender, EventArgs e)
- {
- Screen.PerformClick();
- }
- }
- }
|