Ejemplo n.º 1
0
        /// <summary>
        /// 初始化用户信息以及样式
        /// </summary>
        protected override void Init()
        {
            try
            {
                PageName  = "AppealReview";
                StylePath = "UMPS3105/MainPageStyle.xaml";

                base.Init();
                SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading data, please wait...")));
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, string.Empty);

                    CreateOptButtons();
                    BindData();
                    ReviewHistory();
                    ChangeLanguage();
                    ChangeTheme();
                    CurrentApp.SendLoadedMessage();//加载完各种消息发送登录消息给UMP
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 2
0
 void PapersListInfoLoaded()
 {
     try
     {
         SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", "Loading data, please wait..."));
         _mWorker = new BackgroundWorker();
         _mWorker.WorkerReportsProgress      = true;
         _mWorker.WorkerSupportsCancellation = true;
         //注册线程主体方法
         _mWorker.DoWork += (s, de) =>
         {
         };
         _mWorker.RunWorkerCompleted += (s, re) =>
         {
             ChangeLanguage();
             _mWorker.Dispose();
             SetBusy(false, CurrentApp.GetMessageLanguageInfo("001", "Ready"));
         };
         _mWorker.RunWorkerAsync(); //触发DoWork事件
     }
     catch (Exception)
     {
         SetBusy(false, CurrentApp.GetMessageLanguageInfo("001", "Ready"));
     }
 }
Ejemplo n.º 3
0
        protected override void Init() //用了init()方法之后,不能在用this.load的方法了
        {
            try
            {
                PageName  = "UMP TaskRecordDetail";
                StylePath = "UMPS3103/MainPageStyle.xaml";
                base.Init();
                if (CurrentApp != null)
                {
                    CurrentApp.SendLoadedMessage();
                }

                InitTaskDetailColumns();
                InitTaskDetail();
                CreateOperationButton();
                SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading...")));

                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, "");
                    ChangeLanguage();
                    ChangeTheme();
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 4
0
 private void CaculateScore()
 {
     try
     {
         if (mCurrentScoreSheet != null)
         {
             var result = mCurrentScoreSheet.CheckInputValid();
             if (result.Code != 0)
             {
                 ShowException(string.Format("Check input valid fail.\t{0}", result.Code));
                 return;
             }
             var score  = mCurrentScoreSheet.CaculateScore();
             var viewer = BorderScoreSheetViewer.Child as StatisticalScoreSheetViewer;
             if (viewer != null)
             {
                 viewer.CaculateScore();
             }
             CurrentApp.ShowInfoMessage(string.Format("{0}\t{1}",
                                                      CurrentApp.GetMessageLanguageInfo("010", "Caculate score end."),
                                                      score.ToString("0.00")));
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 初始化用户信息以及样式
        /// </summary>
        protected override void Init() //用了init()方法之后,不能在用this.load的方法了
        {
            try
            {
                PageName  = "AppealManage";
                StylePath = "UMPS3105/MainPageStyle.xaml";
                base.Init();

                SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading data, please wait...")));
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    GetAuInfoLists();
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, string.Empty);

                    CreatePageButtons();
                    CreateOptButtons();
                    InitAppealColumns();
                    ChangeLanguage();
                    ChangeTheme();
                    CurrentApp.SendLoadedMessage();//加载完各种消息发送登录消息给UMP
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 6
0
 private void Init()
 {
     MRootItem.Children.Clear();
     _mListOrgUserItems.Clear();
     if (PageParent != null)
     {
         PageParent.SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", "Loading data, please wait..."));
     }
     _mWorker         = new BackgroundWorker();
     _mWorker.DoWork += (s, de) =>
     {
         LoadAvaliableObject();
         LoadTestUser();
     };
     _mWorker.RunWorkerCompleted += (s, re) =>
     {
         _mWorker.Dispose();
         if (PageParent != null)
         {
             PageParent.SetBusy(false, CurrentApp.GetMessageLanguageInfo("001", "Ready"));
         }
         SetObjectCheckState();
     };
     _mWorker.RunWorkerAsync();
 }
Ejemplo n.º 7
0
 private void DeleteDomianInfo()
 {
     try
     {
         if (Domaininfo == null)
         {
             return;
         }
         string strInfoMsg = CurrentApp.GetLanguageInfo("1112T008", "确定删除改域信息吗?");
         var    result     = MessageBox.Show(string.Format("{0}\r\n\r\n{1}",
                                                           CurrentApp.GetMessageLanguageInfo("003", "Confirm delete user ?"),
                                                           strInfoMsg), "UMP",
                                             MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             WebRequest webRequest = new WebRequest();
             webRequest.Code    = (int)S1112Codes.SaveDomainInfo;
             webRequest.Session = CurrentApp.Session;
             webRequest.ListData.Add("0");
             OperationReturn optR = XMLHelper.SeriallizeObject(Domaininfo);
             if (!optR.Result)
             {
                 CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optR.Code, optR.Message));
                 return;
             }
             webRequest.ListData.Add(optR.Data as string);
             Service11121Client client = new Service11121Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11121"));
             WebReturn webReturn = client.DoOperation(webRequest);
             client.Close();
             if (!webReturn.Result)
             {
                 //if (webReturn.Code == 99)
                 //{
                 //    App.ShowExceptionMessage(App.GetLanguageInfo("", "域名已存在"));
                 //}
                 //else
                 //{
                 CurrentApp.ShowExceptionMessage(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                 //}
                 return;
             }
             CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1112T002", "域信息删除成功"));
             //写操作日志
             string msg = string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("FO1112003", "delete"), Domaininfo.DomainName);
             CurrentApp.WriteOperationLog(string.Format("1112003"), ConstValue.OPT_RESULT_SUCCESS, msg);
             mListDomainInfo.Clear();
             InitDomainInfo();
         }
     }
     catch (Exception ex)
     {
         string msg = string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("FO1112003", "delete"), Domaininfo.DomainName);
         CurrentApp.WriteOperationLog(string.Format("1112003"), ConstValue.OPT_RESULT_FAIL, msg);
         CurrentApp.ShowExceptionMessage(ex.Message);
     }
 }
Ejemplo n.º 8
0
        protected override void Init()
        {
            try
            {
                PageName  = "MainPage";
                StylePath = "UMPS1112/MainPage.xaml";

                base.Init();
                if (CurrentApp != null)
                {
                    S1112App = CurrentApp as S1112App;
                }
                else
                {
                    S1112App = new S1112App(false);
                }
                ChangeTheme();
                ChangeLanguage();

                mListDomainInfo.Clear();
                SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading data, please wait...")));
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    InitOperations();
                    InitRecordDataColumns();
                    InitDomainInfo();
                    CurrentApp.WriteLog("PageLoad", string.Format("All data loaded"));
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, string.Empty);
                    CreateOptButtons();
                    CreateDomainDataColumns();
                    //触发Loaded消息
                    CurrentApp.SendLoadedMessage();

                    ChangeTheme();
                    ChangeLanguage();

                    CurrentApp.WriteLog(string.Format("Load\t\tPage load end"));
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                CurrentApp.ShowExceptionMessage(ex.Message);
            }
        }
        private void DeleteCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var item = e.Parameter as ConfigObject;

            if (item != null)
            {
                string strMsg = string.Empty;
                List <ConfigObject> listItems = new List <ConfigObject>();
                listItems.Add(item);
                strMsg += string.Format("{0}\r\n", item.Name);
                var  items = LvResourceObjects.SelectedItems;
                bool over  = false;
                for (int i = 0; i < items.Count; i++)
                {
                    var temp = items[i] as ConfigObject;
                    if (temp != null)
                    {
                        if (!listItems.Contains(temp))
                        {
                            listItems.Add(temp);
                            //提示消息最长128个字符
                            if (strMsg.Length < 128 && !over)
                            {
                                strMsg += string.Format("{0}\r\n", temp.Name);
                            }
                            else if (!over)
                            {
                                strMsg += string.Format("...");
                                over    = true;
                            }
                        }
                    }
                }
                var result = MessageBox.Show(string.Format("{0}\r\n\r\n{1}",
                                                           CurrentApp.GetMessageLanguageInfo("009", "Confirm remove this resource?"),
                                                           strMsg),
                                             CurrentApp.AppName,
                                             MessageBoxButton.YesNo,
                                             MessageBoxImage.Question);
                if (result != MessageBoxResult.Yes)
                {
                    return;
                }
                ResourceObjectListerEventEventArgs args = new ResourceObjectListerEventEventArgs();
                args.Code = 3;
                args.Data = listItems;
                OnResourceObjectListerEvent(args);
            }
        }
Ejemplo n.º 10
0
 void UCAlarmInfoDetail_Drop(object sender, DragEventArgs e)
 {
     try
     {
         var data = e.Data;
         if (data == null)
         {
             return;
         }
         var obj = data.GetData(typeof(ObjectItem)) as ObjectItem;
         if (obj == null)
         {
             return;
         }
         var message = obj.Data as AlarmMessageInfo;
         if (message == null)
         {
             return;
         }
         //只能使用消息和状态类别下的告警消息
         if (message.MessageID == 0 && message.StatusID == 0)
         {
             return;
         }
         if (ListAllAlarmInfoItems != null)
         {
             var temp = ListAllAlarmInfoItems.FirstOrDefault(i => i.MessageID == message.SerialID);
             if (temp != null)
             {
                 ShowException(CurrentApp.GetMessageLanguageInfo("002", "Alarm message already exist."));
                 return;
             }
         }
         if (AlarmInfoItem == null)
         {
             return;
         }
         AlarmInfoItem.MessageID = message.SerialID;
         AlarmInfoItem.InitItem();
         Init();
         ChangeLanguage();
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Ejemplo n.º 11
0
        private void RemoveTabItem()
        {
            try
            {
                if (mListTabItems.Count <= 1)
                {
                    ShowException(CurrentApp.GetMessageLanguageInfo("013", "At least one tab item"));
                    return;
                }
                var tabItem = TabControlCondition.SelectedItem as ConditionTabItem;

                for (int j = 0; j < tabItem.Items.Count; j++)
                {
                    if (tabItem.Items[j].Name == "TimeTypeFromTo")
                    {
                        ShowException(CurrentApp.GetLanguageInfo("3102N038", "Can't delete the TabItem containing TimeTypeFromTo"));//加语言包~~
                        return;
                    }
                }
                if (tabItem != null)
                {
                    var result = MessageBox.Show(string.Format("{0}\r\n{1}",
                                                               CurrentApp.GetMessageLanguageInfo("012", "Confirm remove tab?"),
                                                               tabItem.TabName),
                                                 CurrentApp.AppName,
                                                 MessageBoxButton.YesNo,
                                                 MessageBoxImage.Question);
                    if (result == MessageBoxResult.Yes)
                    {
                        for (int i = tabItem.Items.Count - 1; i >= 0; i--)
                        {
                            ConditionItemItem item = tabItem.Items[i];
                            item.IsUserItem = false;
                            tabItem.Items.Remove(item);
                            mListUserConditions.Remove(item);
                            mListAvaliableConditions.Add(item);
                        }
                        mListTabItems.Remove(tabItem);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 12
0
        private bool CheckValue()
        {
            //if (this.ComboCTIType.SelectedIndex == -1)
            //{
            //    return false;
            //}
            if (this.RadBatch.IsChecked == false && this.RadSyn.IsChecked == false)
            {
                return(false);
            }
            if (this.RadBatch.IsChecked == true)
            {
                if (string.IsNullOrEmpty(TxtExt.Text))
                {
                    ShowException(CurrentApp.GetMessageLanguageInfo("018", "Device Name invalid"));
                    return(false);
                }
                //if (this.ComboBaseExt.SelectedIndex == -1 && this.TxtCount.Text != "1")
                //{
                //    ShowException(CurrentApp.GetMessageLanguageInfo("014100", "Basic PBXDevice invalid"));
                //    return false;
                //}
                //if (mListBasicPBXDeviceItems.Count == 0)
                //{
                //    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1110N019", "请配置一个基本的PBX Device"));
                //    ClosePanel();
                //    return;
                //}
            }
            int intValue;

            if (TxtCount.Value == null)
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("016", "Count invalid"));
                return(false);
            }
            intValue = (int)TxtCount.Value;
            if (intValue <= 0 || intValue > 1024)
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("016", "Count invalid"));
                return(false);
            }
            //PBX有上限吗?**************************
            return(true);
        }
Ejemplo n.º 13
0
        protected override void Init()
        {
            try
            {
                PageName  = "SCMainView";
                StylePath = "UMPS3108/SCMainPage.xaml";

                base.Init();
                mListObjectItems.Clear();
                mListStatisticalParamItemDetails_ = new List <StatisticalParamItemDetail>();
                //ChangeTheme();
                //ChangeLanguage();

                SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading data, please wait...")));
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    //触发Loaded消息
                    CurrentApp.SendLoadedMessage();

                    InitOperation();
                    InitStatisticalParam();
                    InitQualityParam();
                    InitParam();

                    CurrentApp.WriteLog("PageLoad", string.Format("All data loaded"));
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, string.Empty);

                    InitOperation();
                    LoadTree(mRoot, "0", 0);

                    ChangeLanguage();
                    CurrentApp.WriteLog(string.Format("Load\t\tPage load end"));
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 14
0
        private bool CheckInput()
        {
            if (string.IsNullOrEmpty(TxtAccount.Text.Trim()))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("008", "Account is empty"));
                return(false);
            }
            if (string.IsNullOrEmpty(TxtFullName.Text.Trim()))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("009", "FullName is empty"));
                return(false);
            }
            if (string.IsNullOrEmpty(TxtOrg.Text.Trim()))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("010", "ParentOrg is empty"));
                return(false);
            }
            try
            {
                DateTime starttiime = DateTime.Parse(dtValidTime.Value.ToString());
                try
                {
                    DateTime stoptime = DateTime.Parse(dtInValidTime.Value.ToString());
                    if (starttiime >= stoptime)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N023", "Start Time Must Smaller Than The Valid Time"));
                        return(false);
                    }
                }
                catch (Exception)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N021", "Convert Valid Time Error"));
                    return(false);
                }
            }
            catch (Exception)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N022", "Convert inValid Time Error"));
                return(false);
            }

            return(true);
        }
