Ejemplo n.º 1
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);
                }
            }
        }
Ejemplo n.º 2
0
        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));
                }
            }
        }
Ejemplo n.º 3
0
        void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txbTaskName.Text.ToString()))
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3103T00123", "Task Name Is Null."));
                return;
            }

            if (!CreateQueryCondition())
            {
                return;
            }
            if (PageParent != null)
            {
                UserTasksInfoShow userTaskInfoShow = new UserTasksInfoShow();
                userTaskInfoShow.TaskName   = txbTaskName.Text.ToString();
                userTaskInfoShow.TaskType   = 3;
                userTaskInfoShow.IsShare    = "N";
                userTaskInfoShow.AssignTime = DateTime.Now.ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                userTaskInfoShow.AssignUser = CurrentApp.Session.UserInfo.UserID;

                userTaskInfoShow.AssignUserFName = CurrentApp.Session.UserInfo.UserName;
                userTaskInfoShow.BelongYear      = (int)cmbYear.SelectedValue;
                userTaskInfoShow.BelongMonth     = (int)cmbMonth.SelectedValue;
                if (DateDeadLineTime.Value == null)
                {
                    MessageBox.Show(CurrentApp.GetLanguageInfo("3103T00116", "Expired Time can not be null."), CurrentApp.AppName);
                    return;
                }
                userTaskInfoShow.DealLine = DateTime.Parse(DateDeadLineTime.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm:ss");
                if (mListCtrolQA.Count == 0)
                {
                    MessageBox.Show(CurrentApp.GetLanguageInfo("3103T00115", "Please select one scoring user at least."), CurrentApp.AppName);
                    return;
                }
                if (mListCtrolQA.Count == 0)
                {
                    MessageBox.Show(CurrentApp.GetLanguageInfo("", "Please select only one scoring user ."), CurrentApp.AppName);
                    return;
                }
                else
                {
                    PageParent.SaveRecheckTask2QA(userTaskInfoShow, mListCtrolQA);

                    var parent = Parent as PopupPanel;
                    if (parent != null)
                    {
                        parent.IsOpen = false;
                    }
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 点击任务记录 生成对应按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void LVTaskList_SelectedItemChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         mListBasicOperations.Clear();
         AddQueryBtnOperation();
         var CurrentFocusRecord = new UserTasksInfoShow();
         CurrentFocusRecord = (UserTasksInfoShow)LVTaskList.SelectedItem;
         DateTime deadline = Convert.ToDateTime(CurrentFocusRecord.DealLine);
         if (CurrentFocusRecord != null)
         {
             if (CurrentFocusRecord.AssignUser == CurrentApp.Session.UserID)                                        //分配人是当前用户
             {
                 if (S3103App.ListOperationInfos.Where(p => p.ID == S3103Consts.OPT_MODIFYTASK).ToList().Count > 0) //拥有修改权限
                 {
                     OperationInfo item = new OperationInfo();
                     item.ID          = S3103Consts.OPT_MODIFYTASK;
                     item.ParentID    = 1102;
                     item.SortID      = 0;
                     item.Icon        = "Images/modify.png";
                     item.Display     = CurrentApp.GetLanguageInfo("3103T00034", "Change Expiration Date");
                     item.Description = null;
                     mListBasicOperations.Add(item);
                 }
             }
             if (CurrentFocusRecord.FinishUserID == CurrentApp.Session.UserID && DateTime.Compare(deadline, DateTime.Now) >= 0) //任务人是当前用户并且任务没有过有效期
             {
                 if (S3103App.ListOperationInfos.Where(p => p.ID == S3103Consts.OPT_VIEWTASKDETAIL).ToList().Count > 0)         //拥有查看任务权限
                 {
                     OperationInfo item1 = new OperationInfo();
                     item1.ID          = S3103Consts.OPT_VIEWTASKDETAIL;
                     item1.ParentID    = 1102;
                     item1.SortID      = 0;
                     item1.Icon        = "Images/add.png";
                     item1.Display     = CurrentApp.GetLanguageInfo("3103T00039", "View Task");
                     item1.Description = null;
                     mListBasicOperations.Add(item1);
                     LVTaskList.MouseDoubleClick += LVTaskList_MouseDoubleClick;
                 }
             }
         }
         else
         {
             return;
         }
         CreateOptButtons();
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 加载当前用户分配的任务信息
        /// </summary>
        private void InitTasks()
        {
            try
            {
                ListCurrentUserTasks.Clear();
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)ColAlias.S3103Codes.GetCurrentUserTasks;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add("0"); //0:我分配的 1:分配给我的 2:全部
                webRequest.ListData.Add("0"); //0:未完成 1:已完成 2全部
                //webRequest.ListData.Add(dtstart); //开始时间
                //webRequest.ListData.Add(dtend); //截止时间
                webRequest.ListData.Add("3"); //初檢 1;複檢 3

                //Service31031Client client = new Service31031Client();
                Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                //WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.UMPTaskOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData.Count > 0)
                {
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <UserTasksInfoShow>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        UserTasksInfoShow taskInfo = optReturn.Data as UserTasksInfoShow;
                        if (taskInfo != null && ListCurrentUserTasks.Where(p => p.TaskID == taskInfo.TaskID).Count() == 0)
                        {
                            taskInfo.IsFinish = taskInfo.IsFinish == "Y" ? CurrentApp.GetLanguageInfo("3105T000141", "Finished") : CurrentApp.GetLanguageInfo("3105T000142", "Unfinished");
                            taskInfo.IsShare  = taskInfo.IsShare == "Y" ? CurrentApp.GetLanguageInfo("3105T000143", "Yes") : CurrentApp.GetLanguageInfo("3105T000145", "No");
                            ListCurrentUserTasks.Add(taskInfo);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 6
0
        //目前存在下面BUG:选中一条可以评分的任务,然后双击不能评分的任务居然就进入任务详情界面了。
        //原因:先运行的是SelectedItemChanged事件,而当前选中的是前一条被选中的任务,所以就给评分权限了,然后再运行的是MouseDoubleClick事件,然后再将被选中的第二条任务设为SelectedItem。
        void LVTaskList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            UserTasksInfoShow tempSelected = LVTaskList.SelectedItem as UserTasksInfoShow;

            if (tempSelected == null)
            {
                return;
            }
            DateTime deadline = Convert.ToDateTime(tempSelected.DealLine);

            if (tempSelected.FinishUserID == CurrentApp.Session.UserID)
            {
                if (S3103App.ListOperationInfos.Where(p => p.ID == S3103Consts.OPT_VIEWTASKDETAIL).ToList().Count > 0 && DateTime.Compare(deadline, DateTime.Now) >= 0)//拥有查看任务权限
                {
                    Jump2TaskDetail(false);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 加载当前用户的任务信息(分出的任务以及自己的任务)
        /// </summary>
        public void InitTasks(string assign, string finished, string start, string end)
        {
            try
            {
                string tasktype = "0";
                if (S3103App.ListOperationInfos.Where(p => p.ID == S3103Consts.OPT_CheckTask).Count() > 0) //初檢權限
                {
                    tasktype += string.Format(",1,2");
                }
                if (S3103App.ListOperationInfos.Where(p => p.ID == S3103Consts.OPT_RecheckTask).Count() > 0) //複檢權限
                {
                    tasktype += string.Format(",3,4");
                }

                ListCurrentUserTasks.Clear();
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3103Codes.GetCurrentUserTasks;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(assign);   //0:我分配的 1:分配给我的 2:全部
                webRequest.ListData.Add(finished); //0:未完成 1:已完成 2全部
                webRequest.ListData.Add(tasktype); //初檢 1;複檢 3
                webRequest.ListData.Add(start);    //开始时间
                webRequest.ListData.Add(end);      //截止时间

                //Service31031Client client = new Service31031Client();
                Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                //WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.UMPTaskOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData.Count > 0)
                {
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <UserTasksInfoShow>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        UserTasksInfoShow taskInfo = optReturn.Data as UserTasksInfoShow;
                        if (taskInfo != null && ListCurrentUserTasks.Where(p => p.TaskID == taskInfo.TaskID).Count() == 0)
                        {
                            //if (ListCurrentUserTasks.Where(p => p.TaskID == taskInfo.TaskID).Count() > 0 && taskInfo.FinishUserID==0)
                            //{
                            //}
                            long tempdur = taskInfo.TaskAllRecordLength;
                            taskInfo.TaskTypeName           = GetTaskTypeName(taskInfo.TaskType);
                            taskInfo.IsFinish               = taskInfo.IsFinish == "Y" ? CurrentApp.GetLanguageInfo("3103T00019", "Finished") : CurrentApp.GetLanguageInfo("3103T00020", "Unfinished");
                            taskInfo.IsShare                = taskInfo.IsShare == "Y" ? CurrentApp.GetLanguageInfo("3103T00022", "Yes") : CurrentApp.GetLanguageInfo("3103T00023", "No");
                            taskInfo.strTaskAllRecordLength = string.Format("{0:00}:{1:00}:{2:00}", tempdur / 3600, (tempdur % 3600) / 60, tempdur % 60);
                            ListCurrentUserTasks.Add(taskInfo);
                        }
                    }
                }
                CurrentApp.WriteLog("TaskQuery", string.Format("{0}", webReturn.Message));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 8
0
        //保存任务到QA
        void SaveTask(UserTasksInfoShow userTaskInfoShow, List <CtrolQA> listctrolqa, List <RecordInfoItem> lstRecordInfoItem)
        {
            long taskID = 0;

            try
            {
                //提交任务
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)ColAlias.S3103Codes.SaveTask;
                OperationReturn optReturn = XMLHelper.SeriallizeObject(userTaskInfoShow);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                webRequest.Data = optReturn.Data.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)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                }
                else
                {
                    taskID = Convert.ToInt64(webReturn.Data);
                    userTaskInfoShow.TaskID = taskID;


                    //提交任务QA T_31_021_00000
                    webReturn          = new WebReturn();
                    webRequest         = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)ColAlias.S3103Codes.SaveTaskQA;
                    webRequest.Data    = taskID.ToString();
                    foreach (CtrolQA qa in listctrolqa)
                    {
                        optReturn = XMLHelper.SeriallizeObject(qa);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        webRequest.ListData.Add(optReturn.Data.ToString());
                    }

                    //client = new Service31031Client();
                    client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                    //WebHelper.SetServiceClient(client);
                    webReturn = client.UMPTaskOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }

                    //提交任务录音T_31_022_00000
                    webReturn          = new WebReturn();
                    webRequest         = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)ColAlias.S3103Codes.SaveTaskRecord;
                    ColAlias:: TaskInfoDetail taskinfodetail;
                    foreach (RecordInfoItem record in lstRecordInfoItem)
                    {
                        taskinfodetail                  = new ColAlias.TaskInfoDetail();
                        taskinfodetail.TaskID           = taskID;
                        taskinfodetail.RecoredReference = record.SerialID;
                        taskinfodetail.IsLock           = "N";
                        taskinfodetail.AllotType        = 4;   //对应T_31_022表的C006 4表示录音是从审批通过分配到任务中的
                        taskinfodetail.FromTaskID       = -1;
                        taskinfodetail.TaskType         = "3"; //对应T-31_022表的C010
                        taskinfodetail.StartRecordTime  = Convert.ToDateTime(record.StartRecordTime).ToUniversalTime();
                        taskinfodetail.Duration         = record.Duration.ToString();
                        taskinfodetail.Extension        = record.Extension;
                        taskinfodetail.CalledID         = record.CalledID;
                        taskinfodetail.CallerID         = record.CallerID;
                        taskinfodetail.Direction        = int.Parse(record.Direction);
                        List <CtrolAgent> templst = new List <CtrolAgent>();
                        //if (S3103App.GroupingWay.Contains("A")) //因本工程没有分组信息所以本处暂时注释掉
                        //{
                        //    templst = S3103App.ListCtrolAgentInfos.Where(p => p.AgentName == record.ReAgent).ToList();
                        //}
                        //else if (S3103App.GroupingWay.Contains("R"))
                        //{
                        //    templst = S3103App.ListCtrolRealityExtension.Where(p => p.AgentName == record.ReAgent).ToList();
                        //}
                        //else if (S3103App.GroupingWay.Contains("E"))
                        //{
                        //    templst = S3103App.ListCtrolExtension.Where(p => p.AgentName == record.ReAgent).ToList();
                        //}
                        templst = S3105App.ListCtrolAgentInfos.Where(p => p.AgentName == record.Agent).ToList();
                        if (templst.Count() > 0)
                        {
                            taskinfodetail.AgtOrExtID   = templst[0].AgentID;
                            taskinfodetail.AgtOrExtName = templst[0].AgentName;
                        }
                        else
                        {
                            taskinfodetail.AgtOrExtID   = "";
                            taskinfodetail.AgtOrExtName = "";
                        }

                        optReturn = XMLHelper.SeriallizeObject(taskinfodetail);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        webRequest.ListData.Add(optReturn.Data.ToString());
                    }

                    webRequest.Data = taskID.ToString();
                    //client = new Service31031Client();
                    client    = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                    webReturn = client.UMPTaskOperation(webRequest);
                    client.Close();
                    if (!webReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                        return;
                    }

                    string strlogrecords = "";
                    //将任务号更新到录音表
                    var tableInfo = CurrentApp.Session.ListPartitionTables.FirstOrDefault(
                        t => t.TableName == ConstValue.TABLE_NAME_RECORD && t.PartType == VoiceCyber.UMP.Common.TablePartType.DatetimeRange);
                    if (tableInfo == null)
                    {
                        string tableName = ConstValue.TABLE_NAME_RECORD;
                        foreach (RecordInfoItem r in lstRecordInfoItem)
                        {
                            strlogrecords     += r.SerialID + ",";
                            webReturn          = new WebReturn();
                            webRequest         = new WebRequest();
                            webRequest.Session = CurrentApp.Session;
                            webRequest.Code    = (int)ColAlias.S3103Codes.UpdateTaskID2Record;
                            webRequest.ListData.Add(taskID.ToString());
                            webRequest.ListData.Add(tableName);
                            webRequest.ListData.Add("1");
                            webRequest.ListData.Add(r.SerialID.ToString());

                            //client = new Service31031Client();
                            client    = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                            webReturn = client.UMPTaskOperation(webRequest);
                            client.Close();
                            if (!webReturn.Result)
                            {
                                ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                                return;
                            }
                        }
                    }
                    else
                    {
                        string tableName = string.Empty;
                        foreach (RecordInfoItem r in lstRecordInfoItem)
                        {
                            strlogrecords     += r.SerialID + ",";
                            webReturn          = new WebReturn();
                            webRequest         = new WebRequest();
                            webRequest.Session = CurrentApp.Session;
                            webRequest.Code    = (int)ColAlias.S3103Codes.UpdateTaskID2Record;
                            webRequest.ListData.Add(taskID.ToString());
                            tableName = ReturnTableName(Convert.ToDateTime(r.StartRecordTime));
                            webRequest.ListData.Add(tableName);
                            webRequest.ListData.Add("1");
                            webRequest.ListData.Add(r.SerialID.ToString());


                            //client = new Service31031Client();
                            client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                            //WebHelper.SetServiceClient(client);
                            webReturn = client.UMPTaskOperation(webRequest);
                            client.Close();
                            if (!webReturn.Result)
                            {
                                ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                                return;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CurrentApp.WriteOperationLog(ColAlias.S3103Consts.OPT_TASKASSIGN.ToString(), ConstValue.OPT_RESULT_FAIL, "");
                ShowException(ex.Message);
            }

            return;
        }
Ejemplo n.º 9
0
        void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txbTaskName.Text.ToString()))
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3105T00122", "Task Infomation Is Full."));
                return;
            }
            List <CtrolQA> lstControlQaTemp = new List <CtrolQA>();

            GetQAIsCheck(ref lstControlQaTemp);
            if (lstControlQaTemp.Count == 0)
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3105T00123", "Please Select a QA"));
                return;
            }
            UserTasksInfoShow userTaskInfoShow = new UserTasksInfoShow();

            userTaskInfoShow.TaskName   = txbTaskName.Text.ToString();
            userTaskInfoShow.TaskType   = 3; // 分配任务类型复检手动任务
            userTaskInfoShow.IsShare    = "N";
            userTaskInfoShow.AssignTime = DateTime.Now.ToUniversalTime().ToString("yyyy/MM/dd HH:mm");
            userTaskInfoShow.AssignUser = CurrentApp.Session.UserInfo.UserID;

            userTaskInfoShow.AssignUserFName = CurrentApp.Session.UserInfo.UserName;
            userTaskInfoShow.BelongYear      = (int)cmbYear.SelectedValue;
            userTaskInfoShow.BelongMonth     = (int)cmbMonth.SelectedValue;
            if (DateDeadLineTime.Value == null)
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3105T00124", "Expired Time can not be null."));
                return;
            }
            userTaskInfoShow.DealLine = DateTime.Parse(DateDeadLineTime.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm");

            //查询这条录音的录音信息
            if (!GetRecordInfoByRef(SelCheckData.RecoredReference))
            {
                return;
            }
            List <RecordInfoItem> lstRecordInfoItem = new List <RecordInfoItem>();

            lstRecordInfoItem.Add(mListCurrentRecord);
            //分配到任务
            SaveTask(userTaskInfoShow, lstControlQaTemp, lstRecordInfoItem);


            //更改申诉表信息
            string error = PrePage.UpdateReCheckData("8", AppealFlowItemID, SelCheckData);

            if (!string.IsNullOrEmpty(error))
            {
                ShowException(error);
            }
            else
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3105T00022", "Operation Succeed."));
                PrePage.UpdateTable19("8");
                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
            }
        }
Ejemplo n.º 10
0
        private void InitCanOperationTasks()
        {
            try
            {
                string opqa = "";
                foreach (CtrolQA qa in S3103App.ListCtrolQAInfos)
                {
                    opqa += qa.UserID.ToString() + ",";
                }
                opqa = opqa.TrimEnd(',');
                if (opqa == "")
                {
                    return;
                }
                ListCanOperationTasks.Clear();
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3103Codes.GetCanOperationTasks;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(opqa);                            //QA
                webRequest.ListData.Add(selfromtask.TaskType.ToString()); //限定任務類型  --waves

                //Service31031Client client = new Service31031Client();
                Service31031Client client = new Service31031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31031"));
                //WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.UMPTaskOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData.Count > 0)
                {
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <UserTasksInfoShow>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        UserTasksInfoShow taskInfo = optReturn.Data as UserTasksInfoShow;
                        if (taskInfo != null)
                        {
                            if (taskInfo.TaskID != selfromtask.TaskID)
                            {
                                taskInfo.IsShare = taskInfo.IsShare == "Y" ? CurrentApp.GetLanguageInfo("3103T00022", "Yes") : CurrentApp.GetLanguageInfo("3103T00023", "No");
                                if (taskInfo.AssignUserFName == CurrentApp.Session.UserID.ToString())
                                {
                                    taskInfo.AssignUserFName = S3103App.mListAuInfoItems.Where(a => a.ID == CurrentApp.Session.UserID).FirstOrDefault().FullName;
                                }
                                ListCanOperationTasks.Add(taskInfo);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 11
0
        //private void chkIsAVGAssign_Click(object sender, RoutedEventArgs e)
        //{
        //    if (chkIsAVGAssign.IsChecked.Equals(true))
        //    {
        //        txbTaskName.IsEnabled = false;
        //    }
        //    else 
        //    {
        //        txbTaskName.IsEnabled = true;
        //    }
        //}


        void BtnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txbTaskName.Text.ToString()) )
            {
                ShowInformation(CurrentApp.GetLanguageInfo("3103T00123", "Task Name Is Null."));
                return;
            }

            if (!CreateQueryCondition())
            {
                return;
            }
            if (PageParent != null)
            {  
                 UserTasksInfoShow userTaskInfoShow = new UserTasksInfoShow();
                 if (cnPointTable.SelectedValue == null)
                 {
                     userTaskInfoShow.TaskName = txbTaskName.Text.ToString();
                     userTaskInfoShow.TaskType = 1;
                     userTaskInfoShow.IsShare = "N";
                     userTaskInfoShow.AssignTime = DateTime.Now.ToUniversalTime().ToString("yyyy/MM/dd HH:mm");
                     userTaskInfoShow.AssignUser = CurrentApp.Session.UserInfo.UserID;

                     userTaskInfoShow.AssignUserFName = CurrentApp.Session.UserInfo.UserName;
                     userTaskInfoShow.BelongYear = (int)cmbYear.SelectedValue;
                     userTaskInfoShow.BelongMonth = (int)cmbMonth.SelectedValue;
                   //  userTaskInfoShow.strScoreSheetItemName = "Null";
                     userTaskInfoShow.strScoreSheetItemID = " ";  
                 }
                 else 
                 {
                     userTaskInfoShow.TaskName = txbTaskName.Text.ToString();
                     userTaskInfoShow.TaskType = 1;
                     userTaskInfoShow.IsShare = "N";
                      userTaskInfoShow.AssignTime = DateTime.Now.ToUniversalTime().ToString("yyyy/MM/dd HH:mm");
                     userTaskInfoShow.AssignUser = CurrentApp.Session.UserInfo.UserID;

                     userTaskInfoShow.AssignUserFName = CurrentApp.Session.UserInfo.UserName;
                     userTaskInfoShow.BelongYear = (int)cmbYear.SelectedValue;
                     userTaskInfoShow.BelongMonth = (int)cmbMonth.SelectedValue;
                     var item = cnPointTable.SelectedItem as ComboBoxItem;
                     if (item == null)
                     {
                         ShowException(CurrentApp.GetLanguageInfo("3107T00109", "Please Select a Template"));
                         return;
                     }
                     OperationInfo opt = item.DataContext as OperationInfo;
                   //  userTaskInfoShow.strScoreSheetItemName = opt.Description;
                     userTaskInfoShow.strScoreSheetItemID = opt.ID.ToString();                 
                 }            
                if (DateDeadLineTime.Value == null)
                {
                    MessageBox.Show(CurrentApp.GetLanguageInfo("3103T00116", "Expired Time can not be null."), CurrentApp.AppName);
                    return; 
                }
                userTaskInfoShow.DealLine = DateTime.Parse(DateDeadLineTime.Value.ToString()).ToUniversalTime().ToString("yyyy/MM/dd HH:mm");
                if (mListCtrolQA.Count == 0)
                {
                    MessageBox.Show(CurrentApp.GetLanguageInfo("3103T00115", "Please select one scoring user at least."), CurrentApp.AppName);
                    return;
                }
                else
                {
                    #region 现都平均分配
                    //if (chkIsAVGAssign.IsChecked.Equals(true))
                    //{
                    //    int tempNum = PageParent.mListCurrentRecordInfoItems.Where(p => p.IsCheck == true).Count();
                    //    if (mListCtrolQA.Count > tempNum)//选择的录音数量少与QA数量,不能平均分配
                    //    {
                    //        MessageBox.Show(App.GetLanguageInfo("3103T00155", "The record is less than the number of quality inspector."), App.AppName);
                    //        return;
                    //    }
                    //    else
                    //    {
                    //        PageParent.SaveTask2QA(userTaskInfoShow, mListCtrolQA, 2);
                    //    }
                    //}
                    //else 
                    //{
                    //    PageParent.SaveTask2QA(userTaskInfoShow, mListCtrolQA, 1);
                    //}
                    #endregion 
                    PageParent.SaveTask2QA(userTaskInfoShow, mListCtrolQA, 2);
                   
                    var parent = Parent as PopupPanel;
                    if (parent != null)
                    {
                        parent.IsOpen = false;
                    }
                }
               
            }

        }