void PlayFiles(string downloadPath, string Fname)
        {
            string ServerPath =
                System.IO.Path.Combine(
                    string.Format("{0}://{1}:{2}", CurrentApp.Session.AppServerInfo.Protocol, CurrentApp.Session.AppServerInfo.Address,
                                  CurrentApp.Session.AppServerInfo.Port), downloadPath);

            //string ServerPath = System.IO.Path.Combine(string.Format("http://192.168.4.166:8081"), downloadPath);
            ServerPath = ServerPath.Replace("\\", "/");
            try
            {
                UCPlayBox mUCPlayBox = new UCPlayBox();
                mUCPlayBox.McParentPage = this;
                BorderPlayBox.Child     = mUCPlayBox;
                mUCPlayBox.PlayUrl      = ServerPath;
                mUCPlayBox.CurrentApp   = CurrentApp;
                // PanelPlayBox.IsVisible = true;
            }
            catch (Exception ex)
            {
                #region 写操作日志
                string strLog = string.Format("{0} {1}{2}", CurrentApp.Session.UserID.ToString(), Utils.FormatOptLogString("FO3106007"), Fname);
                CurrentApp.WriteOperationLog(S3601Consts.OPT_Play.ToString(), ConstValue.OPT_RESULT_FAIL, strLog);
                #endregion
                CurrentApp.WriteLog("Play File Failed.", string.Format("ServerPath : {0} \t   Message :{1}", ServerPath, ex.Message));
                ShowException(ex.Message);
            }
            #region 写操作日志
            string strLog1 = string.Format("{0} {1}{2}", CurrentApp.Session.UserID.ToString(), Utils.FormatOptLogString("FO3106007"), Fname);
            CurrentApp.WriteOperationLog(S3601Consts.OPT_Play.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog1);
            #endregion
            CurrentApp.WriteLog("Play File Sucessed!", string.Format("ServerPath : {0} ", ServerPath));
        }
        private void SetRegionMmt(ObjItem regionItem, List <string> listUserIDStates)
        {
            try
            {
                int        count      = listUserIDStates.Count;
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S4410Codes.SetRegionMmt;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(regionItem.ObjID.ToString());
                webRequest.ListData.Add(count.ToString());
                for (int i = 0; i < count; i++)
                {
                    webRequest.ListData.Add(listUserIDStates[i]);
                }
                Service44101Client client = new Service44101Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service44101"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }

                CurrentApp.WriteLog("SetRegionMmt", string.Format("End.\t{0}", regionItem.ObjID));
                ShowInformation(CurrentApp.GetLanguageInfo("COMN003", string.Format("Save end")));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #3
0
 private void QueryExtState(List <string> listMonIDs)
 {
     try
     {
         if (mMonClient == null || !mMonClient.IsConnected)
         {
             return;
         }
         int            count   = listMonIDs.Count;
         RequestMessage request = new RequestMessage();
         request.SessionID = mMonClient.SessionID;
         request.Command   = (int)Service10Command.ReqQueryExtState;
         request.ListData.Add(count.ToString());
         for (int i = 0; i < count; i++)
         {
             string strMonID = listMonIDs[i];
             request.ListData.Add(strMonID);
         }
         mMonClient.SendMessage(request);
     }
     catch (Exception ex)
     {
         CurrentApp.WriteLog("QueryExtState", string.Format("Fail.\t{0}", ex.Message));
     }
 }
Beispiel #4
0
 private void SetMonType()
 {
     try
     {
         if (mMonitorClient == null)
         {
             return;
         }
         OperationReturn optReturn;
         RequestMessage  request = new RequestMessage();
         request.Command   = (int)Service04Command.ReqSetMonType;
         request.SessionID = mMonitorClient.SessionID;
         request.ListData.Add(((int)MonitorType.NMon).ToString());
         optReturn = mMonitorClient.SendMessage(request);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         CurrentApp.WriteLog("MonitorClient", string.Format("Send SetMonType message end"));
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
        public override void ChangeLanguage()
        {
            base.ChangeLanguage();

            try
            {
                var parent = Parent as PopupPanel;
                if (parent != null)
                {
                    string strName = string.Empty;
                    if (ObjectItem != null)
                    {
                        strName = ObjectItem.Name;
                    }
                    parent.Title = string.Format("{0} --- {1}", CurrentApp.GetLanguageInfo("2501201", "Set Send Method"),
                                                 strName);
                }

                GroupTerminal.Header   = CurrentApp.GetLanguageInfo("2501202", "Alarm Client");
                GroupEmail.Header      = CurrentApp.GetLanguageInfo("2501203", "Email");
                GroupUserApp.Header    = CurrentApp.GetLanguageInfo("2501207", "User application");
                CbUseTerminal.Content  = CurrentApp.GetLanguageInfo("2501204", "Use Alarm Client");
                CbUseEmail.Content     = CurrentApp.GetLanguageInfo("2501205", "Use Email");
                CbEmailReply.Content   = CurrentApp.GetLanguageInfo("2501206", "Reply");
                CbUseUserApp.Content   = CurrentApp.GetLanguageInfo("2501208", "Use user application");
                CbUserAppReply.Content = CurrentApp.GetLanguageInfo("2501206", "Reply");

                BtnConfirm.Content = CurrentApp.GetLanguageInfo("2501005", "Confirm");
                BtnClose.Content   = CurrentApp.GetLanguageInfo("2501006", "Close");
            }
            catch (Exception ex)
            {
                CurrentApp.WriteLog("Lang", ex.Message);
            }
        }
Beispiel #6
0
        private void CreateMonClient()
        {
            try
            {
                if (mMonClient != null)
                {
                    mMonClient.Stop();
                    mMonClient = null;
                }
                mMonClient        = new NetClient();
                mMonClient.Debug +=
                    (mode, cat, msg) => CurrentApp.WriteLog("MonClient", string.Format("{0}\t{1}", cat, msg));
                mMonClient.ConnectionEvent       += MonClient_ConnectionEvent;
                mMonClient.ReturnMessageReceived += MonClient_ReturnMessageReceived;
                mMonClient.NotifyMessageReceived += MonClient_NotifyMessageReceived;
                mMonClient.IsSSL = true;
                mMonClient.Host  = CurrentApp.Session.AppServerInfo.Address;
                mMonClient.Port  = CurrentApp.Session.AppServerInfo.SupportHttps
                    ? CurrentApp.Session.AppServerInfo.Port - 11
                    : CurrentApp.Session.AppServerInfo.Port - 10;
                mMonClient.Connect();

                CurrentApp.WriteLog("CreateMonClient", string.Format("End.\t{0}:{1}", mMonClient.Host, mMonClient.Port));
            }
            catch (Exception ex)
            {
                CurrentApp.WriteLog("CreateMonClient", string.Format("Fail.\t{0}", ex.Message));
            }
        }
Beispiel #7
0
        private string GetAppIcon(BasicAppInfo info)
        {
            string strReturn = string.Empty;

            try
            {
                var session = CurrentApp.Session;
                if (session == null)
                {
                    return(strReturn);
                }
                var appServerInfo = CurrentApp.Session.AppServerInfo;
                if (appServerInfo == null)
                {
                    return(strReturn);
                }
                string url = string.Format("{0}://{1}:{2}/Themes/{3}/{4}",
                                           appServerInfo.Protocol,
                                           appServerInfo.Address,
                                           appServerInfo.Port,
                                           session.ThemeName,
                                           info.Icon);
                strReturn = url;
            }
            catch (Exception ex)
            {
                CurrentApp.WriteLog("GetAppIcon", string.Format("Fail.\t{0}", ex.Message));
            }
            return(strReturn);
        }
Beispiel #8
0
 private void QueryChanInfo(MonitorObject obj)
 {
     try
     {
         OperationReturn optReturn;
         if (obj != null)
         {
             string         strMonID = obj.MonID;
             RequestMessage request  = new RequestMessage();
             request.Command = (int)Service04Command.ReqQueryChan;
             request.ListData.Add("1");
             request.ListData.Add(strMonID);
             CurrentApp.WriteLog("QueryChan", string.Format("MonObj:{0}", obj.ObjValue));
             lock (this)
             {
                 optReturn = mMonitorClient.SendMessage(request);
             }
             if (!optReturn.Result)
             {
                 CurrentApp.WriteLog("QueryChan",
                                     string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #9
0
 private void DealExtStateChangedMessage(NotifyMessage notMessage)
 {
     try
     {
         if (notMessage.ListData.Count < 2)
         {
             CurrentApp.WriteLog("DealExtState", string.Format("NotifyMessage param count invalid"));
             return;
         }
         string          strMonID   = notMessage.ListData[0];
         string          strExtInfo = notMessage.ListData[1];
         OperationReturn optReturn;
         optReturn = XMLHelper.DeserializeObject <ExtensionInfo>(strExtInfo);
         if (!optReturn.Result)
         {
             CurrentApp.WriteLog("DealExtState", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         ExtensionInfo extInfo = optReturn.Data as ExtensionInfo;
         if (extInfo == null)
         {
             CurrentApp.WriteLog("DealExtState", string.Format("ExtInfo is null"));
             return;
         }
         var item = mListAllRegionExtItems.FirstOrDefault(e => e.MonID == strMonID);
         if (item != null)
         {
             item.ExtInfo = extInfo;
         }
     }
     catch (Exception ex)
     {
         CurrentApp.WriteLog("DealExtState", string.Format("Fail.\t{0}", ex.Message));
     }
 }
Beispiel #10
0
 public override void ChangeLanguage()
 {
     CurrentApp.WriteLog("UC_EncryptionPolicyManagement ChangeLanguage");
     base.ChangeLanguage();
     #region 更新当前ursercontrol中控件的显示文字
     //更新listview种列的显示文字
     CreateColumnsItems();
     #endregion
     #region 循环修改操作按钮的显示文字
     Button        btn;
     OperationInfo optInfo;
     ObservableCollection <OperationInfo> listOptInfos = new ObservableCollection <OperationInfo>();
     for (int i = 0; i < PanelOperationButtons.Children.Count; i++)
     {
         try
         {
             btn             = PanelOperationButtons.Children[i] as Button;
             optInfo         = btn.DataContext as OperationInfo;
             optInfo.Display = CurrentApp.GetLanguageInfo(string.Format("FO{0}", optInfo.ID), optInfo.ID.ToString());
             listOptInfos.Add(optInfo);
         }
         catch
         {
             continue;
         }
     }
     CreateOptButtons(listOptInfos);
     #endregion
     GetAllPolicies();
     InitChildPolicies();
     InitLanguage();
     PopupPanel.ChangeLanguage();
 }
Beispiel #11
0
        public override void ChangeLanguage()
        {
            try
            {
                base.ChangeLanguage();
                CurrentApp.AppTitle = CurrentApp.GetLanguageInfo("FO1112", "UMP Domain Management");
                //Operation
                for (int i = 0; i < ListOperations.Count; i++)
                {
                    ListOperations[i].Display = CurrentApp.GetLanguageInfo(string.Format("FO{0}", ListOperations[i].ID),
                                                                           ListOperations[i].ID.ToString());
                }
                CreateOptButtons();
                this.ExpBasicOpt.Header = CurrentApp.GetLanguageInfo("1112001", "基本操作");

                //InitOperations(); CreateOptButtons();
                CreateDomainDataColumns();
                if (PopupPanel.IsOpen)
                {
                    PopupPanel.Title = CurrentApp.GetLanguageInfo("1112P001", "");
                    PopupPanel.ChangeLanguage();
                }
            }
            catch (Exception ex)
            {
                CurrentApp.WriteLog("ChangeLang", string.Format("ChangeLang fail.\t{0}", ex.Message));
            }
        }
Beispiel #12
0
        private void InitMonitorClient()
        {
            try
            {
                if (mMonitorClient != null)
                {
                    mMonitorClient.Stop();
                    mMonitorClient = null;
                }

                string strAddress = CurrentApp.Session.AppServerInfo.Address;
                int    intPort    = CurrentApp.Session.AppServerInfo.SupportHttps
                    ? CurrentApp.Session.AppServerInfo.Port - 5
                    : CurrentApp.Session.AppServerInfo.Port - 4;

                //string strAddress = "192.168.5.31";
                //int intPort = 8081 - 4;

                mMonitorClient        = new NetClient();
                mMonitorClient.Debug += (mode, cat, msg) => CurrentApp.WriteLog("MonitorClient", string.Format("{0}\t{1}", cat, msg));
                mMonitorClient.ReturnMessageReceived += NMonMonitorClient_ReturnMessageReceived;
                mMonitorClient.NotifyMessageReceived += NMonMonitorClient_NotifyMessageReceived;
                mMonitorClient.IsSSL = true;
                mMonitorClient.Connect(strAddress, intPort);
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #13
0
        private void InitTempFrame()
        {
            try
            {
                string strArgs = CurrentApp.StartArgs;
                if (string.IsNullOrEmpty(strArgs))
                {
                    //CurrentApp.ShowExceptionMessage(string.Format("StartArgs invalid"));
                    //return;
                    strArgs = "9801";
                }
                var moduleInfo = mListModuleInfos.FirstOrDefault(m => m.Module.ToString() == strArgs);
                if (moduleInfo == null)
                {
                    CurrentApp.WriteLog("PageLoad", string.Format("ModuleInfo not exist.\t{0}", strArgs));
                    return;
                }
                string url = moduleInfo.Url;
                FrameTemp.Navigate(new Uri(url, UriKind.RelativeOrAbsolute));

                CurrentApp.WriteLog("PageLoad", string.Format("Frame url setted.\t{0}", url));
            }
            catch (Exception ex)
            {
                CurrentApp.ShowExceptionMessage(ex.Message);
            }
        }
Beispiel #14
0
        private void LoadChannelObjects()
        {
            try
            {
                mListChannelObjects.Clear();
                OperationReturn optReturn;
                for (int i = 0; i < mListVoiceObjects.Count; i++)
                {
                    var  voice      = mListVoiceObjects[i];
                    long voiceObjID = voice.ObjID;

                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)S2106Codes.GetChannelList;
                    webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
                    webRequest.ListData.Add(voiceObjID.ToString());
                    Service21061Client client = new Service21061Client(
                        WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                        WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service21061"));
                    WebReturn webReturn = client.DoOperation(webRequest);
                    if (!webReturn.Result)
                    {
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                    if (webReturn.ListData == null)
                    {
                        ShowException(string.Format("ListData is null."));
                        return;
                    }
                    int count = 0;
                    for (int j = 0; j < webReturn.ListData.Count; j++)
                    {
                        string strInfo = webReturn.ListData[j];

                        optReturn = XMLHelper.DeserializeObject <ResourceObject>(strInfo);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        ResourceObject obj = optReturn.Data as ResourceObject;
                        if (obj == null)
                        {
                            ShowException(string.Format("ResourceObject is null."));
                            return;
                        }
                        mListChannelObjects.Add(obj);
                        count++;
                    }

                    CurrentApp.WriteLog("LoadChannelObjects", string.Format("End.\t{0}\t{1}", voiceObjID, count));
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #15
0
        private void LoadScoreSheets()
        {
            try
            {
                ClearChildItem();
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3101Codes.GetScoreSheetList;
                webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
                Service31011Client client = new Service31011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31011"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                List <string>   listScoreSheet = webReturn.ListData;
                OperationReturn optReturn;
                for (int i = 0; i < listScoreSheet.Count; i++)
                {
                    string strScoreSheetInfo = listScoreSheet[i];
                    optReturn = XMLHelper.DeserializeObject <BasicScoreSheetInfo>(strScoreSheetInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    BasicScoreSheetInfo scoreSheetInfo = optReturn.Data as BasicScoreSheetInfo;
                    if (scoreSheetInfo == null)
                    {
                        ShowException(string.Format("Fail.\tScoreSheetInfo is null"));
                        return;
                    }
                    ScoreSheetItem scoreSheetItem = new ScoreSheetItem();
                    scoreSheetItem.ID             = scoreSheetInfo.ID;
                    scoreSheetItem.Name           = scoreSheetInfo.Name;
                    scoreSheetItem.State          = scoreSheetInfo.State;
                    scoreSheetItem.TotalScore     = scoreSheetInfo.TotalScore;
                    scoreSheetItem.ItemCount      = scoreSheetInfo.ItemCount;
                    scoreSheetItem.ViewClassic    = scoreSheetInfo.ViewClassic;
                    scoreSheetItem.ScoreType      = scoreSheetInfo.ScoreType;
                    scoreSheetItem.UseFlag        = scoreSheetInfo.UseFlag;
                    scoreSheetItem.Description    = scoreSheetInfo.Description;
                    scoreSheetItem.TipState       = "State:" + scoreSheetItem.State;
                    scoreSheetItem.TipViewClassic = "ViewClassic" + scoreSheetItem.ViewClassic;
                    scoreSheetItem.TipScoreType   = "ScoreType:" + scoreSheetItem.ScoreType;
                    scoreSheetItem.Data           = scoreSheetInfo;
                    AddChildItem(scoreSheetItem);
                }

                CurrentApp.WriteLog("PageLoad", string.Format("Load ScoreSheet"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #16
0
        private void getAllPointTable()
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code = (int)S3103Codes.GetAllPointTable;
              //  Service31031Client client = new Service31031Client();
                Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                WebReturn webReturn = client.UMPTaskOperation(webRequest);
                client.Close();
                if (!webReturn.Result) 
                {
                    ShowException(string.Format("Fail.{0}\t{1}",webReturn.Code,webReturn.Message));
                }
                ComboBoxItem item;
            //    OperationReturn optReturn;        
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {

                    if (!string.IsNullOrWhiteSpace(webReturn.ListData[i]))
                    {
                        string[] array = webReturn.ListData[i].Split(';');
                        OperationInfo info = new OperationInfo();
                        info.ID = Convert.ToInt64(array[0]);
                        info.Description = array[1];
                        item = new ComboBoxItem();
                        item.DataContext = info;
                        item.Content = array[1];
                        cnPointTable.Items.Add(item);
                    }
                 //   string strScoreSheetInfo = webReturn.ListData[i];
               //     optReturn = XMLHelper.DeserializeObject<ScoreSheetInfo>(strScoreSheetInfo);
                    //if (!optReturn.Result)
                    //{
                    //    ShowException(string.Format("Fail.{0}\t{1}", optReturn.Code, optReturn.Message));
                    //    return;
                    //}
              //     ScoreSheetInfo scoreSheetInfo = optReturn.Data as ScoreSheetInfo;
                    //if (scoreSheetInfo == null)
                    //{
                    //    ShowException(string.Format("Fail.\tScoreSheetInfo is null"));
                    //    return;
                    //}
                   // ScoreSheetItemBind item = new ScoreSheetItemBind(scoreSheetInfo);
                    //item.ScoreSheetID = scoreSheetInfo.ScoreSheetID;
                    //item.Title = scoreSheetInfo.Title;
                    //item.TotalScore = scoreSheetInfo.TotalScore;
                  //  string strName = scoreSheetInfo.Title;
//                 string strSheetID = scoreSheetInfo.ID.ToString();
                 //   string strSheetInfo = string.Format("{0}{1}{2}",strName,ConstValue.SPLITER_CHAR_2,scoreSheetInfo.ScoreSheetID);
                 //   strList.Add(strName);
                 //   mScoreSheetItemsBind.Add(item);
                }

                CurrentApp.WriteLog("PageLoad", string.Format("Load ScoreSheet"));
            }
            catch (Exception ex) { }
        }
Beispiel #17
0
        private void DealQueryChanResponse(ReturnMessage retMessage)
        {
            try
            {
                OperationReturn optReturn;
                if (retMessage.ListData == null || retMessage.ListData.Count < 1)
                {
                    CurrentApp.WriteLog("DealQueryChan", string.Format("ListData is null or count invalid"));
                    return;
                }
                string strCount = retMessage.ListData[0];
                int    intCount;
                if (!int.TryParse(strCount, out intCount))
                {
                    CurrentApp.WriteLog("DealQueryChan", string.Format("ListData count param invalid"));
                    return;
                }
                if (retMessage.ListData.Count < intCount + 1)
                {
                    CurrentApp.WriteLog("DealQueryChan", string.Format("ListData count invalid"));
                    return;
                }
                for (int i = 0; i < intCount; i++)
                {
                    var strInfo = retMessage.ListData[i + 1];
                    optReturn = XMLHelper.DeserializeObject <MonitorObject>(strInfo);
                    if (!optReturn.Result)
                    {
                        CurrentApp.WriteLog("DealQueryChan",
                                            string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    MonitorObject obj = optReturn.Data as MonitorObject;
                    if (obj == null)
                    {
                        CurrentApp.WriteLog("DealQueryChan", string.Format("MonitorObject is null"));
                        return;
                    }
                    if (mMonitorObject.ObjID == obj.ObjID && mMonitorObject.Role == obj.Role)
                    {
                        mMonitorObject.UpdateInfo(obj);
                        if (mMonitorItem != null)
                        {
                            Dispatcher.Invoke(new Action(mMonitorItem.UpdateState));
                        }

                        //查询通道状态
                        QueryChanState();

                        //开始监听
                        StartNMonObject();
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #18
0
        private void CaculateSeatNum(ChildRegionItem childRegionItem, RegionStateItem regionStateItem)
        {
            try
            {
                var stateInfo = regionStateItem.StateInfo;
                if (stateInfo == null)
                {
                    return;
                }
                int stateType  = stateInfo.Type;
                int stateValue = stateInfo.Value;
                int num        = 0;
                for (int i = 0; i < childRegionItem.ListRegionExtItems.Count; i++)
                {
                    var extItem = childRegionItem.ListRegionExtItems[i];

                    var extInfo = extItem.ExtInfo;
                    if (extInfo == null)
                    {
                        continue;
                    }
                    ExtStateInfo extState = extInfo.ListStateInfos.FirstOrDefault(s => s.StateType == stateType);
                    if (extState == null)
                    {
                        continue;
                    }
                    if (stateType == S4410Consts.STATE_TYPE_LOGIN ||
                        stateType == S4410Consts.STATE_TYPE_RECORD)
                    {
                        if ((extState.State & stateValue) > 0)
                        {
                            num++;
                        }
                    }
                    else
                    {
                        if (extState.State == stateValue)
                        {
                            num++;
                        }
                    }
                }
                //regionStateItem.SeatNum = num;
                Dispatcher.Invoke(new Action(() =>
                {
                    regionStateItem.SeatNum = num;
                    var viewer = childRegionItem.Viewer;
                    if (viewer != null)
                    {
                        viewer.Refresh();
                    }
                }));
            }
            catch (Exception ex)
            {
                CurrentApp.WriteLog("CaculateSeatNum", string.Format("Fail.\t{0}", ex.Message));
            }
        }
Beispiel #19
0
        private string GetOptContentDisplay(OperationLogInfo optLogInfo)
        {
            string strReturn = optLogInfo.LogArgs;

            try
            {
                var lang = mListOptContentLanguages.FirstOrDefault(l => l.Name == optLogInfo.LangID);
                if (lang != null)
                {
                    strReturn = lang.Display;
                }
                string strRegex1   = string.Format("{{\\d+}}");
                Regex  regex1      = new Regex(strRegex1);
                var    collection1 = regex1.Matches(strReturn);
                int    count1      = collection1.Count;
                if (count1 > 0)
                {
                    string[] arrArgs =
                        optLogInfo.LogArgs.Split(new[] { string.Format("{0}{0}{0}", ConstValue.SPLITER_CHAR_2) },
                                                 StringSplitOptions.None);
                    for (int i = 0; i < count1; i++)
                    {
                        if (arrArgs.Length > i)
                        {
                            strReturn = strReturn.Replace(collection1[i].Value, arrArgs[i]);
                        }
                    }
                }
                string strRegex2   = string.Format("{0}<{0}\\w+{0}>{0}", ConstValue.SPLITER_CHAR_2);
                Regex  regex2      = new Regex(strRegex2);
                var    collection2 = regex2.Matches(strReturn);
                int    count2      = collection2.Count;
                if (count2 > 0)
                {
                    for (int i = 0; i < count2; i++)
                    {
                        string str = collection2[i].Value;
                        if (str.Length > 6)
                        {
                            string strID = str.Substring(3, str.Length - 6);
                            lang = mListOptContentLanguages.FirstOrDefault(l => l.Name == strID);
                            if (lang != null)
                            {
                                strReturn =
                                    strReturn.Replace(
                                        string.Format("{0}<{0}{1}{0}>{0}", ConstValue.SPLITER_CHAR_2, strID),
                                        lang.Display);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CurrentApp.WriteLog("GetOptContentDisplay", string.Format("Fail.\t{0}", ex.Message));
            }
            return(strReturn);
        }
Beispiel #20
0
 private void DealChanStateChanged(NotifyMessage notMessage)
 {
     try
     {
         OperationReturn optReturn;
         if (notMessage.ListData == null || notMessage.ListData.Count < 3)
         {
             CurrentApp.WriteLog("ChanStateChanged", string.Format("ListData is null or count invalid"));
             return;
         }
         string strMonID        = notMessage.ListData[0];
         string strState        = notMessage.ListData[1];
         string strNewChanObjID = notMessage.ListData[2];
         long   newChanObjID;
         if (strMonID == mMonitorObject.MonID)
         {
             MonitorObject obj = mMonitorObject;
             if (!string.IsNullOrEmpty(strNewChanObjID) &&
                 long.TryParse(strNewChanObjID, out newChanObjID) &&
                 newChanObjID > 0)
             {
                 //关联的通道变了,需要重新查询通道信息
                 QueryChanInfo(obj);
                 return;
             }
             optReturn = XMLHelper.DeserializeObject <ChanState>(strState);
             if (!optReturn.Result)
             {
                 CurrentApp.WriteLog("ChanStateChanged", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             ChanState chanState = optReturn.Data as ChanState;
             if (chanState == null)
             {
                 CurrentApp.WriteLog("ChanStateChanged", string.Format("ChannelState object is null"));
                 return;
             }
             if (mMonitorItem != null)
             {
                 if (obj.Role == 1)
                 {
                     mMonitorItem.VoiceChanState = chanState;
                 }
                 if (obj.Role == 2)
                 {
                     mMonitorItem.ScreenChanState = chanState;
                 }
                 mMonitorItem.TimeDeviation = mTimeDeviation;
                 Dispatcher.Invoke(new Action(mMonitorItem.UpdateState));
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #21
0
        private void LoadUserIDs()
        {
            try
            {
                mListUserIDs.Clear();
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)RequestCode.WSGetUserCtlObjList;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add("1");
                //webRequest.ListData.Add(string.Format("{0}{1}{2}{1}{3}", ConstValue.RESOURCE_ORG,
                //    ConstValue.SPLITER_CHAR, ConstValue.RESOURCE_AGENT, ConstValue.RESOURCE_TECHGROUP));
                webRequest.ListData.Add(string.Format("{0}{1}{2}", ConstValue.RESOURCE_ORG,
                                                      ConstValue.SPLITER_CHAR, ConstValue.RESOURCE_AGENT));
                webRequest.ListData.Add(string.Empty);
                webRequest.ListData.Add("0");
                Service11012Client client = new Service11012Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11012"));
                WebReturn webReturn = client.DoOperation(webRequest);
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("ListData is null"));
                    return;
                }
                OperationReturn optReturn;
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string strInfo = webReturn.ListData[i];
                    optReturn = XMLHelper.DeserializeObject <ResourceObject>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    ResourceObject info = optReturn.Data as ResourceObject;
                    if (info == null)
                    {
                        ShowException(string.Format("ResourceObject is null"));
                        return;
                    }
                    long objID = info.ObjID;
                    mListUserIDs.Add(objID);
                }

                CurrentApp.WriteLog("LoadUserIDs", string.Format("End.\t{0}", mListUserIDs.Count));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
        private void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            var CurrentFocusRecord = new UserTasksInfoShow();//目标任务to

            CurrentFocusRecord = (UserTasksInfoShow)LVUCanOperation.SelectedItem;
            if (CurrentFocusRecord != null && !string.IsNullOrWhiteSpace(selRemoveRecord))
            {
                string strrecord  = selRemoveRecord;                                     //选中的要移动的录音
                string taskidfrom = selfromtask.TaskID.ToString();                       //源任务from ID
                string numfrom    = (selfromtask.AssignNum - MoveNum).ToString();        //源任务数量修改成
                string taskidto   = CurrentFocusRecord.TaskID.ToString();                //目标任务to ID
                string numto      = (CurrentFocusRecord.AssignNum + MoveNum).ToString(); //目标任务数量修改成

                try
                {
                    WebRequest webRequest = new WebRequest();
                    webRequest.Code    = (int)S3103Codes.RemoveRecord2Task;
                    webRequest.Session = CurrentApp.Session;
                    webRequest.ListData.Add(strrecord);
                    webRequest.ListData.Add(taskidfrom);
                    webRequest.ListData.Add(numfrom);
                    webRequest.ListData.Add(taskidto);
                    webRequest.ListData.Add(numto);
                    webRequest.ListData.Add(selfromtask.AlreadyScoreNum.ToString()); //已经评分的数量
                    webRequest.ListData.Add(MoveTime.ToString());                    //移动的总时间
                    Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                    //WebHelper.SetServiceClient(client);
                    WebReturn webReturn = client.UMPTaskOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        CurrentApp.WriteOperationLog(S3103Consts.OPT_MOVETOOTHERTASK.ToString(), ConstValue.OPT_RESULT_FAIL, "");
                        ShowException(string.Format("{0}.\t{1}\t{2}", CurrentApp.GetLanguageInfo("3103T00043", "Operation Field."), webReturn.Code, webReturn.Message));
                        return;
                    }
                    else
                    {
                        #region 写操作日志
                        string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3103T00025"), strrecord);
                        strLog += string.Format("{0} {1}", Utils.FormatOptLogString("3103T00078"), selfromtask.TaskName);
                        strLog += string.Format("{0} {1}", Utils.FormatOptLogString("3103T00079"), CurrentFocusRecord.TaskName);
                        CurrentApp.WriteOperationLog(S3103Consts.OPT_MOVETOOTHERTASK.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                        CurrentApp.WriteLog("RemoveRecord2Task", string.Format("{0} \t OATaskCount {1} \t MoveCount {2} \t OBTaskCount {3} \t NATaskCount {4} \t NBTaskCount {5}", strLog, selfromtask.AssignNum, MoveNum, CurrentFocusRecord.AssignNum, selfromtask.AssignNum - MoveNum, CurrentFocusRecord.AssignNum + MoveNum));
                        #endregion
                        ShowInformation(CurrentApp.GetLanguageInfo("3103T00042", "Operation Succeed."));
                        ParentPage.ShowPopupPanel(false);
                        selfromtask.AssignNum -= MoveNum;
                        ParentPage.InitTaskDetail();
                    }
                }
                catch (Exception ex)
                {
                    ShowException(string.Format("{0}.\t{0}", CurrentApp.GetLanguageInfo("3103T00043", "Operation Field."), ex.Message));
                }
            }
        }
        private void LoadRegionSeatInfos()
        {
            try
            {
                mListRegionSeats.Clear();
                if (RegionItem == null)
                {
                    return;
                }
                long       regionID   = RegionItem.ObjID;
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S4410Codes.GetRegionSeatList;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(regionID.ToString());
                Service44101Client client = new Service44101Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service44101"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("Fail.\tListData is null"));
                    return;
                }
                OperationReturn optReturn;
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string strInfo = webReturn.ListData[i];
                    optReturn = XMLHelper.DeserializeObject <RegionSeatInfo>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    RegionSeatInfo info = optReturn.Data as RegionSeatInfo;
                    if (info == null)
                    {
                        ShowException(string.Format("Fail.\tRegionSeatInfo is null"));
                        return;
                    }
                    mListRegionSeats.Add(info);
                }

                CurrentApp.WriteLog("LoadRegionSeatInfo", string.Format("Load end.\t{0}", mListRegionSeats.Count));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
        public void SetInformation()
        {
            try
            {
                if (SetQuestionInfo.IntNum != 0)
                {
                    TbQuestionName.Text = string.Format("{0}、{1}", SetQuestionInfo.IntNum, SetQuestionInfo.questionParam.StrQuestionsContect);
                }
                else
                {
                    TbQuestionName.Text = string.Format("{0}", SetQuestionInfo.questionParam.StrQuestionsContect);
                }

                if (SetQuestionInfo.questionParam.StrAccessoryType == "wav" ||
                    SetQuestionInfo.questionParam.StrAccessoryType == "pcm")
                {
                    AccessoryName1.Visibility = Visibility.Visible;
                    if (LoadFiles())
                    {
                        PlayFiles(_mLoadPath, SetQuestionInfo.questionParam.StrAccessoryName);
                    }
                }
                if (SetQuestionInfo.questionParam.StrAccessoryType == "gif" ||
                    SetQuestionInfo.questionParam.StrAccessoryType == "jpg" ||
                    SetQuestionInfo.questionParam.StrAccessoryType == "jpeg" ||
                    SetQuestionInfo.questionParam.StrAccessoryType == "png")
                {
                    if (LoadFiles())
                    {
                        string ServerPath = string.Format("{0}://{1}:{2}/{3}", CurrentApp.Session.AppServerInfo.Protocol,
                                                          CurrentApp.Session.AppServerInfo.Address, CurrentApp.Session.AppServerInfo.Port, _mLoadPath);
                        AccessoryName2.Visibility = Visibility.Visible;
                        var bitmap1 = new BitmapImage();
                        bitmap1.BeginInit();
                        bitmap1.UriSource = new Uri(
                            string.Format("{0}", ServerPath),
                            UriKind.RelativeOrAbsolute);
                        bitmap1.EndInit();
                        ImageName.Source = bitmap1;
                        CurrentApp.WriteLog("Play File Sucessed!", string.Format("ServerPath : {0} ", ServerPath));
                    }
                }
                if (string.CompareOrdinal(SetQuestionInfo.questionParam.CorrectAnswerOne.ToString(), "T") != 0)
                {
                    RbutTofFalse.IsChecked = true;
                }
                else
                {
                    RbutTofTrue.IsChecked = true;
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #25
0
 private void LoadOptContentLanguages()
 {
     try
     {
         mListOptContentLanguages.Clear();
         int        count      = mListOptContentLangIDs.Count;
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S1200Codes.GetOptContentLangList;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(CurrentApp.Session.LangTypeInfo.LangID.ToString());
         webRequest.ListData.Add(count.ToString());
         for (int i = 0; i < count; i++)
         {
             webRequest.ListData.Add(mListOptContentLangIDs[i]);
         }
         CurrentApp.WriteLog("LoadOptContentLangs", string.Format("ContentLangID count.\t{0}", count));
         Service12001Client client = new Service12001Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service12001"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         OperationReturn optReturn;
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string strInfo = webReturn.ListData[i];
             optReturn = XMLHelper.DeserializeObject <LanguageInfo>(strInfo);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("WSFail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             LanguageInfo lang = optReturn.Data as LanguageInfo;
             if (lang == null)
             {
                 ShowException(string.Format("LanguageInfo is null"));
                 return;
             }
             mListOptContentLanguages.Add(lang);
         }
         CurrentApp.WriteLog("LoadOptContentLangs", string.Format("End.\t{0}", mListOptContentLanguages.Count));
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
        public void Load_Page()
        {
            switch (S2400App.CurrentLoadingModule)
            {
            case S2400App.S2400Module.EncryptionPolicy:
                CurrentApp.WriteLog("EncryptMainPage -   Init() EncryptionPolicy");
                grdMain.Children.Clear();
                UC_EncryptionPolicyManagement ucEncryptionPolicy = new UC_EncryptionPolicyManagement();
                ucEncryptionPolicy.CurrentApp = CurrentApp;
                ucEncryptionPolicy.parentWin  = this;
                // PageHead.AppName = CurrentApp.GetLanguageInfo("2402H006", "UMP encryption policy management");
                grdMain.Children.Add(ucEncryptionPolicy);
                CurrentApp.WriteLog("EncryptMainPage -   Init() EncryptionPolicy end");
                break;

            case S2400App.S2400Module.KeyGenServer:
                CurrentApp.WriteLog("EncryptMainPage -   Init() KeyGenServer");
                grdMain.Children.Clear();
                UC_EncryptServersManagement ucEncryptServersManagement = new UC_EncryptServersManagement();
                ucEncryptServersManagement.CurrentApp = CurrentApp;
                ucEncryptServersManagement.parentWin  = this;
                //  PageHead.AppName = CurrentApp.GetLanguageInfo("2401H001", "UMP encryption service management");
                grdMain.Children.Add(ucEncryptServersManagement);
                CurrentApp.WriteLog("EncryptMainPage -   Init() KeyGenServer end");
                break;

            case S2400App.S2400Module.KeyRemindSetting:
                grdMain.Children.Clear();
                UC_EncryptMailSetting ucRemindSetting = new UC_EncryptMailSetting();
                ucRemindSetting.CurrentApp = CurrentApp;
                ucRemindSetting.parentWin  = this;
                //PageHead.AppName = CurrentApp.GetLanguageInfo("2404H002", "UMP key update notification settings");
                grdMain.Children.Add(ucRemindSetting);
                break;

            case S2400App.S2400Module.ServerPolicyBinding:
                grdMain.Children.Clear();
                UC_EncryptionPolicyBindding ucBinding = new UC_EncryptionPolicyBindding();
                ucBinding.CurrentApp = CurrentApp;
                ucBinding.parentWin  = this;
                //PageHead.AppName = CurrentApp.GetLanguageInfo("2403H001", "UMP加密策略綁定");
                grdMain.Children.Add(ucBinding);
                break;

            default:
                CurrentApp.WriteLog("EncryptMainPage -   Init() default");
                grdMain.Children.Clear();
                ucEncryptServersManagement            = new UC_EncryptServersManagement();
                ucEncryptServersManagement.CurrentApp = CurrentApp;
                ucEncryptServersManagement.parentWin  = this;
                // PageHead.AppName = CurrentApp.GetLanguageInfo("2401H001", "UMP encryption service management");
                grdMain.Children.Add(ucEncryptServersManagement);
                break;
            }
        }
Beispiel #27
0
        private void LoadUserWidgetPropertyValues()
        {
            try
            {
                mListWidgetPropertyValues.Clear();
                if (WidgetItem == null)
                {
                    return;
                }
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S1200Codes.GetUserWidgetPropertyValueList;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(WidgetItem.WidgetID.ToString());
                Service12001Client client = new Service12001Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service12001"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("Fail.\tListData is null"));
                    return;
                }
                OperationReturn optReturn;
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string strInfo = webReturn.ListData[i];
                    optReturn = XMLHelper.DeserializeObject <UserWidgetPropertyValue>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    UserWidgetPropertyValue info = optReturn.Data as UserWidgetPropertyValue;
                    if (info == null)
                    {
                        ShowException(string.Format("WidgetPropertyInfo is null"));
                        return;
                    }
                    mListWidgetPropertyValues.Add(info);
                }

                CurrentApp.WriteLog("LoadPropertyValues", string.Format("End.\t{0}", mListWidgetPropertyValues.Count));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #28
0
        private void InitKeyWords(ObjectItemTask parentItem, string parentID)
        {
            try
            {
                mListKeywordInfos.Clear();
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3103Codes.GetKeyWords;

                //   Service31031Client client = new Service31031Client();
                Service31031Client client = new Service31031Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31031"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.UMPTaskOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("Fail.\tListData is null"));
                    return;
                }
                OperationReturn optReturn;
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string strInfo = webReturn.ListData[i];
                    optReturn = XMLHelper.DeserializeObject <KeywordInfo>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    KeywordInfo info = optReturn.Data as KeywordInfo;
                    if (info == null)
                    {
                        ShowException(string.Format("KeywordInfo is null."));
                        return;
                    }
                    mListKeywordInfos.Add(info);
                }

                CurrentApp.WriteLog("LoadKeywordInfos", string.Format("End.\t{0}", mListKeywordInfos.Count));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #29
0
        private void LoadUserInfoList()
        {
            try
            {
                mListUserInfoList.Clear();

                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)RequestCode.WSGetUserCtlObjList;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add("2");
                webRequest.ListData.Add(ConstValue.RESOURCE_USER.ToString());
                webRequest.ListData.Add(string.Empty);
                Service11012Client client = new Service11012Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11012"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("Fail.\tListData is null"));
                    return;
                }
                OperationReturn optReturn;
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string strInfo = webReturn.ListData[i];
                    optReturn = XMLHelper.DeserializeObject <ResourceObject>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    ResourceObject info = optReturn.Data as ResourceObject;
                    if (info == null)
                    {
                        ShowException(string.Format("Fail.\tResourceObject is null"));
                        return;
                    }
                    mListUserInfoList.Add(info);
                }

                CurrentApp.WriteLog("LoadUserInfoList", string.Format("Load end.\t{0}", mListUserInfoList.Count));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #30
0
        private bool AddKwContent(KwContentInfoParam kwConnectInfoParam)
        {
            try
            {
                string strLog;
                var    webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S5101Codes.OptAddKwContent;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(kwConnectInfoParam);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return(false);
                }
                webRequest.ListData.Add(optReturn.Data.ToString());
                var client = new Service51011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service51011"));
                //var client = new Service51011Client();
                var webReturn = client.UmpTaskOperation(webRequest);
                client.Close();
                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5101T00029", "Create"));
                if (!webReturn.Result)
                {
                    #region 写操作日志

                    strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("5101T00029"),
                                           Utils.FormatOptLogString("5101T00038"), webReturn.Message);
                    CurrentApp.WriteOperationLog(S5101Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_FAIL, strLog);

                    #endregion

                    CurrentApp.WriteLog(webReturn.Message);
                    ShowException(webReturn.Message);
                    return(false);
                }

                #region 写操作日志

                strLog = string.Format("{0} {1}", Utils.FormatOptLogString("5101T00029"),
                                       Utils.FormatOptLogString("5101T00039"));
                CurrentApp.WriteOperationLog(S5101Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                #endregion

                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5101T00039", "Create Success"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                return(false);
            }
            return(true);
        }