Ejemplo n.º 15
0
        protected override void Init()
        {
            try
            {
                PageName  = "UMP TaskTrack";
                StylePath = "UMPS3103/MainPageStyle.xaml";
                base.Init();
                if (CurrentApp != null)
                {
                    CurrentApp.SendLoadedMessage();
                }

                InitOperationButton();
                AddQueryBtnOperation();
                BindCommands();
                InitTaskColumns();
                GetCurrentOperationFromApp(S3103Consts.OPT_TASKTRACK);
                string dtstart = DateTime.Now.AddMonths(-1).ToUniversalTime().ToString();
                string dtend   = DateTime.Now.AddMonths(1).ToUniversalTime().ToString();
                InitTasks("2", "0", string.Empty, string.Empty);//默认显示所有未完成的任务记录
                //触发状态栏动画
                SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading...")));
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    //具体加载任务数据的方法
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    SetBusy(false, "");

                    ChangeTheme();
                    ChangeLanguage();
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 16
0
 private void AddNewUser(BasicUserInfo basicUserInfo)
 {
     try
     {
         OperationReturn optReturn = XMLHelper.SeriallizeObject(basicUserInfo);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S1101Codes.AddNewUser;
         webRequest.Data    = optReturn.Data.ToString();
         Service11011Client client = new Service11011Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service11011"));
         WebHelper.SetServiceClient(client);
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
             {
                 ShowException(CurrentApp.GetMessageLanguageInfo("007", "User account already exist"));
                 return;
             }
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         basicUserInfo.UserID = Convert.ToInt64(webReturn.Data);
         mAsyncResult         = true;
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Ejemplo n.º 17
0
        private bool CheckInput()
        {
            int intValue;

            if (TxtCount.Value == null)
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("016", "Count invalid"));
                return(false);
            }
            intValue = (int)TxtCount.Value;
            if (intValue <= 0 || intValue > 1024)
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("016", "Count invalid"));
                return(false);
            }
            if (string.IsNullOrEmpty(TxtExt.Text))
            {
                ShowException(CurrentApp.GetMessageLanguageInfo("017", "Extension invalid"));
                return(false);
            }
            return(true);
        }
