private void btnOK_Click(object sender, EventArgs e)
{
//2015-5-6 w00322557 鉴权方式修改为eSDK提供
if (string.IsNullOrEmpty(this.tbUserName.Text) || string.IsNullOrWhiteSpace(this.tbUserName.Text))
{
MessageBox.Show(GlobalResourceClass.getMsg("ACCOUNT_ERROR"));
return;
}
if (string.IsNullOrEmpty(this.tbPassword.Text) || string.IsNullOrWhiteSpace(this.tbPassword.Text))
{
MessageBox.Show(GlobalResourceClass.getMsg("ACCOUNT_ERROR"));
return;
}
//保存用户账号信息到配置文件
ThisAddIn.g_log.Info("save account info begin!");
ThisAddIn.g_AccountInfo.strPWD = this.tbPassword.Text;
ThisAddIn.g_AccountInfo.strUserName = this.tbUserName.Text;
//更新通知模板语言
try
{
if (0 != this.cbLanguage.SelectedIndex)
{
string[] strLanguages = ThisAddIn.g_AccountInfo.strLanguage.Split(';');
string strTemp = strLanguages[0];
strLanguages[0] = strLanguages[this.cbLanguage.SelectedIndex];
strLanguages[this.cbLanguage.SelectedIndex] = strTemp;
ThisAddIn.g_AccountInfo.strLanguage = string.Join(";", strLanguages);
}
ThisAddIn.g_log.Info(ThisAddIn.g_AccountInfo.strLanguage);
}
catch (System.Exception ex)
{
ThisAddIn.g_log.Error(ex.Message);
}
ThisAddIn.g_AccountInfo.WriteAccountInfo();
ThisAddIn.g_log.Info("save account info end!");
//更新global值
ThisAddIn.g_log.Info("save global begin!");
ThisAddIn.g_SystemSettings.bAutoUpdate = this.checkBoxAutoUpdate.Checked;
ThisAddIn.g_SystemSettings.bLyncCTC = this.checkBoxLyncCTC.Checked;
ThisAddIn.g_SystemSettings.bShowTipsForSelectRooms = this.cbShowTips.Checked;
ThisAddIn.g_SystemSettings.bShowCPResource = this.cbShowCPReource.Checked;
//ThisAddIn.writeGlobalConfig();
ThisAddIn.g_SystemSettings.WriteSystemSetting();
ThisAddIn.g_log.Info("save global end!");
//关闭对话框
this.DialogResult = DialogResult.OK;
}