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 SaveDomainInfo()
        {
            string OptCode = string.Empty;

            if (IsAdd == 1)
            {
                OptCode = "FO1112001";
            }
            else
            {
                OptCode = "FO1112002";
            }
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S1112Codes.SaveDomainInfo;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(IsAdd.ToString());
                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"));
                //Service11121Client client = new Service11121Client();
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    if (webReturn.Code == 99)
                    {
                        CurrentApp.ShowExceptionMessage(CurrentApp.GetLanguageInfo("", "域名已存在"));
                    }
                    else
                    {
                        CurrentApp.ShowExceptionMessage(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    }
                    return;
                }
                CurrentApp.GetLanguageInfo("1112T001", "域信息保存成功");
                //写操作日志

                string msg = string.Format("{0}:{1}", CurrentApp.GetLanguageInfo(OptCode, ""), domainInfo.DomainName);
                CurrentApp.WriteOperationLog(OptCode.Substring(2), ConstValue.OPT_RESULT_SUCCESS, msg);
                ParentPage.mListDomainInfo.Clear();
                ParentPage.InitDomainInfo();
            }
            catch (Exception ex)
            {
                if (OptCode != string.Empty)
                {
                    string msg = string.Format("{0}:{1}", CurrentApp.GetLanguageInfo(OptCode, ""), domainInfo.DomainName);
                    CurrentApp.WriteOperationLog(OptCode.Substring(2), ConstValue.OPT_RESULT_FAIL, msg);
                }
                CurrentApp.ShowExceptionMessage(ex.Message);
            }
        }
Beispiel #3
0
 void BtnConfirm_Click(object sender, RoutedEventArgs e)
 {
     //DateTime st = Convert.ToDateTime("03/03/2001 12:15:12");
     //DateTime et = Convert.ToDateTime("03/03/2009 12:15:12");
     //绑定关系,设置时间。检查时间是否正确。然后保存到数据库,返回给父辈窗口:listRelation进行数据插入,重新显示树
     if (CheckTime())
     {
         if (ParentPage.SaveRelation(resource, ST.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss"), ET.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss")))
         // if (ParentPage.SaveRelation(resource, st.ToUniversalTime().ToString("yyyy/MM/dd"), et.ToUniversalTime().ToString("yyyy/MM/dd")))
         {
             ShowInformation(CurrentApp.GetLanguageInfo("1111N001", "susseed"));
             #region 记录日志
             string msg = string.Format("{0}{1}{2}", resource.TenantName, Utils.FormatOptLogString("FO1111001"), resource.ResourceName);
             CurrentApp.WriteOperationLog(S1111Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_SUCCESS, msg);
             #endregion
         }
         else
         {
             ShowInformation(CurrentApp.GetLanguageInfo("1111N002", "fail"));
             #region 记录日志
             string msg = string.Format("{0}{1}{2}", resource.TenantName, Utils.FormatOptLogString("FO1111001"), resource.ResourceName);
             CurrentApp.WriteOperationLog(S1111Consts.OPT_Add.ToString(), ConstValue.OPT_RESULT_FAIL, msg);
             #endregion
         }
     }
     else
     {
         //提示:输入时间有错误
         ShowInformation(CurrentApp.GetLanguageInfo("1111N006", "Input time error"));
         return;
     }
     PopupPanelClose();
 }
Beispiel #4
0
        private void BtnApply_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (ScoreSheetItem != null)
                {
                    string name = string.Format("{0}.xml", ScoreSheetItemInfo.Name.ToString());
                    if (string.IsNullOrWhiteSpace(TxtSaveDir.Text.ToString()) || string.IsNullOrEmpty(TxtSaveDir.Text.ToString()))
                    {
                        ShowException(CurrentApp.GetLanguageInfo("3101N009", "请选择导出路径"));
                        return;
                    }
                    string          path      = Path.Combine(TxtSaveDir.Text.ToString(), name);
                    OperationReturn optReturn = XMLHelper.SerializeFile(mExportScoreSheet, path);
                    string          zipPath   = string.Format("{0}.{1}", path, "zip");
                    string          message   = string.Empty;
                    ZipFile(path, zipPath);
                    var parent = Parent as PopupPanel;
                    if (parent != null)
                    {
                        parent.IsOpen = false;
                    }
                    ShowInformation(CurrentApp.GetLanguageInfo("3101N007", "SECCESS"));

                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3101006")), ScoreSheetItemInfo.Name);
                    CurrentApp.WriteOperationLog(S3101Consts.OPT_EXPORTSCORESHEET.ToString(),
                                                 ConstValue.OPT_RESULT_SUCCESS, msg);
                }
            }
            catch (Exception ex)
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3101N008", "FAIL"));
            }
        }