Ejemplo n.º 18
0
 void QueryConditionPage_Loaded(object sender, RoutedEventArgs e)
 {
     SetBusy(true, CurrentApp.GetMessageLanguageInfo("001", string.Format("Loading data, please wait...")));
     mWorker         = new BackgroundWorker();
     mWorker.DoWork += (s, de) =>
     {
         GetKeyWord();
     };
     mWorker.RunWorkerCompleted += (s, re) =>
     {
         mWorker.Dispose();
         SetBusy(false, string.Empty);
         InitQueryDetailColumns();
         InitQueryDetail();
         InitTaskDetailColumns();
         InitTaskDetail();
         CreatoptButtons();
     };
     mWorker.RunWorkerAsync();
     LvTaskDetail.ItemsSource     = ListTaskItems;
     LvQueryCondition.ItemsSource = ListQueryItems;
 }
Ejemplo n.º 19
0
        private bool CheckCount()
        {
            if (TxtCount.Value == null)
            {
                return(false);
            }
            int intCount = (int)TxtCount.Value;

            if (ListResourceGroupParams == null)
            {
                return(false);
            }
            ResourceGroupParam groupParam =
                ListResourceGroupParams.FirstOrDefault(
                    g => g.TypeID == S1110Consts.RESOURCE_SCREENSERVER && g.GroupID == 1);

            if (groupParam == null)
            {
                return(false);
            }
            int intMaxinum = groupParam.IntValue02;

            if (mParentObject == null)
            {
                return(false);
            }
            int existNum = mParentObject.ListChildObjects.Count(o => o.ObjectType == S1110Consts.RESOURCE_SCREENCHANNEL);

            if (intCount + existNum > intMaxinum)
            {
                ShowException(string.Format("{0}\r\n\r\n{1}\t{2}",
                                            CurrentApp.GetMessageLanguageInfo("008", "Over maxinum value"),
                                            CurrentApp.GetLanguageInfo(string.Format("OBJ{0}", S1110Consts.RESOURCE_SCREENCHANNEL), S1110Consts.RESOURCE_SCREENCHANNEL.ToString()),
                                            intMaxinum));
                return(false);
            }
            return(true);
        }
