public void InitConfiguration(Model.DataColumn column) { txtPlaceholder.Text = "Please, select " + column.ColumnText; txtAllowedExtentions.Text = "*.jpg;*.png;*.gif;*.bmp"; }
public void InitConfiguration(Model.DataColumn column) { txtPlaceholder.Text = "Please, fill " + column.ColumnText; }
public void InitConfiguration(Model.DataColumn column) { txtValidationMessage.Text = column.ColumnText + "must be between {MinLength} and {MaxLength} length"; }
public void InitConfiguration(Model.DataColumn column) { }
void AddDefaultListFunctionsAgainOnNewTable(DataSourceTable table, DataSourceLogicTable newTable, int colCounter, Model.DataColumn col) { int colCounter2 = 0; foreach (Model.DataColumn col2 in table.DataColumns) { LogicColumn logicColumn = CreateDefaultListFunctionAgainLogicColumn(colCounter, colCounter2, col, col2, newTable); if (logicColumn != null) { newTable.DataColumns.Add(logicColumn); } colCounter2++; } }
LogicColumn CreateDefaultListFunctionAgainLogicColumn(int colCounter, int colCounter2, Model.DataColumn col, Model.DataColumn col2, DataSourceLogicTable newTable) { if (colCounter2 >= colCounter && col2.DataType.ToLower().Contains("int") && col2.Key == false && col.ColumnName.Equals(col2.ColumnName) == false) { Model.LogicColumn logicColumn = new Model.LogicColumn(); logicColumn.ColumnName = col.ColumnName; logicColumn.ColumnText = col.ColumnText; logicColumn.ReturnType = "List<" + newTable.TableName + ">"; logicColumn.Tag = "list-int-and-int"; logicColumn.Use = true; logicColumn.FunctionName = "FindBy" + col.ColumnName + "And" + col2.ColumnName; string dtType = Helper.DatabaseMapper.MapType(col.DataType); string varName1 = Helper.StrUtil.LowFirst(col.ColumnName) + ""; string varName2 = Helper.StrUtil.LowFirst(col2.ColumnName) + ""; List <FunctionParameter> parameters = new List <FunctionParameter>(); parameters.Add(new FunctionParameter(varName1, dtType, col)); parameters.Add(new FunctionParameter(varName2, dtType, col2)); Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("Parameters", parameters); logicColumn.ConfigContent = new FunctionConfigurator(); logicColumn.ConfigContent.DisplayConfiguration(dict); return(logicColumn); } else { return(null); } }
LogicColumn CreateDefaultDeleteLogicColumn(Model.DataSourceTable sourceTable, Model.DataColumn col, DataSourceLogicTable newTable) { Model.LogicColumn logicColumn = new Model.LogicColumn(); logicColumn.ColumnName = col.ColumnName; logicColumn.ColumnText = col.ColumnText; logicColumn.ReturnType = "void"; logicColumn.Use = true; List <FunctionParameter> parameters = new List <FunctionParameter>(); logicColumn.Tag = "delete-by-column"; logicColumn.FunctionName = "DeleteBy" + logicColumn.ColumnName; string dtType = Helper.DatabaseMapper.MapType(col.DataType); string varName = Helper.StrUtil.LowFirst(col.ColumnName); parameters.Add(new FunctionParameter(varName, dtType, col)); Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("Parameters", parameters); logicColumn.ConfigContent = new FunctionConfigurator(); logicColumn.ConfigContent.DisplayConfiguration(dict); return(logicColumn); }
LogicColumn CreateDefaultFindAllLogicColumn(Model.DataSourceTable sourceTable, Model.DataColumn col, DataSourceLogicTable newTable) { Model.LogicColumn logicColumn = new Model.LogicColumn(); logicColumn.ColumnName = col.ColumnName; logicColumn.ColumnText = col.ColumnText; logicColumn.ReturnType = "List<" + newTable.TableName + ">"; logicColumn.Use = true; List <FunctionParameter> parameters = new List <FunctionParameter>(); if (col.DataType.ToLower().Contains("date")) { logicColumn.Tag = "list-date"; logicColumn.FunctionName = "FindBy" + logicColumn.ColumnName + "Between"; string dtType = Helper.DatabaseMapper.MapType(col.DataType); string varName1 = Helper.StrUtil.LowFirst(col.ColumnName) + "1"; string varName2 = Helper.StrUtil.LowFirst(col.ColumnName) + "2"; parameters.Add(new FunctionParameter(varName1, dtType, col)); parameters.Add(new FunctionParameter(varName2, dtType, col)); } else { logicColumn.Tag = "list-string"; logicColumn.FunctionName = "FindBy" + logicColumn.ColumnName; string dtType = Helper.DatabaseMapper.MapType(col.DataType); string varName = Helper.StrUtil.LowFirst(col.ColumnName); parameters.Add(new FunctionParameter(varName, dtType, col)); } Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("Parameters", parameters); logicColumn.ConfigContent = new FunctionConfigurator(); logicColumn.ConfigContent.DisplayConfiguration(dict); return(logicColumn); }
public List <DataSourceTable> GetTables(string connectionString) { List <DataSourceTable> tables = new List <DataSourceTable>(); using (SqlConnection conn = new SqlConnection(connectionString)) { conn.Open(); // First, get schema information of all the tables in current database; DataTable allTablesSchemaTable = conn.GetSchema("Tables"); Console.WriteLine("Schema Information of All Tables:"); ShowDataTable(allTablesSchemaTable, 20); Console.WriteLine(); foreach (DataRow row in allTablesSchemaTable.Rows) { DataSourceTable tbl = new DataSourceTable(); tbl.TableName = Convert.ToString(row["TABLE_NAME"]); tbl.TableSchema = Convert.ToString(row["TABLE_SCHEMA"]); // You can specify the Catalog, Schema, Table Name, Constraint Name, Column Name to // get the specified column(s). // You can use five restrictions for Column, so you should create a 5 members array. String[] indexColumnsRestrictions = new String[5]; // For the array, 0-member represents Catalog; 1-member represents Schema; // 2-member represents Table Name; 3-member represents Constraint Name;4-member represents Column Name. // Now we specify the Table_Name and Column_Name of the columns what we want to get schema information. indexColumnsRestrictions[2] = Convert.ToString(row["TABLE_SCHEMA"]); indexColumnsRestrictions[2] = Convert.ToString(row["TABLE_NAME"]); DataTable courseIdIndexSchemaTable = conn.GetSchema("IndexColumns", indexColumnsRestrictions); List <string> ss = new List <string>(); foreach (DataRow idxRow in courseIdIndexSchemaTable.Rows) { ss.Add(Convert.ToString(idxRow["column_name"])); } // You can specify the Catalog, Schema, Table Name, Column Name to get the specified column(s). // You can use four restrictions for Column, so you should create a 4 members array. String[] columnRestrictionss = new String[4]; // For the array, 0-member represents Catalog; 1-member represents Schema; // 2-member represents Table Name; 3-member represents Column Name. // Now we specify the Table_Name and Column_Name of the columns what we want to get schema information. columnRestrictionss[1] = Convert.ToString(row["TABLE_SCHEMA"]); columnRestrictionss[2] = Convert.ToString(row["TABLE_NAME"]); DataTable schemaTableColumns = conn.GetSchema("Columns", columnRestrictionss); foreach (DataRow colRow in schemaTableColumns.Rows) { Model.DataColumn column = new Model.DataColumn(); column.ColumnName = Convert.ToString(colRow["COLUMN_NAME"]); column.DataType = Convert.ToString(colRow["DATA_TYPE"]); if (ss.Contains(column.ColumnName)) { column.Key = true; } else { column.Key = false; } tbl.DataColumns.Add(column); } tables.Add(tbl); } } return(tables); }
public void InitConfiguration(Model.DataColumn column) { txtValidationMessage.Text = column.ColumnText + "can not be empty"; }
public void InitConfiguration(Model.DataColumn column) { txtValidationMessage.Text = "Please, fill number between {MinNumber} and {MaxNumber}"; }