private void DevTypeInit() { string sql = string.Empty; sql = "SELECT * FROM cfg_devtype"; _dtDevType = _Mysql.GetDataTable(sql); DevTypecomboBox.DataSource = _dtDevType; DevTypecomboBox.DisplayMember = "Name"; DevTypecomboBox.ValueMember = "Code"; }
public static void attach(MySQLDBHelper db, string orgId) { if (curOrg != null && orgId == curOrg.id) { return; } curOrg = new Organization(orgId); //获取机构信息 DataTable orgTable = db.GetDataTable("SELECT Code,name from org_Dept WHERE id='" + orgId + "'"); if (orgTable.Rows.Count == 0) { return; } curOrg.num = orgTable.Rows[0]["Code"].ToString(); //机构编号 curOrg.name = orgTable.Rows[0]["name"].ToString(); //机构名称 orgTable.Dispose(); //获取机构的区域点位信息 areaList = new List <string>(); sitePoints = new List <List <string> >(); //查找机构下的区域 DataTable dt = db.GetDataTable("SELECT id from Institution_area_BaseInfo WHERE jigoumingchen='" + orgId + "'"); for (int i = 0; i < dt.Rows.Count; i++) { areaList.Add(dt.Rows[i]["id"].ToString()); } curOrg.areaList = areaList; dt.Dispose(); //查找区域下的点位 for (int i = 0; i < areaList.Count; i++) { DataTable position = db.GetDataTable("SELECT id from Institution_area_Position WHERE AreaId='" + areaList[i] + "'"); List <string> pointList = new List <string>(); for (int j = 0; j < position.Rows.Count; j++) { pointList.Add(dt.Rows[j]["id"].ToString()); } sitePoints.Add(pointList); position.Dispose(); } curOrg.pointList = sitePoints; }
private void DevbindTreeView1() { string mysql = "select * from sys_devicebase"; DataTable dt = _Mysql.GetDataTable(mysql); DataRow[] dr = dt.Select("FatherCode is null"); for (int i = 0; i < dr.Length; i++) { TreeNode tn = new TreeNode(); tn.Text = dr[i]["name"].ToString(); tn.Tag = dr[i]["id"].ToString(); OrgFillTree(tn, dt); OrgtreeView.Nodes.Add(tn); } }
public static void attach(MySQLDBHelper db, string orgId) { QuickLoadUtil.attach(db, orgId);//预加载机构相关信息 DataTable dt = db.GetDataTable("SELECT id from acs_doorfbsconfig"); acsCfgList = new List <string>(); for (int i = 0; i < dt.Rows.Count; i++) { acsCfgList.Add(dt.Rows[i]["id"].ToString()); } dt.Dispose(); }