Beispiel #1
0
        private void toolStripButtonSaveConfig_Click(object sender, EventArgs e)
        {
            if ((cbxtoolStripSelectDataBase.ComboBox.SelectedIndex >= 0) &&
                (cbxtoolStripSelectObejct.ComboBox.SelectedIndex >= 0))
            {
                var database    = cbxtoolStripSelectDataBase.ComboBox.SelectedValue as IDatabase;
                var selectTable = cbxtoolStripSelectObejct.ComboBox.SelectedValue as ITable;

                FormUISetting uis = GetFormUIConfig(database, selectTable);

                string pathKey = "Key|KilerCodeGeneration|UI|" + database.Name + "|" + selectTable.Name;

                XmlConfigReader.SetConfig <FormUISetting>(pathKey, uis, saveFileDialogInputUIConfig);
            }
        }
Beispiel #2
0
        private void toolStripButtonSaveConfig_Click(object sender, EventArgs e)
        {
            if (this.cbxtoolStripSelectObejct.ComboBox.SelectedIndex >= 0)
            {
                ITable    selectTable = this.cbxtoolStripSelectObejct.ComboBox.SelectedValue as MyMeta.ITable;
                IDatabase database    = selectTable.Database;

                List <TableUIGenerationParams> tableUIGenerationParamsList = null;
                if (database != null && selectTable != null)
                {
                    tableUIGenerationParamsList = new List <TableUIGenerationParams>();
                    foreach (DataGridViewRow row in this.dataGridViewField.Rows)
                    {
                        TableUIGenerationParams tableUIGenerationParams = new TableUIGenerationParams();
                        tableUIGenerationParams.IsSelect     = (bool)row.Cells["colIsSelect"].Value;
                        tableUIGenerationParams.FieldName    = (string)row.Cells["colFieldName"].Value;
                        tableUIGenerationParams.FieldNameCn  = (string)row.Cells["colFieldNameCn"].Value;
                        tableUIGenerationParams.LanguageType = (string)row.Cells["colLanguageType"].Value;
                        tableUIGenerationParams.Size         = (int)row.Cells["colSize"].Value;
                        tableUIGenerationParams.IsAutoKey    = (bool)row.Cells["colIsAutoKey"].Value;
                        tableUIGenerationParams.InputType    = (string)row.Cells["colInputType"].Value;
                        tableUIGenerationParams.IsReqiured   = (bool)row.Cells["colIsReqiured"].Value;
                        tableUIGenerationParams.DefaultValue = (string)row.Cells["colDefaultValue"].Value;
                        tableUIGenerationParams.Items        = (string)row.Cells["colSelectItem"].Value;
                        tableUIGenerationParams.DbColumnName = (string)row.Cells["colIndexName"].Value;
                        tableUIGenerationParamsList.Add(tableUIGenerationParams);
                    }
                }

                FormUISetting uis = new FormUISetting();
                uis.TableName = selectTable.Name;
                uis.Items     = tableUIGenerationParamsList;


                string pathKey = "Key|KilerCodeGeneration|UI|" + database.Name + "|" + selectTable.Name;

                XmlConfigReader.SetConfig <FormUISetting>(pathKey, uis, this.saveFileDialogInputUIConfig);
            }
        }