예제 #1
0
        internal Tk5ListTableData(Tk5TableScheme table, ITableOutput tableOutput)
        {
            HiddenList = (from item in table.List
                          where item.InternalControl.SrcControl == ControlType.Hidden
                          select item).ToList();
            TableList = (from item in table.List
                         where IsShowField(item) &&
                         (item.ListDetail == null || item.ListDetail.Search != FieldSearchMethod.Only)
                         orderby item.InternalControl.Order
                         select item).ToList();
            TableName   = table.TableName;
            TableDesc   = table.TableDesc;
            QueryFields = (from item in table.List
                           where IsShowField(item) &&
                           item.ListDetail != null && item.ListDetail.Search != FieldSearchMethod.False
                           orderby item.InternalControl.Order
                           select item).ToList();
            JsonFieldList fieldList = new JsonFieldList(TableName, QueryFields)
            {
                SearchMethod = SearchControlMethod.Id,
                JsonType     = JsonObjectType.Object
            };

            JsonFields   = fieldList.ToJsonString();
            NameField    = table.NameField;
            fTableOutput = tableOutput;
        }
예제 #2
0
 public Tk5ListMetaData(ITableSchemeEx dataXml, IInputData input, ISingleMetaData config,
                        ITableOutput tableOutput = null)
 {
     fTableScheme = config.CreateTableScheme(dataXml, input);
     SetFileDependency(fTableScheme);
     Table = new Tk5ListTableData(fTableScheme, tableOutput);
 }
예제 #3
0
        private void CreateDetailSchemaData(IInputData input, DetailSingleMetaDataConfig item)
        {
            Tk5TableScheme     scheme = CreateTableScheme(input, item.CreateSingleMetaData());
            Tk5NormalTableData table  = new Tk5NormalTableData(scheme, item, input.Style);

            Tables.Add(table);
        }
예제 #4
0
 internal Tk5NormalTableData(Tk5TableScheme table, DetailSingleMetaDataConfig config, IPageStyle style)
     : this(table, config.CreateSingleMetaData(), SearchControlMethod.Name, style)
 {
     IsFix     = config.IsFix;
     ListStyle = config.ListStyle;
     Output    = config.TableOutput?.CreateObject();
 }
예제 #5
0
        public Tk5NormalTableData(Tk5TableScheme table, ISingleMetaData config, SearchControlMethod method, IPageStyle style)
        {
            TkDebug.AssertArgumentNull(table, "table", null);
            TkDebug.AssertArgumentNull(config, "config", null);
            TkDebug.AssertArgumentNull(style, "style", null);

            TableName   = table.TableName;
            TableDesc   = table.TableDesc;
            NameField   = table.NameField;
            ColumnCount = config.ColumnCount;
            HiddenList  = (from item in table.List
                           where item.InternalControl.SrcControl == ControlType.Hidden
                           select item).ToList();
            TableList = (from item in table.List
                         where IsShowField(item)
                         orderby item.InternalControl.Order
                         select item).ToList();
            HasEditKey = (from item in TableList where item.IsKey select item).Any();
            Arrange(TableList);
            var editFields = from item in table.List
                             where item.InternalControl.SrcControl != ControlType.None &&
                             (config.CommitDetail || item.InternalControl.SrcControl != ControlType.Label)
                             select item;
            JsonFieldList fieldList = new JsonFieldList(TableName, editFields, HasEditKey)
            {
                SearchMethod = method,
                JsonType     = config.JsonDataType
            };

            JsonFields = fieldList.ToJsonString();
            Style      = PageStyleClass.FromStyle(style);
        }
예제 #6
0
        private Tk5TableScheme CreateTableScheme(IInputData input, ISingleMetaData item)
        {
            ITableSchemeEx sourceScheme = item.CreateSourceScheme(input);
            Tk5TableScheme scheme       = item.CreateTableScheme(sourceScheme, input);

            fSchemes.Add(scheme);
            return(scheme);
        }
예제 #7
0
        public Tk5SingleNormalMetaData(ITableSchemeEx dataXml, IInputData input,
                                       ISingleMetaData config)
        {
            TkDebug.AssertArgumentNull(dataXml, "dataXml", null);
            TkDebug.AssertArgumentNull(input, "input", null);
            TkDebug.AssertArgumentNull(config, "config", null);

            ColumnCount  = config.ColumnCount;
            fTableScheme = config.CreateTableScheme(dataXml, input);
            Files        = FileUtil.GetFileDependecy(fTableScheme);
            Table        = new Tk5NormalTableData(fTableScheme, config, SearchControlMethod.Id, input.Style);
        }
예제 #8
0
        public Tk5TableScheme(Tk5TableScheme scheme, IEnumerable <Tk5FieldInfoEx> fields)
        {
            TkDebug.AssertArgumentNull(scheme, "scheme", null);
            TkDebug.AssertArgumentNull(fields, "fields", null);

            SetFileDependency(scheme);
            fList     = scheme.fList;
            TableName = scheme.TableName;
            TableDesc = scheme.TableDesc;
            NameField = scheme.NameField;
            foreach (var item in fields)
            {
                fList.Add(item);
            }

            ProcessRefField();
        }
예제 #9
0
        internal Tk5MultipleMetaData(IInputData input, IEnumerable <ISingleMetaData> masters,
                                     IEnumerable <DetailSingleMetaDataConfig> details)
            : this()
        {
            foreach (var item in masters)
            {
                Tk5TableScheme     scheme = CreateTableScheme(input, item);
                Tk5NormalTableData table  = new Tk5NormalTableData(scheme, item, SearchControlMethod.Id, input.Style);
                Tables.Add(table);
            }
            if (details != null)
            {
                foreach (var item in details)
                {
                    CreateDetailSchemaData(input, item);
                }
            }

            Files = FileUtil.GetFileDependecyFromEnumerable(fSchemes);
        }
예제 #10
0
 public Tk5ListMetaData(Tk5ListMetaData metaData, IEnumerable <Tk5FieldInfoEx> fields)
 {
     fTableScheme = new Tk5TableScheme(metaData.fTableScheme, fields);
     SetFileDependency(fTableScheme);
     Table = new Tk5ListTableData(fTableScheme, null);
 }
예제 #11
0
 internal Tk5NormalTableData(Tk5TableScheme table, BaseSingleMetaDataConfig config, IPageStyle style)
     : this(table, config, SearchControlMethod.Id, style)
 {
 }