예제 #1
0
        public static void AddDisplayOrderColumn(DBTable t)
        {
            if (t.Columns.Count(c => c.UserDataType == "displayorder") == 0)
            {
                var c = new DBColumn
                {
                    Parent = t,
                    Name = "Display_Order",
                    DataType = DB.DBDataType.@int,
                    Length = 4,
                    UserDataType = "displayorder",
                    CustomDataType = DBColumn.CustomDataTypes.displayorder,
                    Nullable = true,
                    Action = DB.DBAction.Add,
                    OnAlreadyExists = EngineManager.DBObject.DBOnExists.AlterElsePerformAction
                };

                var sql = c.GetSQL();

                var db_cmd = new DBCommand { Owner = t, Sql = sql, Description = "Add Display Order Column" };
                t.Connection.Project.Commands.Add(db_cmd);
                //db_cmd.Execute();
                t.DefaultSort = c;
                //this.Refresh();
            }
        }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     column.State = DBObject.DBObjectState.New;
     Table.Connection.Project.Commands.Add(new DBCommand {
         Description = "Add New Column", Owner = Table, Sql = column.GetSQL()
     });
 }
예제 #3
0
        public static void AddIconClassColumn(DBTable t)
        {
            if (t.Columns.Count(c => c.UserDataType == "iconclass") == 0)
            {
                var c = new DBColumn
                {
                    Parent = t,
                    Name = "Icon",
                    DataType = DB.DBDataType.nvarchar,
                    Length = 50,
                    UserDataType = "iconclass",
                    CustomDataType = DBColumn.CustomDataTypes.iconclass,
                    Nullable = true,
                    Action = DB.DBAction.Add,
                    OnAlreadyExists = EngineManager.DBObject.DBOnExists.AlterElsePerformAction
                };

                var sql = c.GetSQL();

                var db_cmd = new DBCommand { Owner = t, Sql = sql, Description = "Add Icon Class Column" };
                t.Connection.Project.Commands.Add(db_cmd);
                //db_cmd.Execute();

                t.RowIconClass = c;

                //this.Refresh();
            }
        }