Exemplo n.º 1
0
        private void tsbOk_Click(object sender, EventArgs e)
        {
            if (dt.Rows.Count == 0)
            {
                DataRow row = dt.Rows.Add("table_credprogr", "table_clients", tbWhereClause.Text);
            }
            else
            {
                dt.Rows[0]["Clause"] = tbWhereClause.Text;
            };

            TableStruct ts = new TableStruct();

            ts.TableName = "where_clauses";
            string[] p_keys = { "TableDBName_Left", "TableDBName_Right" };
            ts.p_keys = p_keys;
            string[] columns = { "Clause" };
            ts.columns = columns;

            DBFunctions.WriteToDB(dt, ts);

            try
            {
                DBStructure.UpdateSelectorScript();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            Close();
        }
Exemplo n.º 2
0
        private void SaveData()
        {
            TableStruct ts = new TableStruct();

            ts.TableName = "tableconfig";
            string[] p_keys = { "TableConfigID" };
            ts.p_keys = p_keys;
            string[] columns = { "TableName", "TableDBName", "ColumnName", "ColumnDBName", "ColumnType", "ColumnReference", "ReferenceMultiSelect", "ShowInOffer", "ShowInOfferShort", "ShowInEditor", "WebOrder", "UseInWhereClause", "ShowFullName" };
            ts.columns = columns;

            DBFunctions.WriteToDB(dt_tableconfig, ts);

            DBStructure.UpdateDBStructure();
        }
        private void SaveData()
        {
            if (!Auth.AuthModule.rights.reference_struct.write)
            {
                return;
            }
            TableStruct ts = new TableStruct();

            ts.TableName = "referencesconfig";
            string[] p_keys = { "ReferenceConfigID" };
            ts.p_keys = p_keys;
            string[] columns = { "ReferenceName", "ReferenceDBName", "Hierarchycal", "ColumnName", "ColumnDBName", "ColumnType" };
            ts.columns = columns;

            DBFunctions.WriteToDB(dt_ref_config, ts);

            DBStructure.UpdateDBStructure();
        }
        private void tbAddReference_Click(object sender, EventArgs e)
        {
            string ref_name = Microsoft.VisualBasic.Interaction.InputBox("Введите наименование справочника", "Ввод наименования");

            if (ref_name == "")
            {
                return;
            }
            string ref_db_name = Microsoft.VisualBasic.Interaction.InputBox("Введите название справочника для базы данных", "Ввод наименования");

            if (ref_db_name == "")
            {
                return;
            }

            ref_db_name = ref_db_name.ToLower();

            SaveData();

            DBFunctions.ExecuteCommand("INSERT INTO referencesconfig SET ReferenceName = '" + ref_name + "',ReferenceDBName = '" +
                                       ref_db_name + "',Hierarchycal = 1,ColumnName = 'Наименование',ColumnDBName = 'RefName',ColumnType = 'Строка50'");

            DBStructure.UpdateDBStructure();

            reference_list = DBFunctions.ReadFromDB("SELECT DISTINCT ReferenceName,ReferenceDBName,Hierarchycal FROM referencesconfig");

            cbCurrentReference.Items.Clear();

            foreach (DataRow row in reference_list.Rows)
            {
                cbCurrentReference.Items.Add((string)row["ReferenceName"]);
            }

            foreach (string Item in cbCurrentReference.Items)
            {
                if (Item == ref_name)
                {
                    cbCurrentReference.SelectedIndex = cbCurrentReference.Items.IndexOf(Item);
                    break;
                }
            }
        }
Exemplo n.º 5
0
        private void SaveData()
        {
            if (!Auth.AuthModule.rights.questionary_editor.write)
            {
                return;
            }

            TableStruct ts = new TableStruct();

            ts.TableName = "questionary_questions";
            string[] p_keys = { "question_id" };
            ts.p_keys = p_keys;
            string[] columns = { "questionary_id", "question_text", "question_variation",           "question_reference",
                                 "question_type",  "question_next", "question_dest_column_db_name", "question_hint",     "question_input_type", "question_web_position" };
            ts.columns = columns;

            DBFunctions.WriteToDB(dt_questions, ts);

            DBStructure.UpdateDBStructure();
        }
Exemplo n.º 6
0
 public static void UpdateOfferSelector()
 {
     DBStructure.UpdateSelectorScript();
 }
Exemplo n.º 7
0
 public static void UpdateDB()
 {
     DBStructure.UpdateDBStructure();
 }