Beispiel #5
0
 void ButtonDelete_Click(object sender, RoutedEventArgs e)
 {
     if (DeleteResource.IsUsed)
     {
         MessageBoxResult MBR = S1111App.ShowYNMessage(CurrentApp.GetLanguageInfo("1111N005", "确定要删除该条记录吗?"));
         if (MBR.Equals(MessageBoxResult.Yes))
         {
             if (DeleteRelation(DeleteResource))
             {
                 ShowInformation(CurrentApp.GetLanguageInfo("1111N003", "delete ok"));
                 #region 记录日志
                 string msg = string.Format("{0}{1}{2}", DeleteResource.TenantName, Utils.FormatOptLogString("FO1111002"), DeleteResource.ResourceName);
                 CurrentApp.WriteOperationLog(S1111Consts.OPT_Delete.ToString(), ConstValue.OPT_RESULT_SUCCESS, msg);
                 #endregion
             }
             else
             {
                 ShowInformation(CurrentApp.GetLanguageInfo("1111N004", "delete fail"));
                 #region 记录日志
                 string msg = string.Format("{0}{1}{2}", DeleteResource.TenantName, Utils.FormatOptLogString("FO1111002"), DeleteResource.ResourceName);
                 CurrentApp.WriteOperationLog(S1111Consts.OPT_Delete.ToString(), ConstValue.OPT_RESULT_FAIL, msg);
                 #endregion
             }
             //DeleteResource = new ResourceInfo();
         }
     }
     else
     {
         ShowInformation(CurrentApp.GetLanguageInfo("1111N009", "请选择需要删除的对象"));
     }
 }
        private void SaveConfig()
        {
            try
            {
                if (ListTransParams.Count == 0)
                {
                    return;
                }
                if (ListTransParams.Count == 1)
                {
                    ShowInformation(CurrentApp.GetLanguageInfo("310802T002", "没有小项")); return;
                }
                string     msg        = string.Empty;
                WebRequest webRequest = new WebRequest();
                webRequest.Code     = (int)S3108Codes.SaveConfig;
                webRequest.Session  = CurrentApp.Session;
                webRequest.ListData = ListTransParams;
                Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));
                WebHelper.SetServiceClient(client);
                //Service31081Client client = new Service31081Client();
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowInformation(string.Format("{0}\n{1}", CurrentApp.GetLanguageInfo("3108T002", "保存fail"),
                                                  string.Format("SaveConfig Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)));

                    #region 记录日志
                    msg = string.Format("{0}{1}{2}:{3}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108006")), OrgItem.Name, Statistic.StatisticalParamName);
                    CurrentApp.WriteOperationLog("3108006", ConstValue.OPT_RESULT_FAIL, msg);
                    #endregion
                    return;
                }
                // 0    大项编号
                // 1    cycletime
                // 2    rowname
                // 3    statisticKey
                int    index = 0;
                string ID    = webReturn.ListData[0];
                for (index = 0; index < ListABCD.Count(); index++)
                {
                    if (ListABCD[index].StatisticalParamID.ToString() == ID && ListABCD[index].StatisticKey == 0)
                    {
                        ListABCD[index].CycleTime    = Convert.ToInt64(webReturn.ListData[2]);
                        ListABCD[index].RowNum       = Convert.ToInt32(webReturn.ListData[1]);
                        ListABCD[index].StatisticKey = Convert.ToInt64(webReturn.ListData[3]);
                    }
                }
                ShowInformation(CurrentApp.GetLanguageInfo("3108T001", "保存成功"));
                #region 记录日志
                msg = string.Format("{0}{1}{2}:{3}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108006")), OrgItem.Name, Statistic.StatisticalParamName);
                CurrentApp.WriteOperationLog("3108006", ConstValue.OPT_RESULT_SUCCESS, msg);
                #endregion
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #7
0
 void BtnConfirm_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!CreateTaskCondition())
         {
             return;
         }
         if (!TaskDBOperation())
         {
             return;
         }
         var parent = Parent as PopupPanel;
         if (parent != null)
         {
             ParentPage.InitTaskDetail();
             #region 写操作日志
             string OpID   = S3107App.TaskModify == true ? "3107T00004" : "3107T00003";
             string strLog = string.Format("{0} {1}{2}", Utils.FormatOptLogString(OpID), Utils.FormatOptLogString("3107T00053"), TaskItems.AutoTaskName);
             CurrentApp.WriteOperationLog(S3107Consts.OPT_AutoTask.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
             #endregion
             parent.IsOpen = false;
         }
     }
     catch (Exception)
     {
         CurrentApp.WriteOperationLog(S3107Consts.OPT_AutoTask.ToString(), ConstValue.OPT_RESULT_FAIL, "");
     }
 }
 private void BtnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         OperationReturn SavaTemp = new OperationReturn();
         SavaTemp = SaveConfig();
         ModifyValue();
         string msg = string.Empty;
         if (SavaTemp.Result != true)
         {
             ShowInformation(CurrentApp.GetLanguageInfo("3108T002", "保存fail"));
             #region 记录日志
             msg = string.Format("{0}{1}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108004")));
             CurrentApp.WriteOperationLog(string.Format("3108004"), ConstValue.OPT_RESULT_FAIL, msg);
             #endregion
             return;
         }
         ShowInformation(CurrentApp.GetLanguageInfo("3108T001", "保存成功"));
         #region 记录日志
         msg = string.Format("{0}{1}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108004")));
         CurrentApp.WriteOperationLog(string.Format("3108004"), ConstValue.OPT_RESULT_SUCCESS, msg);
         #endregion
         if (PageParent.paramsItemsconfigPage != null)
         {
             PageParent.paramsItemsconfigPage.InitmStatisticalParam();
         }
         PageParent.PopupPanel.IsOpen = false;
     }
     catch (Exception ex)
     {
     }
 }
