private void SetIMMsgState() { try { var pageHead = PageHead; if (pageHead == null) { return; } if (mMsgCount > 0) { pageHead.IsMsgCountVisible = true; if (mMsgCount > 9) { pageHead.MsgCount = "9+"; } else { pageHead.MsgCount = mMsgCount.ToString(); } } else { pageHead.IsMsgCountVisible = false; pageHead.MsgCount = mMsgCount.ToString(); } } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
private void OpenIMPanel() { try { var session = UMPApp.Session; if (session == null) { return; } if (mIMMainPage == null) { CreateIMPanel(); } if (IMPanel == null) { return; } IMPanel.Title = string.Format("{0}", session.UserInfo.Account); IMPanel.Width = 800; IMPanel.Height = 550; IMPanel.IsModal = false; IMPanel.Content = mIMMainPage; IMPanel.IsOpen = true; } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
protected virtual void Init() { try { mIdleCheckCount = 0; mIdleCheckInterval = 1000; mIdleCheckTimer = new Timer(mIdleCheckInterval); mIdleCheckTimer.Elapsed += mIdleCheckTimer_Elapsed; mIdleCheckTimer.Start(); ThemeInfo = UMPApp.Session.ThemeInfo; LangTypeInfo = UMPApp.Session.LangTypeInfo; AppServerInfo = UMPApp.Session.AppServerInfo; if (PageHead != null) { PageHead.SessionInfo = UMPApp.Session; PageHead.InitInfo(); SetIMMsgState(); } CreateIMPanel(); ChangeTheme(); ChangeLanguage(); ShowPage(); } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
protected void SendNavigateHomeMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSHome; request.Session = UMPApp.Session; UMPApp.SendNetPipeMessage(request); }
protected void SendChangePasswordMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSChangePassword; request.Session = UMPApp.Session; UMPApp.SendNetPipeMessage(request); }
protected void SendLogoutMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSLogout; request.Session = UMPApp.Session; UMPApp.SendNetPipeMessage(request); }
protected void SendLoadedMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSModuleLoaded; request.Session = UMPApp.Session; UMPApp.SendNetPipeMessage(request); }
protected void SendIdleCheckMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSIdleCheck; request.Session = UMPApp.Session; request.Data = mIdleCheckCount.ToString(); UMPApp.SendNetPipeMessage(request); }
protected void SendLanguageChangeMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSLanguageChange; request.Session = UMPApp.Session; request.Data = LangTypeInfo.LangID.ToString(); UMPApp.SendNetPipeMessage(request); }
protected void SendThemeChangeMessage() { WebRequest request = new WebRequest(); request.Code = (int)RequestCode.CSThemeChange; request.Session = UMPApp.Session; request.Data = ThemeInfo.Name; UMPApp.SendNetPipeMessage(request); }
protected void SetDefaultPage(int moduleID) { try { var session = UMPApp.Session; if (session == null) { return; } string strUserID = session.UserID.ToString(); string strModule = moduleID.ToString(); string strParamValue = string.Format("{0}{1}{2}", strUserID, ConstValue.SPLITER_CHAR_3, strModule); UserParamInfo param = new UserParamInfo(); param.UserID = session.UserID; param.ParamID = ConstValue.UP_DEFAULT_PAGE; param.GroupID = ConstValue.UP_GROUP_PAGE; param.SortID = 0; param.DataType = DBDataType.NVarchar; param.ParamValue = strParamValue; OperationReturn optReturn = XMLHelper.SeriallizeObject(param); if (!optReturn.Result) { UMPApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } WebRequest webRequest = new WebRequest(); webRequest.Code = (int)RequestCode.WSSaveUserParamList; webRequest.Session = session; webRequest.ListData.Add(session.UserID.ToString()); webRequest.ListData.Add("1"); webRequest.ListData.Add(optReturn.Data.ToString()); Service11012Client client = new Service11012Client( WebHelper.CreateBasicHttpBinding(session) , WebHelper.CreateEndpointAddress(session.AppServerInfo, "Service11012")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { UMPApp.ShowExceptionMessage(string.Format("{0}\t{1}", webReturn.Code, webReturn.Message)); return; } UMPApp.ShowInfoMessage(string.Format("{0}\r\n\r\n{1}", UMPApp.GetLanguageInfo("COMN006", "Set default page end"), UMPApp.GetLanguageInfo(string.Format("FO{0}", moduleID), moduleID.ToString()))); } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
protected virtual void IMMainPage_StatusChangeEvent(int msgType, string strMsg) { UMPApp.WriteLog("IMMessage", string.Format("{0}\t{1}", msgType, strMsg)); switch (msgType) { case IM_STATUS_LOGIN: break; case IM_STATUS_LOGOFF: break; case IM_STATUS_NEWMSG: mMsgCount++; SetIMMsgState(); break; } }
private void CreateIMPanel() { try { var session = UMPApp.Session; if (session == null) { return; } List <string> listMsgs = new List <string>(); mIMMainPage = new IMMainPage(session); mIMMainPage.StatusChangeEvent += IMMainPage_StatusChangeEvent; mIMMainPage.Width = 780; mIMMainPage.Height = 500; mIMMainPage.Login(); } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
protected virtual void App_NetPipeEvent(WebRequest webRequest) { Dispatcher.Invoke(new Action(() => { try { var code = webRequest.Code; switch (code) { case (int)RequestCode.SCIdleCheckStop: StartStopIdleTimer(false); break; case (int)RequestCode.SCIdleCheckStart: StartStopIdleTimer(true); break; } } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } })); }