Beispiel #1
0
        private void btn_databaseConfig_Click(object sender, RoutedEventArgs e)
        {
            ConfigPage page = new ConfigPage();

            page.Width        = 500;
            page.Height       = 225;
            Global.configPage = page;
            AyLayer.ShowDialog(null, page, "数据库配置", new AyLayerOptions {
                LayerId = "ConfigPage".ToLower()
            });
        }
        private void btn_save_Click(object sender, RoutedEventArgs e)
        {
            if (StringUtil.isBlank(txt_db_host.Text))
            {
                AyMessageBox.ShowError("数据库地址不能为空!");
                return;
            }
            else if (StringUtil.isBlank(txt_db_port.Text))
            {
                AyMessageBox.ShowError("数据库端口不能为空!");
                return;
            }
            else if (StringUtil.isBlank(txt_db_name.Text))
            {
                AyMessageBox.ShowError("数据库名称不能为空!");
                return;
            }
            else if (StringUtil.isBlank(txt_db_username.Text))
            {
                AyMessageBox.ShowError("数据库账号不能为空!");
                return;
            }
            else if (StringUtil.isBlank(txt_db_password.Text))
            {
                AyMessageBox.ShowError("数据库密码不能为空!");
                return;
            }

            Global.cu.IniWriteValue("DBConfig", "db_host", txt_db_host.Text);
            Global.cu.IniWriteValue("DBConfig", "db_port", txt_db_port.Text);
            Global.cu.IniWriteValue("DBConfig", "db_name", txt_db_name.Text);
            Global.cu.IniWriteValue("DBConfig", "db_username", txt_db_username.Text);
            Global.cu.IniWriteValue("DBConfig", "db_password", txt_db_password.Text);

            Global.RefreshConfigDataToGloBal();
            Global.HomeWindow.RefreshTablesNameComBoBox();
            Global.configPage = null;
            AyLayer.Close("ConfigPage".ToLower());
        }
 private void btn_exit_Click(object sender, RoutedEventArgs e)
 {
     AyLayer.Close("ConfigPage".ToLower());
 }