예제 #1
0
        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);
        }
예제 #2
0
        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;
            }
        }