private void ItemClickCommand_Executed(object sender, ExecutedRoutedEventArgs e) { try { var item = e.Parameter as FastQueryItem; if (item == null) { return; } int appID = 3102; string strArgs = string.Format("/FQ:{0}", item.QueryID); string strIcon = @"Images\S0000\S0000006.png"; WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACTaskNavigateApp; webRequest.ListData.Add(appID.ToString()); webRequest.ListData.Add(strArgs); webRequest.ListData.Add(strIcon); CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
private void AppItemCommand_Executed(object sender, ExecutedRoutedEventArgs e) { try { var item = e.Parameter as BasicModuleItem; if (item == null) { return; } var info = item.Info; if (info == null) { return; } int appID = info.AppID; string strArgs = info.Args; string strIcon = info.Icon; WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACTaskNavigateApp; webRequest.ListData.Add(appID.ToString()); webRequest.ListData.Add(strArgs); webRequest.ListData.Add(strIcon); CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
void ListBoxLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.RemovedItems == null || e.RemovedItems.Count <= 0) { return; } var item = ListBoxLanguages.SelectedItem as LangInfoItem; if (item == null) { return; } if (CurrentApp == null || CurrentApp.Session == null) { return; } var session = CurrentApp.Session; LangTypeInfo langType = session.SupportLangTypes.FirstOrDefault(t => t.LangID == item.Code); if (langType != null) { LangTypeInfo = langType; session.LangTypeInfo = langType; session.LangTypeID = langType.LangID; WebRequest webRequest = new WebRequest(); webRequest.Session = session; webRequest.Code = (int)RequestCode.CSLanguageChange; webRequest.Data = langType.LangID.ToString(); CurrentApp.PublishEvent(webRequest); } }
private void OpenIMPanel() { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACPageHeadOpenIMPanel; CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
private void DoChangeRole() { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.CSRoleChange; CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
private void DoSetDefaultPage() { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACPageHeadDefaultPage; CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
void BtnNavigateHome_Click(object sender, RoutedEventArgs e) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.CSHome; CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
void BtnLogout_Click(object sender, RoutedEventArgs e) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACPageHeadLogout; CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
void BtnConfirm_Click(object sender, RoutedEventArgs e) { try { var item = ListBoxRoles.SelectedItem as RoleItem; if (item == null) { return; } var roleInfo = item.Info; if (roleInfo == null) { return; } CurrentApp.Session.RoleInfo = roleInfo; CurrentApp.Session.RoleID = roleInfo.ID; #region 通知角色变更 try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.SCGlobalSettingChanged; webRequest.ListData.Add(ConstValue.GS_KEY_PARAM_ROLE); webRequest.ListData.Add(roleInfo.ID.ToString()); webRequest.ListData.Add(roleInfo.Name); webRequest.ListData.Add(string.Format("1")); //“1” 代表是登录时选择的角色,空或“1” 代表登录后切换角色(见UMPS1201的ChangeRole) CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { CurrentApp.WriteLog("ChangeRole", string.Format("Send change role notification fail.\t{0}", ex.Message)); } #endregion mOptResult = RESULT_SUCC; if (PageParent != null) { PageParent.OnChangeRoleResult(mOptResult); } } catch (Exception ex) { ShowException(ex.Message); } }
void BtnDemo_Click(object sender, RoutedEventArgs e) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACTaskNavigateApp; webRequest.ListData.Add("1299"); CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { ShowException(ex.Message); } }
public void SetBusy(bool isWorking, string msg) { try { WebRequest request = new WebRequest(); request.Session = CurrentApp.Session; request.Code = (int)RequestCode.ACStatusSetStatus; request.ListData.Add(isWorking ? "1" : "0"); request.ListData.Add(msg); CurrentApp.PublishEvent(request); } catch (Exception ex) { ShowException(ex.Message); } }
private void DoLogoutSystem() { try { var result = MessageBox.Show(CurrentApp.GetLanguageInfo("S0000054", "Confirm logout?"), CurrentApp.AppTitle, MessageBoxButton.OKCancel, MessageBoxImage.Question); if (result == MessageBoxResult.OK) { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACPageHeadLogout; CurrentApp.PublishEvent(webRequest); } } catch (Exception ex) { ShowException(ex.Message); } }
private void SetOnline() { try { DateTime now = DateTime.Now; var diff = now - mLastActiveTime; if (diff.TotalMilliseconds > 5000) { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACLoginOnline; CurrentApp.PublishEvent(webRequest); mLastActiveTime = now; } } catch (Exception ex) { } }
private void ItemClickCommand_Executed(object sender, ExecutedRoutedEventArgs e) { var item = e.Parameter as FavoriteModuleItem; if (item != null) { var info = item.ModuleInfo; if (info == null) { return; } int appID = info.AppID; string strArgs = info.Args; string strIcon = info.Icon; WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.ACTaskNavigateApp; webRequest.ListData.Add(appID.ToString()); webRequest.ListData.Add(strArgs); webRequest.ListData.Add(strIcon); CurrentApp.PublishEvent(webRequest); } }
void ListBoxThemes_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (e.RemovedItems == null || e.RemovedItems.Count <= 0) { return; } var item = ListBoxThemes.SelectedItem as ThemeInfoItem; if (item == null) { return; } if (CurrentApp == null || CurrentApp.Session == null) { return; } var session = CurrentApp.Session; ThemeInfo themeInfo = session.SupportThemes.FirstOrDefault(t => t.Name == item.Name); if (themeInfo != null) { ThemeInfo = themeInfo; session.ThemeInfo = themeInfo; session.ThemeName = themeInfo.Name; WebRequest webRequest = new WebRequest(); webRequest.Session = session; webRequest.Code = (int)RequestCode.CSThemeChange; webRequest.Data = themeInfo.Name; CurrentApp.PublishEvent(webRequest); } } catch (Exception ex) { ShowException(ex.Message); } }
void BtnConfirm_Click(object sender, RoutedEventArgs e) { if (!CheckInput()) { return; } try { string strOldPass = TxtOldPassword.Password.Trim(); string strNewPass = TxtNewPassword.Password.Trim(); List <string> listArgs = new List <string>(); listArgs.Add(CurrentApp.Session.RentInfo.Token); listArgs.Add(CurrentApp.Session.UserID.ToString()); listArgs.Add(strOldPass); listArgs.Add(strNewPass); listArgs.Add(S1202App.LoginSessionID); for (int i = 0; i < listArgs.Count; i++) { listArgs[i] = S1202App.EncryptString(listArgs[i]); } Service00000Client client = new Service00000Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service00000")); OperationDataArgs retArgs = client.OperationMethodA(14, listArgs); client.Close(); string strReturn = retArgs.StringReturn; CurrentApp.WriteLog("ChangePassword", string.Format("Change password return: {0}", strReturn)); if (!retArgs.BoolReturn) { ShowException(CurrentApp.GetLanguageInfo("S0000039", "Change password fail.")); return; } strReturn = S1202App.DecryptString(strReturn); if (strReturn != "S01A01") { #region 错误消息 //ShowException(CurrentApp.GetLanguageInfo("S0000039", "Change password fail.")); switch (strReturn) { case "W000E02": ShowException(CurrentApp.GetLanguageInfo("S0000060", "")); break; case "W000E03": ShowException(CurrentApp.GetLanguageInfo("S0000061", "")); break; case "W000E04": ShowException(CurrentApp.GetLanguageInfo("S0000062", "")); break; case "W000E05": ShowException(CurrentApp.GetLanguageInfo("S0000063", "")); break; case "W000E06": ShowException(CurrentApp.GetLanguageInfo("S0000064", "")); break; case "W000E08": ShowException(CurrentApp.GetLanguageInfo("S0000078", "Get password history fail.")); break; case "W000E09": ShowException(CurrentApp.GetLanguageInfo("S0000079", "Get security settings fail.")); break; case "W000E10": ShowException(CurrentApp.GetLanguageInfo("S0000080", "Save password to database fail.")); break; case "W000E11": ShowException(CurrentApp.GetLanguageInfo("S0000081", "")); break; case "W000E12": ShowException(CurrentApp.GetLanguageInfo("S0000082", "")); break; } #endregion return; } MessageBox.Show(CurrentApp.GetLanguageInfo("S0000040", "Change password successful"), CurrentApp.AppTitle, MessageBoxButton.OK, MessageBoxImage.Information); CurrentApp.Session.UserInfo.Password = S1202App.EncryptString(strNewPass); #region 通知密码修改 try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.SCGlobalSettingChanged; webRequest.ListData.Add(ConstValue.GS_KEY_PARAM_PASSWORD); webRequest.ListData.Add(CurrentApp.Session.UserInfo.Password); webRequest.ListData.Add(string.Empty); CurrentApp.PublishEvent(webRequest); } catch (Exception ex) { CurrentApp.WriteLog("ChangePassword", string.Format("Send change password notification fail.\t{0}", ex.Message)); } #endregion mOptResult = RESULT_SUCC; if (PageParent != null) { PageParent.OnChangePasswordResult(mOptResult); } } catch (Exception ex) { ShowException(ex.Message); } }