Ejemplo n.º 20
0
        private void ModifyUserInfo(List <string> listParams)
        {
            try
            {
                if (listParams == null)
                {
                    return;
                }
                WebRequest webRequest = new WebRequest();
                webRequest.Session  = CurrentApp.Session;
                webRequest.Code     = (int)S1101Codes.ModifyUserInfo;
                webRequest.ListData = listParams;

                Service11011Client client = new Service11011Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service11011"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
                    {
                        ShowException(CurrentApp.GetMessageLanguageInfo("007", "User account already exist"));
                        return;
                    }
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                mAsyncResult = true;
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 21
0
        private void ShowRecordOperatorMessage(OperationReturn optReturn)
        {
            try
            {
                int code = optReturn.Code;
                switch (code)
                {
                case RecordOperator.RET_DOWNLOADSERVER_NOT_EXIST:
                    ShowException(CurrentApp.GetMessageLanguageInfo("014", "Download server not exist."));
                    break;

                case RecordOperator.RET_DOWNLOAD_APPSERVER_FAIL:
                    ShowException(CurrentApp.GetMessageLanguageInfo("035", "Download fail"));
                    break;

                case RecordOperator.RET_GET_REAL_PASSWORD_FAIL:
                    ShowException(CurrentApp.GetMessageLanguageInfo("043", "Get real password fail."));
                    break;

                case Service03Consts.DECRYPT_PASSWORD_ERROR:
                    ShowException(CurrentApp.GetMessageLanguageInfo("048", "Decrypt password error"));
                    break;

                case Defines.RET_TIMEOUT:
                    ShowException(CurrentApp.GetLanguageInfo("3102N047", "Receive message timeout"));
                    break;

                case RecordOperator.RET_NO_RECORDINFO:
                    ShowException(string.Format("RecordInfo is null"));
                    break;
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 22
0
 void RemoveCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         var uc = e.Parameter as UCConditionPreViewItem;
         if (uc != null)
         {
             var item = uc.ConditionItemItem;
             if (item != null)
             {
                 var tabItem = mListTabItems.FirstOrDefault(t => t.TabIndex == item.TabIndex);
                 if (tabItem != null)
                 {
                     var conditionItem = tabItem.Items.FirstOrDefault(c => c.ID == item.ID);
                     if (conditionItem != null)
                     {
                         if (conditionItem.ConditionItem != null && conditionItem.ConditionItem.ViewMode == 2)
                         {
                             ShowException(CurrentApp.GetMessageLanguageInfo("011", "Always show item can't be removed"));
                             return;
                         }
                         tabItem.Items.Remove(conditionItem);
                         mListUserConditions.Remove(conditionItem);
                         tabItem.SetSortID();
                         conditionItem.IsUserItem = false;
                         mListAvaliableConditions.Add(conditionItem);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Ejemplo n.º 23
0
        private void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            List <DomainObjectItem> mListSaveDomainInfo = new List <DomainObjectItem>();

            //获取所有打钩的对象
            GetSaveObject(mRoot, ref mListSaveDomainInfo);
            if (mListSaveDomainInfo.Count == 0)
            {
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("", "请选择用户")); return;
            }
            try
            {
                foreach (DomainObjectItem BItem in mListSaveDomainInfo)
                {
                    BasicUserInfo basicUserInfo = new BasicUserInfo();
                    basicUserInfo.SourceFlag = "L";

                    basicUserInfo.CreateTime    = DateTime.Now;
                    basicUserInfo.StartTime     = DateTime.Parse("2014/1/1 00:00:00");
                    basicUserInfo.EndTime       = DateTime.Parse(S1101Consts.Default_StrEndTime.ToString());
                    basicUserInfo.StrCreateTime = basicUserInfo.CreateTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                    basicUserInfo.StrStartTime  = basicUserInfo.StartTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                    basicUserInfo.StrEndTime    = basicUserInfo.EndTime.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                    if (BItem.FullName.Contains("@"))
                    {
                        basicUserInfo.Account = BItem.FullName;
                    }
                    else
                    {
                        basicUserInfo.Account = string.Format("{0}@{1}", IStrADDomain, BItem.FullName);
                    }
                    basicUserInfo.Creator   = CurrentApp.Session.UserID;
                    basicUserInfo.FullName  = BItem.Name;
                    basicUserInfo.OrgID     = OrgObjItem.ObjID;
                    basicUserInfo.Password  = string.Empty;
                    basicUserInfo.IsActived = "1";


                    OperationReturn optReturn = XMLHelper.SeriallizeObject(basicUserInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)S1101Codes.LoadNewUser;
                    webRequest.Data    = optReturn.Data.ToString();
                    Service11011Client client = new Service11011Client(
                        WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                        WebHelper.CreateEndpointAddress(
                            CurrentApp.Session.AppServerInfo,
                            "Service11011"));
                    WebHelper.SetServiceClient(client);
                    WebReturn webReturn = client.DoOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
                        {
                            ShowException(CurrentApp.GetMessageLanguageInfo("007", "User account already exist"));
                            //return;
                            continue;
                        }
                        ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                    basicUserInfo.UserID = Convert.ToInt64(webReturn.Data);
                    //修改密码为M003加码
                    webRequest.Code = (int)S1101Codes.ModifyUserPasswordM003;
                    webRequest.ListData.Add(basicUserInfo.UserID.ToString());
                    webRequest.ListData.Add("0");
                    webRequest.ListData.Add(string.Empty);
                    Service11011Client clientCP = new Service11011Client(
                        WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                        WebHelper.CreateEndpointAddress(
                            CurrentApp.Session.AppServerInfo,
                            "Service11011"));
                    WebHelper.SetServiceClient(clientCP);
                    WebReturn webReturnCP = clientCP.DoOperation(webRequest);
                    clientCP.Close();
                    if (!webReturnCP.Result)
                    {
                        ShowException(string.Format("Change Passworld Fail:{0}\t{1}", webReturnCP.Code, webReturnCP.Message));
                    }
                }
                ParenntPage.ReloadData();
                CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1101N029", "Import User Data Successful"));

                string msg = string.Format("{0}:{1}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1101012"), IStrADDomain);
                CurrentApp.WriteOperationLog(S1101Consts.OPT_LDAP.ToString(), ConstValue.OPT_RESULT_SUCCESS, msg);
            }
            catch (Exception ex)
            {
                ShowException(CurrentApp.GetLanguageInfo("1101N037", "导入失败") + ex.Message);
                #region 日志
                string msg = string.Format("{0}:{1}", Utils.FormatOptLogString("FO1101012"), IStrADDomain);
                CurrentApp.WriteOperationLog("1101012", ConstValue.OPT_RESULT_FAIL, msg);
                #endregion
            }
            PageClose();
        }
Ejemplo n.º 24
0
        private void GetRealPassword(RecordEncryptInfo info)
        {
            try
            {
                if (RecordInfoItem == null)
                {
                    return;
                }
                RecordInfo recordInfo = RecordInfoItem.RecordInfo;
                if (recordInfo == null)
                {
                    return;
                }
                if (MainPage != null)
                {
                    MainPage.SetBusy(true, CurrentApp.GetMessageLanguageInfo("042", "Getting real password"));
                }
                bool isSuccess = false;
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    try
                    {
                        OperationReturn optReturn;
                        RecordOperator  recordOperator = new RecordOperator(recordInfo);
                        recordOperator.Debug             += (cat, msg) => CurrentApp.WriteLog(cat, msg);
                        recordOperator.Session            = CurrentApp.Session;
                        recordOperator.ListSftpServers    = ListSftpServers;
                        recordOperator.ListDownloadParams = ListDownloadParams;
                        recordOperator.ListEncryptInfo    = ListEncryptInfo;
                        recordOperator.Service03Helper    = Service03Helper;
                        optReturn = recordOperator.GetRealPassword(info);
                        if (!optReturn.Result)
                        {
                            //获取实际密钥失败,不再弹出错误提示框,写一条错误日志,实际解密的时候使用输入密钥作为实际密钥

                            //ShowRecordOperatorMessage(optReturn);
                            CurrentApp.WriteLog("GetRealPass",
                                                string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            //return;
                        }
                        isSuccess = true;
                    }
                    catch (Exception ex)
                    {
                        CurrentApp.WriteLog("GetRealPass", string.Format("Fail.\t{0}", ex.Message));
                    }
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    if (MainPage != null)
                    {
                        MainPage.SetBusy(false);
                    }
                    if (!isSuccess)
                    {
                        CurrentApp.WriteLog("GetRealPass", string.Format("Get real password fail."));
                        return;
                    }
                    PlayRecord();
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 25
0
        private void PlayRecord()
        {
            try
            {
                if (RecordInfoItem == null)
                {
                    return;
                }
                RecordInfo recordInfo = RecordInfoItem.RecordInfo;
                if (recordInfo == null)
                {
                    return;
                }
                string fileName = string.Empty;
                VoicePlayer.IsEnabled = false;

                List <string> listRelativeNames = new List <string>();

                //艺赛旗录屏无需下载,也不用解密转换等操作,直接跳过以下操作
                if (recordInfo.MediaType == 3)
                {
                    fileName = recordInfo.IsaRefID;
                    VoicePlayer.IsEnabled = true;
                    PlayRecord(fileName, listRelativeNames);
                    return;
                }

                if (MainPage != null)
                {
                    MainPage.SetBusy(true, string.Format("{0}",
                                                         CurrentApp.GetMessageLanguageInfo("015", "Downloading record file...")));
                }
                bool isOptSuccess = true;
                if (MainPage != null)
                {
                    MainPage.IsBusy = true;
                }
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    try
                    {
                        OperationReturn optReturn;

                        //获取关联的录屏文件
                        GetRelativeRecordInfos();

                        //处理录音记录
                        RecordOperator recordOperator = new RecordOperator(recordInfo);
                        recordOperator.Debug             += (cat, msg) => CurrentApp.WriteLog(cat, msg);
                        recordOperator.Session            = CurrentApp.Session;
                        recordOperator.ListSftpServers    = ListSftpServers;
                        recordOperator.ListDownloadParams = ListDownloadParams;
                        recordOperator.ListEncryptInfo    = ListEncryptInfo;
                        recordOperator.Service03Helper    = Service03Helper;
                        //下载文件到AppServer
                        optReturn = recordOperator.DownloadFileToAppServer();
                        if (!optReturn.Result)
                        {
                            ShowRecordOperatorMessage(optReturn);
                            CurrentApp.WriteLog("DownloadAppServer",
                                                string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        fileName = optReturn.Data.ToString();

                        var relativeRecords = RecordInfoItem.ListRelativeInfos;
                        if (relativeRecords.Count > 0)
                        {
                            //如果有关联的录屏文件
                            for (int i = 0; i < relativeRecords.Count; i++)
                            {
                                var relativeRecord = relativeRecords[i];
                                if (relativeRecord.MediaType == 3)
                                {
                                    //艺赛旗录屏无需下载,也不用解密转换等操作,直接跳过以下操作
                                    listRelativeNames.Add(relativeRecord.IsaRefID);
                                }
                                else
                                {
                                    //下载录屏文件到AppServer
                                    recordOperator.RecordInfo = relativeRecord;
                                    optReturn = recordOperator.DownloadFileToAppServer();
                                    if (!optReturn.Result)
                                    {
                                        CurrentApp.WriteLog("DownloadAppServer",
                                                            string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                                    }
                                    else
                                    {
                                        listRelativeNames.Add(optReturn.Data.ToString());
                                    }
                                }
                            }
                        }


                        if (recordInfo.RecordVersion == 101)
                        {
                            //华为V3录音不需要解密,此处不做操作
                        }
                        else
                        {
                            //原始解密
                            recordOperator.RecordInfo = recordInfo;
                            optReturn = recordOperator.OriginalDecryptRecord(fileName);
                            if (!optReturn.Result)
                            {
                                ShowRecordOperatorMessage(optReturn);
                                CurrentApp.WriteLog("OriginalDecrypt",
                                                    string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                                return;
                            }
                            fileName = optReturn.Data.ToString();

                            //解密文件
                            recordOperator.RecordInfo = recordInfo;
                            optReturn = recordOperator.DecryptRecord(fileName);
                            if (!optReturn.Result)
                            {
                                ShowRecordOperatorMessage(optReturn);
                                CurrentApp.WriteLog("DecryptRecord",
                                                    string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                                if (optReturn.Code == Service03Consts.DECRYPT_PASSWORD_ERROR)
                                {
                                    isOptSuccess = false;
                                }
                                return;
                            }
                            fileName = optReturn.Data.ToString();
                        }

                        //转换格式
                        recordOperator.RecordInfo = recordInfo;
                        optReturn = recordOperator.ConvertWaveFormat(fileName);
                        if (!optReturn.Result)
                        {
                            ShowRecordOperatorMessage(optReturn);
                            CurrentApp.WriteLog("ConvertWaveFormat",
                                                string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        fileName = optReturn.Data.ToString();
                    }
                    catch (Exception ex)
                    {
                        CurrentApp.WriteLog("PlayRecord", string.Format("Fail.\t{0}", ex.Message));
                    }
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    if (MainPage != null)
                    {
                        MainPage.SetBusy(false);
                    }
                    if (MainPage != null)
                    {
                        MainPage.IsBusy = false;
                    }
                    if (!isOptSuccess)
                    {
                        return;
                    }
                    VoicePlayer.IsEnabled = true;
                    PlayRecord(fileName, listRelativeNames);
                };
                mWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 26
0
        private void SetScoreSheetUser()
        {
            if (ScoreSheetItem == null)
            {
                return;
            }
            List <string> listObjectState = new List <string>();

            SetScoreSheetUser(mRootItem, ref listObjectState);

            if (listObjectState.Count > 0)
            {
                if (PageParent != null)
                {
                    PageParent.SetBusy(true, string.Empty);
                }
                mWorker         = new BackgroundWorker();
                mWorker.DoWork += (s, de) =>
                {
                    try
                    {
                        int        count      = listObjectState.Count;
                        WebRequest webRequest = new WebRequest();
                        webRequest.Session = CurrentApp.Session;
                        webRequest.Code    = (int)S3101Codes.SetScoreSheetUser;
                        webRequest.ListData.Add(ScoreSheetItem.ID.ToString());
                        webRequest.ListData.Add(count.ToString());
                        for (int i = 0; i < count; i++)
                        {
                            webRequest.ListData.Add(listObjectState[i]);
                        }
                        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.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                            return;
                        }
                        CurrentApp.WriteLog("SetScoreSheetUser", webReturn.Data);

                        #region 写操作日志

                        string        strAdded      = string.Empty;
                        string        strRemoved    = string.Empty;
                        List <string> listLogParams = new List <string>();
                        if (webReturn.ListData != null && webReturn.ListData.Count > 0)
                        {
                            for (int i = 0; i < webReturn.ListData.Count; i++)
                            {
                                string   strInfo  = webReturn.ListData[i];
                                string[] arrInfos = strInfo.Split(new[] { ConstValue.SPLITER_CHAR },
                                                                  StringSplitOptions.RemoveEmptyEntries);
                                if (arrInfos.Length >= 2)
                                {
                                    if (arrInfos[0] == "A")
                                    {
                                        var objItem =
                                            mListOrgUserItems.FirstOrDefault(o => o.ObjID.ToString() == arrInfos[1]);
                                        if (objItem != null)
                                        {
                                            strAdded += objItem.Name + ",";
                                        }
                                        else
                                        {
                                            strAdded += arrInfos[1] + ",";
                                        }
                                    }
                                    if (arrInfos[0] == "D")
                                    {
                                        var objItem =
                                            mListOrgUserItems.FirstOrDefault(o => o.ObjID.ToString() == arrInfos[1]);
                                        if (objItem != null)
                                        {
                                            strRemoved += objItem.Name + ",";
                                        }
                                        else
                                        {
                                            strRemoved += arrInfos[1] + ",";
                                        }
                                    }
                                }
                            }
                            strAdded   = strAdded.TrimEnd(new[] { ',' });
                            strRemoved = strRemoved.TrimEnd(new[] { ',' });
                        }
                        listLogParams.Add(strAdded);
                        listLogParams.Add(strRemoved);
                        CurrentApp.WriteOperationLog(S3101Consts.OPT_SETMANAGEUSER.ToString(), ConstValue.OPT_RESULT_SUCCESS, "3101Log0001", listLogParams);

                        #endregion

                        ShowInformation(CurrentApp.GetMessageLanguageInfo("004", "Set ScoreSheet user end"));
                    }
                    catch (Exception ex)
                    {
                        ShowException(ex.Message);
                    }
                };
                mWorker.RunWorkerCompleted += (s, re) =>
                {
                    mWorker.Dispose();
                    if (PageParent != null)
                    {
                        PageParent.SetBusy(false, string.Empty);
                    }
                    var parent = Parent as PopupPanel;
                    if (parent != null)
                    {
                        parent.IsOpen = false;
                    }
                };
                mWorker.RunWorkerAsync();
            }
        }
Ejemplo n.º 27
0
        //这个只是将备注其存到T_31_046备注表
        private void SaveRecordMemo()
        {
            try
            {
                if (string.IsNullOrEmpty(TxtMemoContent.Text))
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N037", string.Format("Memo content is empty")));
                    return;
                }
                if (TxtMemoContent.Text.ToString().Length > 1024)
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N036", "Save the content is too long"));
                    return;
                }
                RecordMemoItem item = mListRecordMemos.FirstOrDefault(m => m.UserID == CurrentApp.Session.UserID);
                if (item == null)
                {
                    RecordMemoInfo info = new RecordMemoInfo();
                    info.ID               = 0;
                    info.RecordSerialID   = RecordInfoItem.SerialID;
                    info.UserID           = CurrentApp.Session.UserID;
                    info.MemoTime         = DateTime.Now;
                    info.Content          = TxtMemoContent.Text;
                    info.State            = "1";
                    info.LastModifyUserID = CurrentApp.Session.UserID;
                    info.LastModifyTime   = DateTime.Now;
                    info.Source           = "U";
                    item = new RecordMemoItem(info);
                }
                else
                {
                    RecordMemoInfo info = item.RecordMemoInfo;
                    info.Content          = TxtMemoContent.Text;
                    info.LastModifyUserID = CurrentApp.Session.UserID;
                    info.LastModifyTime   = DateTime.Now;
                }
                OperationReturn optReturn = XMLHelper.SeriallizeObject(item.RecordMemoInfo);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                string strMemoInfo = optReturn.Data.ToString();

                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.SaveRecordMemoInfo;
                webRequest.ListData.Add(RecordInfoItem.SerialID.ToString());
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(strMemoInfo);
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31021"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                CurrentApp.WriteLog(string.Format("Save RecordMemo end.\t{0}", webReturn.Data));

                #region 写操作日志

                string strLog = string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102001RecordReference"), item.RecordSerialID);
                strLog += string.Format("{0}", item.Content);
                CurrentApp.WriteOperationLog(S3102Consts.OPT_MEMORECORD.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                #endregion

                CurrentApp.ShowInfoMessage(CurrentApp.GetMessageLanguageInfo("003", "Save RecordMemo end"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 28
0
        private void DeleteScoreSheet(ScoreSheetItem item)
        {
            if (item != null)
            {
                if (item.UseFlag > 0)
                {
                    ShowInformation(CurrentApp.GetLanguageInfo("3101N006", "Score Sheet Was Used, Can Not Be Delete"));
                    return;
                }
                var result = MessageBox.Show(string.Format("{0}\r\n\r\n{1}",
                                                           CurrentApp.GetMessageLanguageInfo("001", "Confirm delete scoresheet?"),
                                                           item.Name),
                                             CurrentApp.AppName, MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    SetBusy(true, string.Empty);
                    mWorker         = new BackgroundWorker();
                    mWorker.DoWork += (s, de) =>
                    {
                        try
                        {
                            WebRequest webRequest = new WebRequest();
                            webRequest.Session = CurrentApp.Session;
                            webRequest.Code    = (int)S3101Codes.RemoveScoreSheetInfo;
                            webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
                            webRequest.ListData.Add(item.ID.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)
                            {
                                if (webReturn.Message.Equals("NoExist"))
                                {
                                    ShowInformation(CurrentApp.GetLanguageInfo("3101N005", "Score Sheet Is Not Exist"));
                                    return;
                                }
                                if (webReturn.Message.Equals("BeUsed"))
                                {
                                    ShowInformation(CurrentApp.GetLanguageInfo("3101N006", "Score Sheet Was Used, Can Not Be Delete"));
                                    return;
                                }
                                ShowException(string.Format("Fail.{0}\t{1}", webReturn.Code, webReturn.Message));
                                return;
                            }
                            LoadScoreSheets();


                            #region 写操作日志

                            string strLog = string.Format("{0} {1} ", Utils.FormatOptLogString("COL3101001Name"), item.Name);
                            CurrentApp.WriteOperationLog(S3101Consts.OPT_DELETESCORESHEET.ToString(),
                                                         ConstValue.OPT_RESULT_SUCCESS, strLog);

                            #endregion
                        }
                        catch (Exception ex)
                        {
                            ShowException(ex.Message);
                        }
                    };
                    mWorker.RunWorkerCompleted += (s, re) =>
                    {
                        mWorker.Dispose();
                        SetBusy(false, string.Empty);
                    };
                    mWorker.RunWorkerAsync();
                }
            }
        }
Ejemplo n.º 29
0
 private void GetChildDirItems(ObjectItem parentItem)
 {
     try
     {
         string strAddress = string.Empty;
         if (string.IsNullOrEmpty(strAddress))
         {
             ShowException(string.Format("Server address is empty"));
             return;
         }
         if (parentItem == null)
         {
             return;
         }
         var parentDir = parentItem.Data as DirInfo;
         if (parentDir == null)
         {
             return;
         }
         ServerRequestInfo requestInfo = new ServerRequestInfo();
         requestInfo.ServerHost = strAddress;
         requestInfo.ServerPort = 8009;
         requestInfo.Command    = (int)ServerRequestCommand.GetChildDirectoryList;
         requestInfo.ListData.Add(parentDir.Path);
         OperationReturn optReturn = XMLHelper.SeriallizeObject(requestInfo);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S1110Codes.GetServerInfo;
         webRequest.Data    = optReturn.Data.ToString();
         Service11102Client client = new Service11102Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service11102"));
         WebReturn webReturn = null;
         if (MainPage != null)
         {
             MainPage.SetBusy(true, CurrentApp.GetMessageLanguageInfo("004", "Getting server directory information"));
         }
         mWorker         = new BackgroundWorker();
         mWorker.DoWork += (s, de) =>
         {
             try
             {
                 webReturn = client.DoOperation(webRequest);
                 client.Close();
             }
             catch (Exception ex)
             {
                 ShowException(ex.Message);
             }
         };
         mWorker.RunWorkerCompleted += (s, re) =>
         {
             mWorker.Dispose();
             if (MainPage != null)
             {
                 MainPage.SetBusy(false, string.Empty);
             }
             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;
             }
             parentItem.Children.Clear();
             for (int i = 0; i < webReturn.ListData.Count; i++)
             {
                 string   info    = webReturn.ListData[i];
                 string[] arrInfo = info.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.None);
                 if (arrInfo.Length < 2)
                 {
                     continue;
                 }
                 DirInfo dirInfo = new DirInfo();
                 dirInfo.Name = arrInfo[0];
                 dirInfo.Path = arrInfo[1];
                 ObjectItem item = new ObjectItem();
                 item.Type        = S1110Consts.OBJECTITEMTYPE_DIRINFO;
                 item.Name        = dirInfo.Name;
                 item.Icon        = string.Format("../Themes/Default/UMPS1110/Images/{0}", "folder.png");
                 item.Description = dirInfo.Path;
                 item.Data        = dirInfo;
                 parentItem.AddChild(item);
             }
             if (mConfigObject != null)
             {
                 switch (mConfigObject.ObjectType)
                 {
                 case S1110Consts.RESOURCE_VOICESERVER:
                 case S1110Consts.RESOURCE_NTIDRVPATH:
                     //GetChildFileItems(parentItem);
                     break;
                 }
             }
             parentItem.IsExpanded = true;
         };
         mWorker.RunWorkerAsync();
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Ejemplo n.º 30
0
        private void SaveScoreInfo()
        {
            try
            {
                DateTime scoreStopTime = DateTime.Now;
                double   aaa           = (scoreStopTime - mScoreStartTime).TotalSeconds;
                //MessageBox.Show(aaa.ToString());
                ScoreSheetItem.ScoreSheetInfo.WasteTime = aaa;
                //MessageBox.Show("sss");
                if (mCurrentScoreSheet == null)
                {
                    return;
                }
                mCurrentScoreSheet.CaculateScore();
                ScoreSheetItem.ScoreSheetInfo.Score = mCurrentScoreSheet.Score;
                ScoreSheetItem.Score = ScoreSheetItem.ScoreSheetInfo.Score;
                if (!SaveScoreSheetResult())
                {
                    return;
                }
                SaveScoreDataResult();
                List <ScoreItem> listItems = new List <ScoreItem>();
                mCurrentScoreSheet.GetAllScoreItem(ref listItems);
                mListScoreItemResults.Clear();
                for (int i = 0; i < listItems.Count; i++)
                {
                    var temp = mListScoreItemResults.FirstOrDefault(s => s.ScoreResultID == ScoreSheetItem.ScoreResultID
                                                                    &&
                                                                    s.ScoreSheetID == ScoreSheetItem.ScoreSheetID &&
                                                                    s.ScoreItemID == listItems[i].ID);
                    if (temp == null)
                    {
                        temp = new BasicScoreItemInfo();
                        temp.ScoreResultID = ScoreSheetItem.ScoreResultID;
                        temp.ScoreSheetID  = ScoreSheetItem.ScoreSheetID;
                        temp.ScoreItemID   = listItems[i].ID;
                        temp.IsNA          = listItems[i].IsNA ? "Y" : "N";
                        mListScoreItemResults.Add(temp);
                    }
                    temp.Score     = listItems[i].Score;
                    temp.RealScore = listItems[i].RealScore;
                }
                if (!SaveScoreItemResult())
                {
                    return;
                }
                if (!SaveScoreCommentResult())
                {
                    return;
                }

                #region 写操作日志

                string strLog = string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102001RecordReference"), ScoreSheetItem.RecordSerialID);
                strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102003Title"), ScoreSheetItem.Title);
                strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3102003Score"), ScoreSheetItem.Score);
                CurrentApp.WriteOperationLog(S3102Consts.OPT_SCORERECORD.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                #endregion
                if (RecordInfoItem != null)
                {
                    RecordInfoItem.IsScored    = 1;
                    RecordInfoItem.StrIsScored = CurrentApp.GetLanguageInfo(string.Format("3102TIP001IsScored{0}", RecordInfoItem.IsScored), RecordInfoItem.IsScored.ToString());
                }

                CurrentApp.ShowInfoMessage(CurrentApp.GetMessageLanguageInfo("005", "Save Score info end"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }