public void CreateColumns()
        {
            ITransactionHandler VTransactionHandler = new ITransactionHandler();
            DataTable           dt = new DataTable();

            try
            {
                VTransactionHandler.LoadData(CommandText, ref dt, this.Parameters);

                foreach (DataColumn dc in dt.Columns)
                {
                    JkColumn column = new JkColumn();
                    column.Name       = dc.ColumnName;
                    column.Caption    = dc.ColumnName;
                    column.DataType   = IAppHandler.ConvertTypeToSqlType(dc.DataType);
                    column.Width      = 100;
                    column.FooterType = JkColumn.ColumnFooterTypes.ftNone;
                    if (dc.ColumnName.Contains("Id"))
                    {
                        column.Visible = false;
                    }

                    if (Columns.Find(col => col.Name == column.Name) == null)
                    {
                        _Columns.Add(column);
                    }
                }
            }
            finally
            {
                dt.Dispose();
            }
        }
Exemplo n.º 2
0
        private void CreateMasterColumns()
        {
            ITransactionHandler VTransactionHandler = new ITransactionHandler();
            DataTable           table = new DataTable();

            VTransactionHandler.LoadData(CommandText, ref table, this.Parameters);
            foreach (DataColumn dc in table.Columns)
            {
                if (!dc.AutoIncrement)
                {
                    JkMasterColumn column = new JkMasterColumn();
                    column.Name         = dc.ColumnName;
                    column.DataType     = IAppHandler.ConvertTypeToSqlType(dc.DataType);
                    column.Required     = !dc.AllowDBNull;
                    column.DefaultValue = IAppHandler.SetColumnsDefaultValue(dc.ColumnName);

                    if (MasterColumns.Find(col => col.Name == column.Name) == null)
                    {
                        _MasterColumns.Add(column);
                    }
                }
            }
        }