public static void InitDeviceTypes(DevExpress.XtraTreeList.TreeList treeList1, string[] type) { TreeListColumn column = new TreeListColumn(); column.Caption = "设备分类"; column.FieldName = "name"; column.VisibleIndex = 0; column.Width = 180; column.OptionsColumn.AllowEdit = false; column.OptionsColumn.AllowSort = false; treeList1.Columns.AddRange(new TreeListColumn[] { column }); treeList1.KeyFieldName = "id"; treeList1.ParentFieldName = "parentid"; treeList1.DataSource = DeviceTypeHelper.GetDeviceTypes(type); }
private void InitDeviceType(string[] type, string year) { DataTable dt = DeviceTypeHelper.GetDeviceTypes(type); if (dt.Rows.Count > 0) { string strID = dt.Rows[0]["id"].ToString(); string dtype = dt.Rows[0]["class"].ToString(); UCDeviceBase device = null; device = createInstance(dtype); device.ID = strID; device.ProjectID = Itop.Client.MIS.ProgUID; showDevice(device); string strCon = " year(cast(OperationYear as datetime))<" + year + " and Type='" + strID + "' "; device.Statictable(strCon); curDevice = device; } }