Beispiel #9
0
        /// <summary>
        /// 跳转到任务完成页面
        /// </summary>
        private void Jump2TaskDetail(bool hasModifyPremission)
        {
            UserTasksInfoShow CurrentFocusRecord = new UserTasksInfoShow();

            CurrentFocusRecord = (UserTasksInfoShow)LVTaskList.SelectedItem;
            if (CurrentFocusRecord != null)
            {
                #region 写操作日志
                string lancode = hasModifyPremission ? "3103T00073" : "3103T00039";
                string opid    = hasModifyPremission ? S3103Consts.OPT_MODIFYTASK.ToString() : S3103Consts.OPT_VIEWTASKDETAIL.ToString();
                string strLog  = string.Format("{0} {1}", Utils.FormatOptLogString(lancode), CurrentFocusRecord.TaskName);
                CurrentApp.WriteOperationLog(opid, ConstValue.OPT_RESULT_SUCCESS, strLog);
                #endregion
                mPageTaskRecordDetail            = new TaskRecordDetail();
                mPageTaskRecordDetail.PageParent = this;
                CurrentApp.CurrentView           = mPageTaskRecordDetail;
                mPageTaskRecordDetail.PageName   = "TaskRecordDetail";
                TaskRecordDetail.SelectTask      = CurrentFocusRecord;
                TaskRecordDetail.IsModify        = hasModifyPremission;
                var temp = CurrentApp as S3103App;
                if (temp != null)
                {
                    temp.InitMainView(mPageTaskRecordDetail);
                }
            }
        }
        void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (PageParent != null)
            {
                if (dateTimeStart.Value == null || dateTimeEnd.Value == null || dateTimeEnd.Value < dateTimeStart.Value)
                {
                    MessageBox.Show(CurrentApp.GetLanguageInfo("3103T00144", "Invalid Datetime."), CurrentApp.AppName);
                    return;
                }
                string dtstart = Convert.ToDateTime(dateTimeStart.Value).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                string dtend   = Convert.ToDateTime(dateTimeEnd.Value).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                string finish  = "";
                if (rbtnUnfinshed.IsChecked == true)
                {
                    finish = "0";
                }
                else if (rbtnFinshed.IsChecked == true)
                {
                    finish = "1";
                }
                else
                {
                    finish = "2";
                }
                PageParent.InitTasks("2", finish, dtstart, dtend);
                #region 写操作日志
                CurrentApp.WriteOperationLog(S3103Consts.OPT_TASKTRACK.ToString(), ConstValue.OPT_RESULT_SUCCESS, Utils.FormatOptLogString("3103T00133"));
                #endregion

                Close();
            }
        }
        private void ModifyKeyGenServer(StringValuePairs machineInfo)
        {
            string    strHost      = machineInfo.Value;
            string    strMachineID = machineInfo.Key;
            WebReturn webReturn    = null;
            string    strPort      = TxtPort.Text;

            string strStatusMsg = CurrentApp.GetLanguageInfo("2401022", "Is being revised, please later... .");

            mainPage.ShowStausMessage(strStatusMsg, true);
            mBackgroundWorker         = new BackgroundWorker();
            mBackgroundWorker.DoWork += (s, de) =>
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S2400RequestCode.ModifyKeyGenServer;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(strMachineID);
                webRequest.ListData.Add(strHost);
                webRequest.ListData.Add(strPort);
                Service24011Client client = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011"));
                webReturn = client.DoOperation(webRequest);
                CurrentApp.MonitorHelper.AddWebReturn(webReturn);
                client.Close();
            };
            mBackgroundWorker.RunWorkerCompleted += (s, de) =>
            {
                mainPage.ShowStausMessage(string.Empty, false);
                if (!webReturn.Result)
                {
                    if (webReturn.Code == (int)S2400WcfErrorCode.KeyGenServerExists)
                    {
                        BtnApply.IsEnabled = true;
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, CurrentApp.GetLanguageInfo(webReturn.Code.ToString(), webReturn.Message)));
                    }
                    else
                    {
                        BtnApply.IsEnabled = true;
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    }
                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2401004")), strHost);
                    CurrentApp.WriteOperationLog("2401004", ConstValue.OPT_RESULT_FAIL, msg);
                }
                else
                {
                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2401004")), strHost);
                    CurrentApp.WriteOperationLog("2401004", ConstValue.OPT_RESULT_SUCCESS, msg);
                    //添加成功 关闭当前popupPanel 刷新父窗口list
                    BtnApply.IsEnabled         = true;
                    mainPage.PopupPanel.IsOpen = false;
                    //mainPage.InitKeyGenServerList();
                    keyGenServerModifying.HostPort = TxtPort.Text;
                    keyGenServerModifying.Status   = true;
                    mainPage.UpdateKeyGenServerList(keyGenServerModifying, OperationType.Modify);
                    ShowInformation(CurrentApp.GetLanguageInfo("COMN001", "Success"));
                }
            };
            mBackgroundWorker.RunWorkerAsync();
        }
Beispiel #12
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);
     }
 }
        private void LevelEnableDisable(OperationType optType)
        {
            BookmarkLevelEntityInList level = lvBookmarkLevelsObject.SelectedItem as BookmarkLevelEntityInList;

            if (level == null)
            {
                return;
            }
            string strPopupMsg = string.Empty;

            if (optType == Common5100.OperationType.Enable)
            {
                if (level.BookmarkLevelStatus == "1")
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("5101007", "This is already enabled, without the need to repeat the"));
                    return;
                }
                else
                {
                    strPopupMsg = CurrentApp.GetLanguageInfo("5101010", "Are you sure to enable this?");
                }
            }
            else if (optType == Common5100.OperationType.Disable)
            {
                if (level.BookmarkLevelStatus == "0")
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("5101008", "This is a disabled state, no need to repeat the disabled"));
                    return;
                }
                else
                {
                    strPopupMsg = CurrentApp.GetLanguageInfo("5101009", "Are you sure to disable this?");
                }
            }
            string           strConfirm = CurrentApp.GetLanguageInfo("5102013", "Confirm");
            MessageBoxResult result     = MessageBox.Show(strPopupMsg, strConfirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                SetLevelStatus(optType, level);
            }
            else
            {
                string msg = string.Empty;
                if (optType == Common5100.OperationType.Enable)
                {
                    msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO5101003")), level.BookmarkLevelName);
                    CurrentApp.WriteOperationLog("5101003", ConstValue.OPT_RESULT_CANCEL, msg);
                }
                else if (optType == Common5100.OperationType.Disable)
                {
                    msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO5101004")), level.BookmarkLevelName);
                    CurrentApp.WriteOperationLog("5101004", ConstValue.OPT_RESULT_CANCEL, msg);
                }
            }
        }
        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));
                }
            }
        }
