Esempio n. 1
0
        public static List <ColumnData> SetDefaultColumns(List <ColumnData> columns)
        {
            if (columns.Find(i => i.Name == DbCIC.DsStatus) == null)
            {
                columns.Add(new ColumnData {
                    Name = DbCIC.DsStatus, Type = DbDEF.VarchrNull(3), DefaultValue = "1"
                });
            }

            if (columns.Find(i => i.Name == DbCIC.InsertOn) == null)
            {
                columns.Add(new ColumnData {
                    Name = DbCIC.InsertOn, Type = DbDEF.VarchrNull(20), DefaultValue = "01.01.1900"
                });
            }

            if (columns.Find(i => i.Name == DbCIC.ModifyOn) == null)
            {
                columns.Add(new ColumnData {
                    Name = DbCIC.ModifyOn, Type = DbDEF.VarchrNull(20)
                });
            }

            return(columns);
        }
        private List <ColumnData> GetSampleTable1Columns()
        {
            var colList = new List <ColumnData>();

            colList.Add(new ColumnData {
                Name = "Pk", Type = DbDEF.VarchrNotNullPk(50)
            });
            colList.Add(new ColumnData {
                Name = "Name", Type = DbDEF.VarchrNull(100)
            });
            colList.Add(new ColumnData {
                Name = "Text", Type = DbDEF.TxtNull
            });

            return(colList);
        }
        private List <ColumnData> GetSampleTable2Columns()
        {
            var colList = new List <ColumnData>();

            colList.Add(new ColumnData {
                Name = "Pk", Type = DbDEF.VarchrNotNullPk(50)
            });
            colList.Add(new ColumnData {
                Name = "ParentPk", Type = DbDEF.VarchrNotNull(50), FkList = new List <FkData> {
                    new FkData {
                        RefTable = "TestTbl", RefColumn = "Pk"
                    }
                }
            });
            colList.Add(new ColumnData {
                Name = "Name", Type = DbDEF.VarchrNull(100)
            });
            colList.Add(new ColumnData {
                Name = "Text", Type = DbDEF.TxtNull
            });

            return(colList);
        }