Ejemplo n.º 1
0
        private void btnSaveSettings_Click(object sender, EventArgs e)
        {
            if (WorkingContext.CheckConnection(txtServer.Text, txtDatabase.Text, txtUserName.Text, txtPassWord.Text))
            {
                ModuleSettings newSettings = new ModuleSettings();
                newSettings.Database    = txtDatabase.Text.Trim();
                newSettings.Password    = txtPassWord.Text.Trim();
                newSettings.UserName    = txtUserName.Text.Trim();
                newSettings.Server      = txtServer.Text.Trim();
                newSettings.PicturePath = txtPicturePath.Text.Trim();
                newSettings.ReportPath  = txtReportPath.Text.Trim();
                if (rdoEnglish.Checked)
                {
                    newSettings.Language = "en-US";
                }
                else if (rdoVietnamese.Checked)
                {
                    newSettings.Language = "vi-VN";
                }
                else if (rdoJapanese.Checked)
                {
                    newSettings.Language = "ja-JP";
                }


//				WorkingContext.Setting.Server = txtServer.Text;
//				WorkingContext.Setting.Database = txtDatabase.Text;
//				WorkingContext.Setting.UserID = txtUserID.Text;
//				WorkingContext.Setting.Password = txtPassword.Text;
//
//				WorkingContext.Setting.PicturePath = txtPicturePath.Text;
                try
                {
//					WorkingContext.Setting.Save();
                    ModuleConfig.SaveSettings(newSettings);
                }

                catch
                {
                    string str1 = WorkingContext.LangManager.GetString("frmSetting_Error1");
                    string str3 = WorkingContext.LangManager.GetString("frmSetting_Error1_Title");
                    //MessageBox.Show("Không thể tạo file cấu hình hệ thống", "Lỗi", MessageBoxButtons.OK,  MessageBoxIcon.Error);
                    MessageBox.Show(str1, str3, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                string str  = WorkingContext.LangManager.GetString("frmSetting_ThongBao_Messa");
                string str2 = WorkingContext.LangManager.GetString("frmSetting_ThongBao_Title");
                MessageBox.Show(str, str2, MessageBoxButtons.OK, MessageBoxIcon.Information);
                WorkingContext.InitWorkingContext();
                this.Close();
            }
            else
            {
                string str4 = WorkingContext.LangManager.GetString("frmSetting_Error1_Title");
                string str5 = WorkingContext.LangManager.GetString("frmSetting_Error2");
                //MessageBox.Show("Không thể kết nối được cơ sở dữ liệu. Hãy nhập lại thông số cấu hình hệ thống", "Lỗi", MessageBoxButtons.OK,  MessageBoxIcon.Error);
                MessageBox.Show(str5, str4, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            CSettings csetting = (CSettings)_currentSetup.Settings;

            csetting.PrintConfig = _currentSetupPanel.GetValues();

            ModuleConfig.SaveSettings(_currentSetup.Settings, _currentSetup.ConfigFilePath);
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            settings.Ksxm_x = Convert.ToInt16(ksxm_x.Text);
            settings.Ksxm_y = Convert.ToInt16(ksxm_y.Text);

            settings.Ksdd_x = Convert.ToInt16(ksdd_x.Text);
            settings.Ksdd_y = Convert.ToInt16(ksdd_y.Text);

            settings.Ksrq_x = Convert.ToInt16(ksrq_x.Text);
            settings.Ksrq_y = Convert.ToInt16(ksrq_y.Text);

            settings.Kscj_x = Convert.ToInt16(kscj_x.Text);
            settings.Kscj_y = Convert.ToInt16(kscj_y.Text);


            settings.Kscx_x = Convert.ToInt16(kscx_x.Text);
            settings.Kscx_y = Convert.ToInt16(kscx_y.Text);

            settings.Ksyxm_x = Convert.ToInt16(ksyxm_x.Text);
            settings.Ksyxm_y = Convert.ToInt16(ksyxm_y.Text);

            ModuleConfig.SaveSettings(this.fullSettings, configFilePath);
        }
Ejemplo n.º 4
0
 public void SaveSettings()
 {
     ModuleConfig.SaveSettings(_settings, _configFilePath);
 }