Beispiel #15
0
        public bool DeleteStatisticParamFromDB()
        {
            WebRequest webRequest = new WebRequest();

            webRequest.Code    = (int)S3108Codes.DeleteConfig;
            webRequest.Session = CurrentApp.Session;
            StatisticParam SP = new StatisticParam();

            SP.CycleTime            = DeleteStatisticParam.CycleTime;
            SP.StatisticKey         = DeleteStatisticParam.StatisticKey;
            SP.TableType            = DeleteStatisticParam.TableType;
            SP.RowNum               = DeleteStatisticParam.RowNum;
            SP.StatisticalParamID   = DeleteStatisticParam.StatisticalParamID;
            SP.StatisticalParamName = DeleteStatisticParam.StatisticalParamName;

            SP.CycleTimeParam = DeleteStatisticParam.CycleTimeParam;
            SP.IsCombine      = DeleteStatisticParam.IsCombine;
            SP.OrgID          = DeleteStatisticParam.OrgID;
            OperationReturn optReturn = XMLHelper.SeriallizeObject <StatisticParam>(SP);

            if (!optReturn.Result)
            {
                ShowException(string.Format("DeleteStatisticParamFromDB xml Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                return(false);
            }
            string StatisticC = optReturn.Data as string;

            webRequest.ListData.Add(StatisticC);
            Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                               WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));

            WebHelper.SetServiceClient(client);
            //Service31081Client client = new Service31081Client();
            WebReturn webReturn = client.DoOperation(webRequest);

            client.Close();
            if (!webReturn.Result)
            {
                ShowException(string.Format("deleteConfig Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                #region 记录日志
                string orgname = mListObjectItems.FirstOrDefault(p => p.ItemID == SP.OrgID.ToString()).Name;
                string msg     = string.Format("{0}{1}{2}:{3}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108007")), orgname, SP.StatisticalParamName);
                CurrentApp.WriteOperationLog("3108007", ConstValue.OPT_RESULT_FAIL, msg);
                #endregion
                return(false);
            }
            InitListBox();
            #region 记录日志
            string orgnameT = mListObjectItems.FirstOrDefault(p => p.ItemID == SP.OrgID.ToString()).Name;
            string msgT     = string.Format("{0}{1}{2}:{3}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO3108007")), orgnameT, SP.StatisticalParamName);
            CurrentApp.WriteOperationLog("3108007", ConstValue.OPT_RESULT_SUCCESS, msgT);
            #endregion
            return(true);
        }
Beispiel #16
0
        private bool Update51008()
        {
            try
            {
                string strLog;
                var    webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S5102Codes.OptUpdate51008;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(_mlstAssociationTableParams);
                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 Service51021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service51021"));
                //var client = new Service51021Client();
                var webReturn = client.UmpTaskOperation(webRequest);
                client.Close();

                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5102T00045", "Update"));
                if (!webReturn.Result)
                {
                    #region 写操作日志

                    strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("5102T00045"),
                                           Utils.FormatOptLogString("5102T00046"), webReturn.Message);
                    CurrentApp.WriteOperationLog(S5102Consts.OPT_Update.ToString(), ConstValue.OPT_RESULT_FAIL, strLog);

                    #endregion

                    CurrentApp.WriteLog(webReturn.Message);
                    ShowException(string.Format("{0}: {1}",
                                                CurrentApp.GetLanguageInfo("5102T00046", "Upate keyword Content Fail!"),
                                                webReturn.Message));
                    return(false);
                }
                #region 写操作日志

                strLog = string.Format("{0} {1}", Utils.FormatOptLogString("5102T00045"),
                                       Utils.FormatOptLogString("5102T00047"));
                CurrentApp.WriteOperationLog(S5102Consts.OPT_Update.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("5102T00047", "Update Success"));
                #endregion
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
                return(false);
            }
            return(true);
        }
