コード例 #1
0
        private void InitEditor(BizEdit control, Table_Column controlData)
        {
//            control.AttributeDefId = controlData.Attribute_Id;
//            control.AttributeName = controlData.Attribute_Name ?? String.Empty;

            InitControl(control, controlData);
        }
コード例 #2
0
        private void InitComboBox(BizComboBox control, Table_Column controlData, AttrDef attrDef)
        {
            control.Rows    = 0;
            control.IsRadio = false;
            //control.AttributeDefId = controlData.Attribute_Id;

            /*if (control.AttributeDefId != null)
             * {
             *  //if (!controlData.Attribute_DefsReference.IsLoaded) controlData.Attribute_DefsReference.Load();
             *
             *  InitComboBox(control, attrDef /*controlData.Attribute_Defs#1#);
             * }*/
            InitControl(control, controlData);
            // AddQueryItems(control, controlData); // Вызывает ошибку дублирования QueryItems
        }
コード例 #3
0
        public BizDataControl CreateTableColumn(Table_Column column, DocDef def)
        {
            AttrDef attrDef = null;

            if (def == null)
            {
                return(null);
            }

            if (column.Attribute_Id != null)
            {
                attrDef = def.Attributes.FirstOrDefault(a => a.Id == column.Attribute_Id);
            }
            if (attrDef == null && column.Attribute_Name != null)
            {
                attrDef =
                    def.Attributes.FirstOrDefault(
                        a => String.Equals(a.Name, column.Attribute_Name, StringComparison.OrdinalIgnoreCase));
            }

//            else
//            {
//                if (!column.Attribute_DefsReference.IsLoaded)
//                    column.Attribute_DefsReference.Load();
//            }
            if (attrDef == null)
            {
                return(null);
            }

            if (attrDef.Type.Id == (int)CissaDataType.Doc)
            {
                var result = new BizTableColumn
                {
                    AttributeDefId = attrDef.Id,
                    AttributeName  = attrDef.Name,
                    Children       = new List <BizControl>()
                };

                var nestDef = _docDefRepo.DocDefById(attrDef.DocDefType.Id);

                AddChildren(result, column, nestDef);
                InitControl(result, column);

                return(result);
            }
            else
            {
                var result = CreateTypeEditor(column, attrDef);

                AddChildren(result, column, def);
                if (result is BizEdit)
                {
                    InitEditor(result as BizEdit, column);
                }
                if (result is BizComboBox)
                {
                    InitComboBox(result as BizComboBox, column, attrDef);
                }

                return(result);
            }
        }