//public frmMacroSetup(CompareModel model, DataSourceModel data) : this() //{ // this.model = model; // this.dataSource = data; // this.listBoxControl2.DataSource = ValidatorRepository.GetFunctionList(); //} /// <summary> /// Initializes a new instance of the <see cref="frmMacroSetup"/> class. /// </summary> /// <param name="model">The model.</param> public frmMacroSetup(FieldSchemaModel model) : this() { this.model = model; this.Text = model.TableName + "\\" + model.Name; this.listBoxControl2.DataSource = ValidatorRepository.GetFunctionList(); this.memoEdit1.Text = model.GetMacros(); //.ValidationMacros; }
/// <summary> /// Fills the schema. /// </summary> /// <param name="select">The select.</param> /// <param name="tableName">Name of the table.</param> /// <returns>List<TableSchemaModel>.</returns> protected virtual List <TableSchemaModel> FillSchema(string select, string tableName) { var schema = ExecuteQuery(select); List <TableSchemaModel> tableSchemaModel = new List <TableSchemaModel>(); TableSchemaModel table = new TableSchemaModel(); tableSchemaModel.Add(table); table.TableName = tableName; foreach (DataColumn col in schema.Tables[0].Columns) { var field = new FieldSchemaModel(col, tableName); table.Fields.Add(field); } return(tableSchemaModel); }