Beispiel #17
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);
        }
        /// <summary>
        /// 删除策略
        /// </summary>
        /// <param name="strtag">开始时间num|策略编码|服务器IP资源编码</param>
        private void EncrytionObjectStrategyDelete(string strtag)
        {
            try
            {
                string[] strIPAndStartNum = strtag.Split('|');
                string   temppolicname    = "";
                if (strIPAndStartNum.Count() == 3)
                {
                    temppolicname = lstPolicyBindding.Where(p => p.Bindingpolicyid == long.Parse(strIPAndStartNum[1])).First().CusFiled3;
                    WebRequest webRequest = new WebRequest();
                    webRequest.Code    = (int)S2400RequestCode.DeleteBindedStragegy;
                    webRequest.Session = CurrentApp.Session;
                    webRequest.ListData.Add(strIPAndStartNum[0]);
                    webRequest.ListData.Add(strIPAndStartNum[1]);
                    webRequest.ListData.Add(strIPAndStartNum[2]);
                    //Service24011Client client = new Service24011Client();
                    Service24011Client client    = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011"));
                    WebReturn          webReturn = client.DoOperation(webRequest);
                    CurrentApp.MonitorHelper.AddWebReturn(webReturn);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        if (webReturn.Message == S2400Const.Msg_StragegyExit)
                        {
                            ShowInformation(CurrentApp.GetLanguageInfo("240300023", "Strategy Is Used,Can not Delete."));
                        }
                        else
                        {
                            ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        }
                        return;
                    }
                    else
                    {
                        string strLog = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2403005")), temppolicname);
                        CurrentApp.WriteOperationLog("2403005", ConstValue.OPT_RESULT_SUCCESS, strLog);

                        CVoiceServerBindStrategy podel = lstPolicyBindding.Where(p => p.Durationbegin.ToString() == strIPAndStartNum[0] &&
                                                                                 p.Bindingpolicyid.ToString() == strIPAndStartNum[1]).FirstOrDefault();
                        lstPolicyBindding.Remove(podel);
                        if (podel != null)
                        {
                            BindStrategyContextMenu();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CurrentApp.WriteOperationLog("2403005", ConstValue.OPT_RESULT_FAIL, "");
                ShowException(ex.Message);
            }
        }
Beispiel #19
0
        private void ModyfyData224002(CVoiceServerBindStrategy cvsbs, string strStart, string strEnd)
        {
            if (cvsbs == null)
            {
                return;
            }
            //修改需要传入的值

            string strSetuser    = CurrentApp.Session.UserID.ToString();
            string strSettime    = DateTime.UtcNow.ToString("yyyyMMddHHmmss");
            string strSetaccount = CurrentApp.Session.UserInfo.Account;

            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code = (int)S2400RequestCode.ModyfyData224002;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(cvsbs);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("{0}\t{1}", "Field.", optReturn.Message));
                    return;
                }
                webRequest.Data = optReturn.Data.ToString();
                webRequest.ListData.Add(strStart);
                webRequest.ListData.Add(strEnd);
                webRequest.ListData.Add(strSetuser);
                webRequest.ListData.Add(strSettime);
                webRequest.ListData.Add(strSetaccount);
                webRequest.Session = CurrentApp.Session;
                //Service24011Client client = new Service24011Client();
                Service24011Client client    = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011"));
                WebReturn          webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    CurrentApp.WriteOperationLog("2403006", ConstValue.OPT_RESULT_FAIL, "");
                    ShowException(string.Format("{0}\t{1}", "Field.", webReturn.Message));
                }
                else
                {
                    string tempstrend = Convert.ToDateTime(strEnd.Insert(4, "-").Insert(7, "-").Insert(10, " ").Insert(13, ":").Insert(16, ":")).ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
                    string strLog     = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2403006")),
                                                      cvsbs.CusFiled3 + "," + cvsbs.DurationendStr + "->" + tempstrend);
                    CurrentApp.WriteOperationLog("2403006", ConstValue.OPT_RESULT_SUCCESS, strLog);
                }
            }
            catch (Exception ex)
            {
                CurrentApp.WriteOperationLog("2403006", ConstValue.OPT_RESULT_FAIL, "");
                ShowException(ex.Message);
            }
        }
Beispiel #20
0
        void AddNewRoleInfo(RoleModel newRoleInfo)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S1102Codes.AddNewRole;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(newRoleInfo);
                if (!optReturn.Result)
                {
                    #region
                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1102001"), RoleInfo.RoleName);
                    CurrentApp.WriteOperationLog(S1102Consts.OPT_AddRole.ToString(), ConstValue.OPT_RESULT_FAIL, msg);
                    #endregion
                    CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                webRequest.Data = optReturn.Data.ToString();

                //Service11021Client client = new Service11021Client();
                Wcf11021.Service11021Client client = new Service11021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11021"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.URPOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    if (webReturn.Code == Defines.RET_DBACCESS_EXIST)
                    {
                        CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("1102T00033", "Role Name Already Exists"));
                        return;
                    }
                    else
                    {
                        CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }
                }
                else
                {
                    long RoleID = Convert.ToInt64(webReturn.Data);
                    AddRoleUser(RoleID);
                }
                mAsyncResult = true;
            }
            catch (Exception ex)
            {
                CurrentApp.ShowExceptionMessage(ex.Message);
            }
        }
