Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        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);
                }
            }));
        }