Пример #1
0
        private void btnYes_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textServerIp.Text))
            {
                System.Windows.Forms.MessageBox.Show(this, "数据库IP地址不能为空");
                return;
            }

            AppConfigurator.UpdateAppConfig("DatabaseServerIP", textServerIp.Text.Trim());
            AppConfigurator.UpdateAppConfig("DatabaseUser", textUser.Text.Trim());
            AppConfigurator.UpdateAppConfig("DatabasePwd", textPwd.Text.Trim());

            DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Пример #2
0
        private void btnYes_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textServerIp.Text))
            {
                System.Windows.Forms.MessageBox.Show(this, "数据库IP地址不能为空");
                return;
            }
            if (rdbWindowsServer.Checked == false && rdbDeskttopClient.Checked == false)
            {
                System.Windows.Forms.MessageBox.Show(this, "请选择一种启动方式");
                return;
            }
            AppConfigurator.UpdateAppConfig("DatabaseServerIP", textServerIp.Text.Trim());
            AppConfigurator.UpdateAppConfig("DatabaseUser", textUser.Text.Trim());
            AppConfigurator.UpdateAppConfig("DatabasePwd", textPwd.Text.Trim());

            if (rdbWindowsServer.Checked)
            {
                //windows服务模式

                //进入服务设置UI 安装\卸载 启动\停止 服务设置 切换为桌面客户端等
                this.Hide();
                FrmServiceSetup dlg = new FrmServiceSetup();
                dlg.ShowDialog();
                Close(); //整个程序退出
            }
            else
            {
                SingletonInfo.GetInstance().SqlServerIP   = textServerIp.Text.Trim();
                SingletonInfo.GetInstance().SqlServerUser = textUser.Text.Trim();
                SingletonInfo.GetInstance().SqlServerPWD  = textPwd.Text.Trim();
                //桌面客户端模式
                this.Hide();
                FormMain dlg = new FormMain();
                dlg.ShowDialog();
                Close();
            }
        }