Beispiel #21
0
        private void StopNMonObject(bool isClose)
        {
            try
            {
                string strOpt = S2102Consts.OPT_STOPNETMON.ToString();
                if (isClose)
                {
                    strOpt = S2102Consts.OPT_CLOSENETMON.ToString();
                }
                if (mMonitorClient == null)
                {
                    return;
                }
                if (mMonitorObject == null)
                {
                    return;
                }
                OperationReturn optReturn;
                RequestMessage  request = new RequestMessage();
                request.Command = (int)Service04Command.ReqStopNMon;
                request.ListData.Add(mMonitorObject.MonID);
                optReturn = mMonitorClient.SendMessage(request);
                if (!optReturn.Result)
                {
                    #region 写操作日志

                    CurrentApp.WriteOperationLog(strOpt, ConstValue.OPT_RESULT_EXCEPTION,
                                                 string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));

                    #endregion

                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                }

                #region 写操作日志

                CurrentApp.WriteOperationLog(strOpt, ConstValue.OPT_RESULT_SUCCESS,
                                             string.Format("{0}[{1}]", mMonitorObject.ObjValue, Utils.FormatOptLogString(string.Format("OBJ{0}", mMonitorObject.ObjType))));

                #endregion
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
 void DeleteDBO(QuerySettingItems Item)
 {
     try
     {
         string     strLog;
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3107Codes.DeleteDBO;
         webRequest.ListData.Add(Item.QuerySettingID.ToString());
         Service31071Client client = new Service31071Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31071"));
         //Service31071Client client = new Service31071Client();
         WebReturn webReturn = client.UMPTaskOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(CurrentApp.GetLanguageInfo("3107T00092", "Delete Failed"));
             #region 写操作日志
             strLog = string.Format("{0} {1}{2}", Utils.FormatOptLogString("3107T00005"), Utils.FormatOptLogString("3107T00028"), Item.QuerySettingName);
             CurrentApp.WriteOperationLog(S3107Consts.OPT_AutoTask.ToString(), ConstValue.OPT_RESULT_FAIL, strLog);
             #endregion
             return;
         }
         if (webReturn.Message == S3107Consts.HadUse)// 该查询条件被使用无法删除
         {
             ShowInformation(CurrentApp.GetLanguageInfo("3107T00093", "Can't Delete"));
             return;
         }
         else
         {
             ListQueryItems.Remove(Item);
             ShowInformation(CurrentApp.GetLanguageInfo("3107T00091", "Delete Sucessed"));
             CreatoptButtons();
             #region 写操作日志
             strLog = string.Format("{0} {1}{2}", Utils.FormatOptLogString("3107T00005"), Utils.FormatOptLogString("3107T00028"), Item.QuerySettingName);
             CurrentApp.WriteOperationLog(S3107Consts.OPT_AutoTask.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
             #endregion
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #23
0
        /// Author           : Luoyihua
        ///  Created          : 2015-01-13 09:34:43
        /// <summary>
        /// Removes the task record.
        /// </summary>
        /// <param name="selrecord">The selrecord.</param>
        private void RemoveTaskRecord(string RecordList, int Dnum, int recordLength)
        {
            TaskInfoDetail item = LVTaskDetail.SelectedItem as TaskInfoDetail;

            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3103Codes.DeleteRecordFromTask;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(RecordList);
                webRequest.ListData.Add((ListCurrentTaskDetail.Count - Dnum).ToString());            //当前任务中录音数量
                webRequest.ListData.Add(item.TaskID.ToString());
                webRequest.ListData.Add(SelectTask.AlreadyScoreNum.ToString());                      //当前任务中已评分数量
                webRequest.ListData.Add((SelectTask.TaskAllRecordLength - recordLength).ToString()); //当前任务中录音总时长
                //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)
                {
                    CurrentApp.WriteOperationLog(S3103Consts.OPT_REMOVETASKRECORD.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("3103T00001"), SelectTask.TaskName);
                    strLog += string.Format("{0} {1}", Utils.FormatOptLogString("3103T00025"), RecordList);
                    CurrentApp.WriteOperationLog(S3103Consts.OPT_REMOVETASKRECORD.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                    CurrentApp.WriteLog("DeleteTaskRecord", string.Format("{0} \t OldTaskCount {1} \t DeleteCount {2} \t NowTaskCount {3}", strLog, ListCurrentTaskDetail.Count, Dnum, ListCurrentTaskDetail.Count - Dnum));
                    #endregion
                    ShowInformation(CurrentApp.GetLanguageInfo("3103T00042", "Operation Succeed."));
                    SelectTask.AssignNum = ListCurrentTaskDetail.Count - Dnum;
                    InitTaskDetail();
                }
            }
            catch (Exception ex)
            {
                ShowException(string.Format("{0}.\t{0}", CurrentApp.GetLanguageInfo("3103T00043", "Operation Field."), ex.Message));
            }
        }
Beispiel #24
0
        private void PlayRecord(AppealInfoItems seldate)
        {
            try
            {
                mUCPlayBox                  = new UCPlayBox();
                mUCPlayBox.CurrentApp       = CurrentApp;
                mUCPlayBox.RecoredReference = seldate.ReferenceID.ToString();
                mUCPlayBox.IsAutoPlay       = true;
                //BorderPlayBox.Child = mUCPlayBox;
                //PanelPlayBox.IsVisible = true;

                #region 写操作日志
                string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3105T00001"), seldate.ReferenceID.ToString());
                CurrentApp.WriteOperationLog(S3105Consts.OPT_Play.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                #endregion
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #25
0
        /// <summary>
        /// 开始播放
        /// </summary>
        public void Play(bool isDownload)
        {
            try
            {
                if (RecordInfoItem != null)
                {
                    //录屏窗口控制
                    SetScreenPlayer();

                    if (isDownload)
                    {
                        #region 写操作日志

                        string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("COL3102001RecordReference"), RecordInfoItem.RecordReference);
                        CurrentApp.WriteOperationLog(S3102Consts.OPT_PLAYRECORD.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);

                        #endregion


                        if (RecordInfoItem.EncryptFlag != "0")
                        {
                            SetDecryptPassword();
                        }
                        else
                        {
                            PlayRecord();
                        }
                    }
                    else
                    {
                        //无需下载,直接播放
                        VoicePlayer.Play();
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #26
0
        private void SaveData224002(CVoiceServerBindStrategy cvsbs)
        {
            if (cvsbs == null)
            {
                return;
            }
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code = (int)S2400RequestCode.SaveData224002;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(cvsbs);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("{0}\t{1}", "Field.", optReturn.Message));
                    return;
                }
                webRequest.Data    = optReturn.Data.ToString();
                webRequest.Session = CurrentApp.Session;
                //Service24011Client client = new Service24011Client();
                Service24011Client client    = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011"));
                WebReturn          webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("{0}\t{1}", "Field.", webReturn.Message));
                    return;
                }

                string strLog = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2403003")), cvsbs.CusFiled3);
                CurrentApp.WriteOperationLog("2403003", ConstValue.OPT_RESULT_SUCCESS, strLog);
            }
            catch (Exception ex)
            {
                string strLog = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2403003")), cvsbs.CusFiled3 + "," + ex.Message);
                CurrentApp.WriteOperationLog("2403003", ConstValue.OPT_RESULT_FAIL, strLog);
                ShowException(ex.Message);
            }
        }
        /// Author           : Luoyihua
        ///  Created          : 2014-11-10 11:00:24
        /// <summary>
        /// 更改任务有效期
        /// </summary>
        /// <param name="modifytime">The modifytime.</param>
        /// <param name="taskid">The taskid.</param>
        private void ChangeDealTime(string modifytime, string taskid)
        {
            try
            {
                string     dtnow      = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss");
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3103Codes.ModifyTaskDealLine;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(modifytime);
                webRequest.ListData.Add(taskid);
                webRequest.ListData.Add(dtnow);

                //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)
                {
                    CurrentApp.WriteOperationLog(S3103Consts.OPT_MODIFYTASKFINISHTIME.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("3103T00034"), SelectTask.TaskName);
                    CurrentApp.WriteOperationLog(S3103Consts.OPT_MODIFYTASKFINISHTIME.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                    #endregion
                    ShowInformation(CurrentApp.GetLanguageInfo("3103T00042", "Operation Succeed."));
                    ParentPage.ShowPopupPanel(false);
                }
            }
            catch (Exception ex)
            {
                ShowException(string.Format("{0}.\t{0}", CurrentApp.GetLanguageInfo("3103T00043", "Operation Field."), ex.Message));
            }
        }
Beispiel #28
0
        private void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            string error = string.Empty;

            if (string.IsNullOrWhiteSpace(txtReCheckDisContent.Text.ToString()))
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3105T000125", "ReCheck Content Cant Be Null"));
                return;
            }
            if ((rbtnKeepScore.IsChecked == true || rbtnReScore.IsChecked == true || rbtnRejected.IsChecked == true) || rbtnAddToQA.IsChecked == true || rbtnAddToTask.IsChecked == true && !string.IsNullOrWhiteSpace(txtCheckDisContent.Text))
            {
                long lserialid = ((S3105App)CurrentApp).GetSerialID();
                if (lserialid != -1)
                {
                    try
                    {
                        string AppealFlowItemID = lserialid.ToString();
                        string action           = "7";
                        if (rbtnKeepScore.IsChecked == true)
                        {
                            action = "5";
                        }
                        else if (rbtnReScore.IsChecked == true)
                        {
                            action = "6";
                        }
                        else if (rbtnAddToQA.IsChecked == true || rbtnAddToTask.IsChecked == true)
                        {
                            action = "8";
                        }
                        if (rbtnAddToQA.IsChecked == true)
                        {
                            UC_AssignToQA ucAssignToQa = new UC_AssignToQA();
                            ucAssignToQa.CurrentApp       = CurrentApp;
                            ucAssignToQa.ParentPage       = this.ParentPage;
                            ucAssignToQa.PrePage          = this;
                            ucAssignToQa.SelCheckData     = SelCheckData;
                            ucAssignToQa.AppealFlowItemID = AppealFlowItemID;
                            ParentPage.PopupPanel.Content = ucAssignToQa;
                            ParentPage.PopupPanel.Title   = CurrentApp.GetLanguageInfo("3105T000114", "Assign To QA");
                            ParentPage.PopupPanel.IsOpen  = true;
                            return;
                        }
                        else if (rbtnAddToTask.IsChecked == true)
                        {
                            UC_AddToTask ucAddToTask = new UC_AddToTask();
                            ucAddToTask.CurrentApp        = CurrentApp;
                            ucAddToTask.ParentPage        = this.ParentPage;
                            ucAddToTask.PrePage           = this;
                            ucAddToTask.SelCheckData      = SelCheckData;
                            ucAddToTask.AppealFlowItemID  = AppealFlowItemID;
                            ParentPage.PopupPanel.Content = ucAddToTask;
                            ParentPage.PopupPanel.Title   = CurrentApp.GetLanguageInfo("3105T000114", "Add To Task");
                            ParentPage.PopupPanel.IsOpen  = true;
                            return;
                        }
                        if (action == "6")
                        {
                            RecheckIsCom = false;
                            ParentPage.ShowTemplatePop(action, AppealFlowItemID, SelCheckData, txtReCheckDisContent.Text);
                        }
                        if (RecheckIsCom)
                        {
                            error = UpdateReCheckData(action, AppealFlowItemID, SelCheckData);
                        }
                        else
                        {
                            return;
                        }

                        if (!string.IsNullOrEmpty(error))
                        {
                            ShowException(error);
                        }
                        else
                        {
                            ShowInformation(CurrentApp.GetLanguageInfo("3105T00022", "Operation Succeed."));
                            UpdateTable19(action);
                            ParentPage.ApprovalHistory();
                            ParentPage.BindData();
                            ParentPage.ShowProcessReCheck(false);
                            #region 写操作日志
                            string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3105T00001"), SelCheckData.RecoredReference);
                            CurrentApp.WriteOperationLog(S3105Consts.OPT_Approval.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                            #endregion
                        }
                    }
                    catch (Exception ex)
                    {
                        ShowException(string.Format("{0}.\t{0}", CurrentApp.GetLanguageInfo("3105T00023", "Operation Field."), ex.Message));
                        #region 写操作日志
                        string strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3105T00001"), SelCheckData.RecoredReference);
                        CurrentApp.WriteOperationLog(S3105Consts.OPT_Approval.ToString(), ConstValue.OPT_RESULT_FAIL, strLog);
                        #endregion
                    }
                }
            }
            else
            {
                ShowException(CurrentApp.GetLanguageInfo("3105T00021", "Incomplete information"));
            }
        }
Beispiel #29
0
        public string UpdateReCheckData(string action, string AppealFlowItemID, CCheckData SelCheckData)
        {
            string error = string.Empty;

            try
            {
                string     opttime    = DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss");
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3105Codes.SubmitCheckData;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(SelCheckData.AppealDetailID);          //AppealDetailID   0
                webRequest.ListData.Add(SelCheckData.AppealFlowID);            //AppealFlowID       1
                webRequest.ListData.Add(AppealFlowItemID);                     //AppealFlowItemID        2
                webRequest.ListData.Add(txtReCheckDisContent.Text);            //Note       3
                webRequest.ListData.Add(action);                               //ActionID 5审批通过不修改分数,6审批通过重新评分,7审批驳回       5
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); //OperationerID      5
                webRequest.ListData.Add(opttime);                              //操作时间     6
                webRequest.ListData.Add(SelCheckData.ScoreResultID);           //T_31_008成績IDC001      7
                webRequest.ListData.Add(SelCheckData.RecoredReference);        //錄音流水號ID        8
                webRequest.ListData.Add(SelCheckData.ScoreType);               //評分成績來源        9
                webRequest.ListData.Add("0");                                  //新的評分成績ID        10
                //Service31051Client client = new Service31051Client();
                Service31051Client client    = new Service31051Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31051"));
                WebReturn          webReturn = client.UMPTaskOperation(webRequest);
                client.Close();
                string actiondetail = "";
                switch (action)
                {
                case "5":
                    actiondetail = "3105T00026";
                    break;

                case "6":
                    actiondetail = "3105T00027";
                    break;

                case "7":
                    actiondetail = "3105T00019";
                    break;
                }
                if (!webReturn.Result)
                {
                    #region 写操作日志
                    CurrentApp.WriteOperationLog(S3105Consts.OPT_Approval.ToString(), ConstValue.OPT_RESULT_FAIL, "");
                    #endregion

                    ShowException(string.Format("{0}.\t{1}\t{2}",
                                                CurrentApp.GetLanguageInfo("3105T00023", "Operation Field."), webReturn.Code, webReturn.Message));
                    return(error);
                }
                else
                {
                    #region 写操作日志
                    string strLog = string.Format("{0} {1}", Utils.FormatOptLogString(actiondetail), SelCheckData.RecoredReference);
                    CurrentApp.WriteOperationLog(S3105Consts.OPT_Approval.ToString(), ConstValue.OPT_RESULT_SUCCESS, strLog);
                    #endregion
                    //ParentPage.BindData();
                    //ParentPage.ShowProcessReCheck(false);
                    //ShowInformation(CurrentApp.GetLanguageInfo("3105T00022", "Operation Succeed."));
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(error);
        }
        private void AddKeyGenServer(StringValuePairs machineInfo)
        {
            string    strHost      = machineInfo.Value;
            string    strMachineID = machineInfo.Key;
            WebReturn webReturn    = null;
            string    strPort      = TxtPort.Text;

            mBackgroundWorker         = new BackgroundWorker();
            mBackgroundWorker.DoWork += (s, de) =>
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S2400RequestCode.AddKeyGenServer;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
                webRequest.ListData.Add(strMachineID);
                webRequest.ListData.Add(strHost);
                webRequest.ListData.Add(strPort);
                webRequest.ListData.Add("0");
                Service24011Client client = new Service24011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service24011"));
                webReturn = client.DoOperation(webRequest);
                CurrentApp.MonitorHelper.AddWebReturn(webReturn);
                client.Close();
            };
            mBackgroundWorker.RunWorkerCompleted += (s, de) =>
            {
                if (!webReturn.Result)
                {
                    if (webReturn.Code == (int)S2400WcfErrorCode.KeyGenServerExists)
                    {
                        BtnApply.IsEnabled = true;
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, CurrentApp.GetLanguageInfo(webReturn.Code.ToString(), webReturn.Message)));
                    }
                    else
                    {
                        BtnApply.IsEnabled = true;
                        ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    }
                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2401003")), strHost);
                    CurrentApp.WriteOperationLog("2401003", ConstValue.OPT_RESULT_FAIL, msg);
                }
                else
                {
                    string msg = string.Format("{0}{1}{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString(string.Format("FO2401003")), strHost);
                    CurrentApp.WriteOperationLog("2401003", ConstValue.OPT_RESULT_SUCCESS, msg);
                    //添加成功 关闭当前popupPanel 刷新父窗口list
                    BtnApply.IsEnabled         = true;
                    mainPage.PopupPanel.IsOpen = false;
                    //mainPage.InitKeyGenServerList();
                    KeyGenServerEntryInList server = new KeyGenServerEntryInList();
                    server.HostAddress = strHost;
                    server.ResourceID  = strMachineID;
                    server.HostPort    = TxtPort.Text;
                    server.IsEnable    = "0";
                    server.EnableIcon  = "Images/00001.ico";
                    server.Status      = true;
                    mainPage.UpdateKeyGenServerList(server, OperationType.Add);
                    ShowInformation(CurrentApp.GetLanguageInfo("COMN001", "Success"));
                    mainPage.lvGeneratorObject.SelectedIndex = 0;
                }
            };
            mBackgroundWorker.RunWorkerAsync();
        }