Beispiel #1
0
 private void LoadKeywordInfos()
 {
     try
     {
         mListKeywordInfos.Clear();
         if (!ShowKeyword)
         {
             return;
         }
         if (RecordPlayItem != null)
         {
             RecordInfoItem = RecordPlayItem.RecordInfoItem;
         }
         if (RecordInfoItem == null)
         {
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetKeywordResultList;
         webRequest.ListData.Add(RecordInfoItem.SerialID.ToString());
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null."));
             return;
         }
         OperationReturn optReturn;
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string strInfo = webReturn.ListData[i];
             optReturn = XMLHelper.DeserializeObject <KeywordResultInfo>(strInfo);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             KeywordResultInfo info = optReturn.Data as KeywordResultInfo;
             if (info == null)
             {
                 ShowException(string.Format("Fail.\tKeywordResultInfo is null."));
                 return;
             }
             mListKeywordInfos.Add(info);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #2
0
 private void SetMemoInfoToT_21_001(string SerialID, string MemoValue, string TableName)
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3102Codes.SaveMemoInfoToT_21_001;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(SerialID);
         webRequest.ListData.Add(MemoValue);
         webRequest.ListData.Add(TableName);
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #3
0
 private void InitLibraryFolderContent(ObjectItem parentItem, string parentID)
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetLibraryFolderContent;
         //webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
         webRequest.ListData.Add(parentID);
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebHelper.SetServiceClient(client);
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string          strInfo   = webReturn.ListData[i];
             OperationReturn optReturn = XMLHelper.DeserializeObject <LibraryContent>(strInfo);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             LibraryContent info = optReturn.Data as LibraryContent;
             if (info == null)
             {
                 ShowException(string.Format("Fail.\tLibraryContent is null"));
                 return;
             }
             mListLibraryContent.Add(info);
             ObjectItem item = new ObjectItem();
             item.ObjType     = ConstValue.RESOURCE_USER;
             item.ObjID       = Convert.ToInt64(info.BookID);
             item.Name        = info.BookName;
             item.FullName    = info.Path;
             item.Data        = info;
             item.Description = string.Format("{0}({1})", item.Name, item.FullName);
             item.Icon        = "Images/inspector.ico";
             AddChildObject(parentItem, item);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #4
0
 private void InitControlAgents(CtrolAgent parentItem, string parentID)
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = 11;
         webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
         webRequest.ListData.Add(parentID);
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null")));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string   strInfo = webReturn.ListData[i];
             string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR },
                                              StringSplitOptions.RemoveEmptyEntries);
             if (arrInfo.Length < 3)
             {
                 continue;
             }
             string     strID       = arrInfo[0];
             string     strName     = arrInfo[1];
             string     strFullName = arrInfo[2];
             CtrolAgent item        = new CtrolAgent();
             item.ObjType     = ConstValue.RESOURCE_AGENT;
             item.ObjID       = Convert.ToInt64(strID);
             item.Name        = strName;
             item.Description = strFullName;
             item.IsChecked   = true;
             item.IsExpanded  = true;
             item.Data        = strInfo;
             item.Icon        = "Images/agent.ico";
             if (item.Name != "N/A")
             {
                 AddChildObject(parentItem, item);
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
        private void InitSkillGroup(ObjectItem parentItem, string parentID)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.GetSkillGroupInfo;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add("-1");
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31021"));
                //Service61012Client client = new Service61012Client();
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                List <SkillGroupInfo> listSkillGroupInfo = new List <SkillGroupInfo>();
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.DeserializeObject <SkillGroupInfo>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    SkillGroupInfo columnInfo = optReturn.Data as SkillGroupInfo;
                    if (columnInfo != null)
                    {
                        listSkillGroupInfo.Add(columnInfo);
                    }
                }

                for (int i = 0; i < listSkillGroupInfo.Count; i++)
                {
                    SkillGroupInfo strInfo = listSkillGroupInfo[i];

                    ObjectItem item = new ObjectItem();
                    item.ObjType     = ConstValue.RESOURCE_OPERATIONLOG_UMP;
                    item.Name        = strInfo.SkillGroupID;
                    item.Description = strInfo.SkillGroupName;
                    item.ObjID       = Convert.ToInt64(strInfo.SkillGroupCode);
                    AddChildObject(parentItem, item);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #6
0
 private void SaveScoreDataResult()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.SaveScoreDataResult;
         if (IsAddScore)
         {
             ScoreSheetItem.ScoreSheetInfo.Flag = 1;
         }
         else
         {
             ScoreSheetItem.ScoreSheetInfo.Flag = 2;
         }
         OperationReturn optReturn = XMLHelper.SeriallizeObject(ScoreSheetItem.ScoreSheetInfo);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         webRequest.ListData.Add(optReturn.Data.ToString());
         optReturn = XMLHelper.SeriallizeObject(mCurrentScoreSheet);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         webRequest.ListData.Add(optReturn.Data.ToString());
         if (RecordInfoItem == null)
         {
             return;
         }
         optReturn = XMLHelper.SeriallizeObject(RecordInfoItem.RecordInfo);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         webRequest.ListData.Add(optReturn.Data.ToString());
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo,
                                                                                            "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
 private void InitInspector(ObjectItem parentItem, string parentID)
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetInspectorList;
         webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
         webRequest.ListData.Add(parentID);
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebHelper.SetServiceClient(client);
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string   strInfo = webReturn.ListData[i];
             string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries);
             if (arrInfo.Length < 3)
             {
                 continue;
             }
             string     strID       = arrInfo[0];
             string     strName     = arrInfo[1];
             string     strFullName = arrInfo[2];
             ObjectItem item        = new ObjectItem();
             item.ObjType     = ConstValue.RESOURCE_USER;
             item.ObjID       = Convert.ToInt64(strID);
             item.Name        = strName;
             item.FullName    = strFullName;
             item.Data        = strInfo;
             item.Description = string.Format("{0}({1})", strFullName, strName);
             item.Icon        = "Images/inspector.ico";
             AddChildObject(parentItem, item);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #8
0
 private void InitRecordScoreDetail(RecordInfoItem Item)
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetRecordScoreDetail;
         webRequest.ListData.Add(SelectRecordInfoItem.SerialID.ToString());
         webRequest.ListData.Add(SelectRecordInfoItem.Agent.ToString());
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         List <RecordScoreDetailClass> listRecordScoreDetail = new List <RecordScoreDetailClass>();
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <RecordScoreDetailClass>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             RecordScoreDetailClass item = optReturn.Data as RecordScoreDetailClass;
             if (item != null)
             {
                 item.Score = (decimal.Round(Convert.ToDecimal(item.Score), 3)).ToString();
                 if (item.IsLastScore == "Y")
                 {
                     item.IsLastScore = CurrentApp.GetLanguageInfo("3102TIP0021", "Yes");
                 }
                 else
                 {
                     item.IsLastScore = CurrentApp.GetLanguageInfo("3102TIP0020", "No");
                 }
                 listRecordScoreDetail.Add(item);
             }
         }
         mRecordScoreDetail.Clear();
         for (int i = 0; i < listRecordScoreDetail.Count; i++)
         {
             mRecordScoreDetail.Add(listRecordScoreDetail[i]);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #9
0
        private void LoadDownloadParamList()
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = Session;
                webRequest.Code    = 34;// (int)S3102Codes.GetDownloadParamList;
                webRequest.ListData.Add(Session.UserID.ToString());
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(Session),
                    WebHelper.CreateEndpointAddress(
                        Session.AppServerInfo,
                        "Service31021"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowExceptionMessage(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowExceptionMessage(string.Format("Fail.\tListData is null"));
                    return;
                }
                mListDownloadParams.Clear();
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string          strInfo   = webReturn.ListData[i];
                    OperationReturn optReturn = XMLHelper.DeserializeObject <VoiceCyber.UMP.Common31031.DownloadParamInfo>(strInfo);
                    if (!optReturn.Result)
                    {
                        WriteLog("LoadSftp", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        continue;
                    }
                    VoiceCyber.UMP.Common31031.DownloadParamInfo info = optReturn.Data as VoiceCyber.UMP.Common31031.DownloadParamInfo;
                    if (info == null)
                    {
                        WriteLog("LoadSftp", string.Format("Fail.\tSftpServerInfo is null"));
                        continue;
                    }
                    mListDownloadParams.Add(info);
                }

                WriteLog("PageLoad", string.Format("Load DownloadParams"));
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex.Message);
            }
        }
Beispiel #10
0
 private void LoadScoreCommentResultInfo(BasicScoreSheetItem item)
 {
     try
     {
         //加载评分备注结果信息
         if (item == null)
         {
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3102Codes.GetScoreCommentResultList;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(item.ScoreResultID.ToString());
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         mListScoreCommentResults.Clear();
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string          strInfo   = webReturn.ListData[i];
             OperationReturn optReturn = XMLHelper.DeserializeObject <BasicScoreCommentInfo>(strInfo);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             BasicScoreCommentInfo info = optReturn.Data as BasicScoreCommentInfo;
             if (info == null)
             {
                 ShowException(string.Format("Fail.\tBasicScoreCommentResultInfo is null"));
                 return;
             }
             mListScoreCommentResults.Add(info);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #11
0
 private bool SaveScoreSheetResult()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.SaveScoreSheetResult;
         if (IsAddScore)
         {
             ScoreSheetItem.ScoreSheetInfo.Flag = 1;
         }
         else
         {
             ScoreSheetItem.ScoreSheetInfo.Flag = 2;
         }
         OperationReturn optReturn = XMLHelper.SeriallizeObject(ScoreSheetItem.ScoreSheetInfo);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return(false);
         }
         webRequest.ListData.Add(optReturn.Data.ToString());
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo,
                                                                                            "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return(false);
         }
         //保存成绩之后当前成绩ID变为老成绩ID,而新生成的成绩ID为当前的成绩ID
         ScoreSheetItem.OldScoreResultID = ScoreSheetItem.ScoreResultID;
         ScoreSheetItem.ScoreResultID    = Convert.ToInt64(webReturn.Data);
         ScoreSheetItem.ScoreSheetInfo.OldScoreResultID = ScoreSheetItem.OldScoreResultID;
         ScoreSheetItem.ScoreSheetInfo.ScoreResultID    = ScoreSheetItem.ScoreResultID;
         //更新子项的成绩ID
         for (int i = 0; i < mListScoreItemResults.Count; i++)
         {
             mListScoreItemResults[i].ScoreResultID = ScoreSheetItem.ScoreResultID;
         }
         return(true);
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
         return(false);
     }
 }
Beispiel #12
0
 private void LoadUserConditionItems()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3102Codes.GetUserCustomConditionItem;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString());
         //    Service31021Client client = new Service31021Client();
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail. WebReturn ListData is null"));
             return;
         }
         mListUserConditions.Clear();
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <CustomConditionItem>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             CustomConditionItem item = optReturn.Data as CustomConditionItem;
             if (item == null)
             {
                 ShowException(string.Format("Fail. CustomConditionItem is null"));
                 return;
             }
             if (mListCustomConditions.Count(c => c.ID == item.ID) > 0)
             {
                 ConditionItemItem itemItem = new ConditionItemItem(item, CurrentApp);
                 mListUserConditions.Add(itemItem);
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #13
0
 private void LoadRecordMemoData()
 {
     try
     {
         if (RecordInfoItem == null)
         {
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3102Codes.GetRecordMemoList;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(RecordInfoItem.SerialID.ToString());
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         mListRecordMemos.Clear();
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.DeserializeObject <RecordMemoInfo>(webReturn.ListData[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             RecordMemoInfo info = optReturn.Data as RecordMemoInfo;
             if (info != null)
             {
                 RecordMemoItem item = new RecordMemoItem(info);
                 if (item.UserID == CurrentApp.Session.UserID)
                 {
                     mThisRecordMemo = item;
                 }
                 mListRecordMemos.Add(item);
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #14
0
 private void LoadScoreSheetInfo(BasicScoreSheetItem item)
 {
     try
     {
         if (item == null)
         {
             return;
         }
         string     scoreSheetID = item.ScoreSheetID.ToString();
         WebRequest webRequest   = new WebRequest();
         webRequest.Code    = (int)S3102Codes.GetScoreSheetInfo;
         webRequest.Session = CurrentApp.Session;
         webRequest.ListData.Add(scoreSheetID);
         webRequest.ListData.Add(item.ScoreResultID.ToString());//评分成绩ID T_31_008.c001
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         OperationReturn optReturn = XMLHelper.DeserializeObject <ScoreSheet>(webReturn.Data);
         if (!optReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         ScoreSheet scoreSheet = optReturn.Data as ScoreSheet;
         if (scoreSheet == null)
         {
             ShowException(string.Format("Fail.\tScoreSheet is null"));
             return;
         }
         scoreSheet.ScoreSheet = scoreSheet;
         scoreSheet.Init();
         mCurrentScoreSheet = scoreSheet;
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
Beispiel #15
0
 private bool SaveScoreItemResult()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.SaveScoreItemResult;
         webRequest.ListData.Add(ScoreSheetItem.ScoreSheetID.ToString());
         webRequest.ListData.Add(ScoreSheetItem.ScoreResultID.ToString());
         webRequest.ListData.Add(mListScoreItemResults.Count.ToString());
         for (int i = 0; i < mListScoreItemResults.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.SeriallizeObject(mListScoreItemResults[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return(false);
             }
             webRequest.ListData.Add(optReturn.Data.ToString());
         }
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo,
                                                                                            "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
         return(false);
     }
 }
Beispiel #16
0
        //这个只是将备注其存到T_31_046备注表
        private void SaveRecordMemo()
        {
            try
            {
                if (string.IsNullOrEmpty(TxtMemoContent.Text))
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N037", string.Format("Memo content is empty")));
                    return;
                }
                if (TxtMemoContent.Text.ToString().Length > 1024)
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N036", "Save the content is too long"));
                    return;
                }
                RecordMemoItem item = mListRecordMemos.FirstOrDefault(m => m.UserID == CurrentApp.Session.UserID);
                if (item == null)
                {
                    RecordMemoInfo info = new RecordMemoInfo();
                    info.ID               = 0;
                    info.RecordSerialID   = RecordInfoItem.SerialID;
                    info.UserID           = CurrentApp.Session.UserID;
                    info.MemoTime         = DateTime.Now;
                    info.Content          = TxtMemoContent.Text;
                    info.State            = "1";
                    info.LastModifyUserID = CurrentApp.Session.UserID;
                    info.LastModifyTime   = DateTime.Now;
                    info.Source           = "U";
                    item = new RecordMemoItem(info);
                }
                else
                {
                    RecordMemoInfo info = item.RecordMemoInfo;
                    info.Content          = TxtMemoContent.Text;
                    info.LastModifyUserID = CurrentApp.Session.UserID;
                    info.LastModifyTime   = DateTime.Now;
                }
                OperationReturn optReturn = XMLHelper.SeriallizeObject(item.RecordMemoInfo);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                string strMemoInfo = optReturn.Data.ToString();

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

                #region 写操作日志

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

                #endregion

                CurrentApp.ShowInfoMessage(CurrentApp.GetMessageLanguageInfo("003", "Save RecordMemo end"));
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #17
0
 //自动评分
 private void TheWayYouAre()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetAutoScore;
         webRequest.ListData.Add(RecordInfoItem.SerialID.ToString());
         List <Standard> listScoreObjectTemp = new List <Standard>();
         mCurrentScoreSheet.GetAllStandards(ref listScoreObjectTemp);
         //Standard standard = null;
         for (int i = 0; i < listScoreObjectTemp.Count; i++)
         {
             if (listScoreObjectTemp[i].IsAutoStandard == true)
             {
                 webRequest.ListData.Add(listScoreObjectTemp[i].StatisticalID.ToString());
             }
         }
         if (webRequest.ListData.Count < 2)
         {
             return;
         }
         //Service31021Client client = new Service31021Client();
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string   strInfo = webReturn.ListData[i];
             string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries);
             if (arrInfo.Length < 2)
             {
                 continue;
             }
             string strGrade       = arrInfo[0];
             string strStatisticID = arrInfo[1];
             //AutoScoreToUI(arrInfo[0], arrInfo[1]);
             //ScoreItem temp = mCurrentScoreSheet.Items.FirstOrDefault(o => o..HasAutoStandard == true);
             List <Standard> listScoreObjectTemp_ = new List <Standard>();
             mCurrentScoreSheet.GetAllStandards(ref listScoreObjectTemp_);
             for (int n = 0; n < listScoreObjectTemp_.Count; n++)
             {
                 if (strStatisticID == listScoreObjectTemp_[n].StatisticalID.ToString())
                 {
                     if (strGrade == "1")
                     {
                         listScoreObjectTemp_[n].Score = 0;
                     }
                     if (strGrade == "2")
                     {
                         listScoreObjectTemp_[n].Score = listScoreObjectTemp_[n].TotalScore;
                     }
                     if (strGrade == "N/A")
                     {
                         listScoreObjectTemp_[n].IsNA = true;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #18
0
 private bool SaveScoreCommentResult()
 {
     try
     {
         if (ScoreSheetItem == null ||
             mCurrentScoreSheet == null)
         {
             return(false);
         }
         List <ScoreObject> listScoreObjects = new List <ScoreObject>();
         mCurrentScoreSheet.GetAllScoreObject(ref listScoreObjects);
         List <BasicScoreCommentInfo> listCommentResults = new List <BasicScoreCommentInfo>();
         for (int i = 0; i < listScoreObjects.Count; i++)
         {
             var comment = listScoreObjects[i] as Comment;
             if (comment == null)
             {
                 continue;
             }
             var scoreItem = comment.ScoreItem;
             if (scoreItem == null)
             {
                 continue;
             }
             var temp =
                 mListScoreCommentResults.FirstOrDefault(s => s.ScoreResultID == ScoreSheetItem.ScoreResultID &&
                                                         s.ScoreSheetID == mCurrentScoreSheet.ID &&
                                                         s.ScoreItemID == scoreItem.ID &&
                                                         s.ScoreCommentID == comment.ID);
             if (temp == null)
             {
                 temp = new BasicScoreCommentInfo();
                 temp.ScoreResultID  = ScoreSheetItem.ScoreResultID;
                 temp.ScoreSheetID   = mCurrentScoreSheet.ID;
                 temp.ScoreItemID    = scoreItem.ID;
                 temp.ScoreCommentID = comment.ID;
             }
             var itemComment = comment as ItemComment;
             if (itemComment != null &&
                 itemComment.SelectItem != null)
             {
                 temp.CommentItemID      = itemComment.SelectItem.ID;
                 temp.CommentItemOrderID = itemComment.SelectItem.OrderID;
                 temp.CommentText        = itemComment.SelectItem.Text;
                 listCommentResults.Add(temp);
             }
             var textComment = comment as TextComment;
             if (textComment != null)
             {
                 temp.CommentText = textComment.Text;
                 listCommentResults.Add(temp);
             }
         }
         int count = listCommentResults.Count;
         if (count <= 0)
         {
             return(true);
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.SaveScoreCommentResultInfos;
         webRequest.ListData.Add(ScoreSheetItem.ScoreResultID.ToString());
         webRequest.ListData.Add(count.ToString());
         for (int i = 0; i < listCommentResults.Count; i++)
         {
             OperationReturn optReturn = XMLHelper.SeriallizeObject(listCommentResults[i]);
             if (!optReturn.Result)
             {
                 ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return(false);
             }
             webRequest.ListData.Add(optReturn.Data.ToString());
         }
         Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                            WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo,
                                                                                            "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
         return(false);
     }
 }
Beispiel #19
0
        public OperationReturn SaveConfig()
        {
            OperationReturn optReturn = new OperationReturn();

            optReturn.Result = true;
            optReturn.Code   = 0;
            try
            {
                List <CustomConditionItem> listItems = new List <CustomConditionItem>();
                for (int i = 0; i < mListTabItems.Count; i++)
                {
                    ConditionTabItem tabItem = mListTabItems[i];
                    for (int j = 0; j < tabItem.Items.Count; j++)
                    {
                        ConditionItemItem item = tabItem.Items[j];
                        item.Apply();
                        if (item.ConditionItem != null)
                        {
                            item.ConditionItem.ViewMode = item.ConditionItem.ViewMode == 2 ? 2 : 1;
                        }
                        listItems.Add(item.ConditionItem);
                    }
                }
                if (listItems.Count > 0)
                {
                    WebRequest webRequest = new WebRequest();
                    webRequest.Session = CurrentApp.Session;
                    webRequest.Code    = (int)S3102Codes.SaveUserConditionItemInfos;
                    webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                    int count = listItems.Count;
                    webRequest.ListData.Add(count.ToString());
                    for (int i = 0; i < count; i++)
                    {
                        optReturn = XMLHelper.SeriallizeObject(listItems[i]);
                        if (!optReturn.Result)
                        {
                            return(optReturn);
                        }
                        webRequest.ListData.Add(optReturn.Data.ToString());
                    }
                    Service31021Client client = new Service31021Client(
                        WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                        WebHelper.CreateEndpointAddress(
                            CurrentApp.Session.AppServerInfo,
                            "Service31021"));
                    WebReturn webReturn = client.DoOperation(webRequest);
                    if (!webReturn.Result)
                    {
                        optReturn.Result  = false;
                        optReturn.Code    = webReturn.Code;
                        optReturn.Message = webReturn.Message;
                        return(optReturn);
                    }
                }
            }
            catch (Exception ex)
            {
                optReturn.Result  = false;
                optReturn.Code    = Defines.RET_FAIL;
                optReturn.Message = ex.Message;
            }
            return(optReturn);
        }
Beispiel #20
0
 private void InitControlOrgs(CtrolAgent parentItem, string parentID)
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = 10;
         webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
         webRequest.ListData.Add(parentID);
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null")));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string   strInfo = webReturn.ListData[i];
             string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR },
                                              StringSplitOptions.RemoveEmptyEntries);
             if (arrInfo.Length < 2)
             {
                 continue;
             }
             string     strID   = arrInfo[1];
             string     strName = arrInfo[0];
             CtrolAgent item    = new CtrolAgent();
             item.ObjType    = ConstValue.RESOURCE_ORG;
             item.ObjID      = Convert.ToInt64(strID);
             item.Name       = strName;
             item.IsChecked  = true;
             item.IsExpanded = true;
             item.Data       = strInfo;
             if (strID == ConstValue.ORG_ROOT.ToString())
             {
                 item.Icon = "Images/rootorg.ico";
             }
             else
             {
                 item.Icon = "Images/org.ico";
             }
             InitControlOrgs(item, strID);
             InitControlAgents(item, strID);
             AddChildObject(parentItem, item);
         }
         List <CtrolAgent> lstCtrolOrgTemp = new List <CtrolAgent>();
         GetOrgIsCheck(mListAgents, ref lstCtrolOrgTemp);
         if (lstCtrolOrgTemp.Count > 0)
         {
             AgentsStr = SaveMultiAgent(lstCtrolOrgTemp);
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
        private void InitConversationInfo()
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.GetConversationInfo;
                webRequest.ListData.Add(PlayingRecord.RecordReference.ToString());
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31021"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("Fail.\tListData is null"));
                    return;
                }
                List <ConversationInfoItem> listTemp = new List <ConversationInfoItem>();
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string          strInfo   = webReturn.ListData[i];
                    OperationReturn optReturn = XMLHelper.DeserializeObject <ConversationInfo>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    ConversationInfo     info     = optReturn.Data as ConversationInfo;
                    ConversationInfoItem infoItem = new ConversationInfoItem(info);

                    if (infoItem.Direction == "0")
                    {
                        infoItem.Icon = "Images/0.ico";
                        if (PlayingRecord.Direction == 0)
                        {
                            infoItem.Extension = PlayingRecord.CallerID;
                        }
                        if (PlayingRecord.Direction == 1)
                        {
                            infoItem.Extension = PlayingRecord.CalledID;
                        }
                    }
                    if (infoItem.Direction == "1")
                    {
                        infoItem.Icon = "Images/1.ico";
                        if (PlayingRecord.Direction == 0)
                        {
                            infoItem.Extension = PlayingRecord.CalledID;
                        }
                        if (PlayingRecord.Direction == 1)
                        {
                            infoItem.Extension = PlayingRecord.CallerID;
                        }
                    }

                    if (infoItem.SerialID == "0")
                    {
                        infoItem.IsVisible = false;
                    }
                    else
                    {
                        infoItem.IsVisible = true;
                    }
                    if (info == null)
                    {
                        ShowException(string.Format("Fail.\tConversationInfo is null"));
                        return;
                    }
                    listTemp.Add(infoItem);
                }
                listTemp = listTemp.OrderBy(t => t.Offset).ToList();
                for (int i = 0; i < listTemp.Count; i++)
                {
                    mListConversationInfoItem.Add(listTemp[i]);
                }
                //mListConversationInfoItem = listTemp;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #22
0
        //写一个方法 然后将选中的录音 放到文件夹下面(首先我能够获得选中的录音,以及能够写的描述了)
        private bool AddRecordToLibrary()
        {
            try
            {
                var tempitem = LibraryTree.SelectedItem as ObjectItem;
                if (SelectRecordInfoItem.MediaType != 1)
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N051", "上传到教材库的不能有录屏"));
                    return(false);
                }
                //文件夹路径
                if (tempitem == null)
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N052", "必须选择一个文件夹"));
                    return(false);
                }
                string path = GetPath(tempitem.Name, tempitem);

                //教材库文件夹主键 ,T_31_058_00000.C001
                string dirID = tempitem.ObjID.ToString();
                //if (string.IsNullOrWhiteSpace(dirID) || string.IsNullOrEmpty(dirID))
                //{
                //    ShowException("必须选择一个文件夹");
                //    return false;
                //}
                //教材名字  我这里就是录音ID 而不是录音流水号
                string learningName = SelectRecordInfoItem.SerialID.ToString();
                //录音流水号存放在教材库的路径
                string recordPath = path + @"\" + SelectRecordInfoItem.RecordReference + ".wav";
                //描述
                string tempDiscription = DiscriptionText.Text.ToString();
                if (tempDiscription.IndexOf("'") != -1)
                {
                    string tempa = tempDiscription.Replace("'", "''");
                    tempDiscription = tempa;
                }
                if (string.IsNullOrWhiteSpace(tempDiscription) || string.IsNullOrEmpty(tempDiscription))
                {
                    ShowException(CurrentApp.GetLanguageInfo("3102N053", "描述不能为空或者为空格"));
                    return(false);
                }
                //该录音是否加密
                string isEncrytp = SelectRecordInfoItem.EncryptFlag == "0"?"0":"1";

                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.InsertLearningToLibrary;
                webRequest.ListData.Add(dirID);
                webRequest.ListData.Add(learningName);
                webRequest.ListData.Add(recordPath);
                webRequest.ListData.Add(tempDiscription);
                webRequest.ListData.Add(isEncrytp);
                //Service31021Client client = new Service31021Client();
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31021"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                ShowException(ex.ToString());
                return(false);
            }
        }
 private void LoadUserSettingInfos()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = (int)S3102Codes.GetUserSettingList;
         webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
         webRequest.ListData.Add("310202");
         webRequest.ListData.Add(string.Empty);
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             ShowException(string.Format("Fail.\tListData is null"));
             return;
         }
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string          strInfo   = webReturn.ListData[i];
             OperationReturn optReturn = XMLHelper.DeserializeObject <SettingInfo>(strInfo);
             if (!optReturn.Result)
             {
                 CurrentApp.WriteLog("LoadSetting", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 continue;
             }
             SettingInfo settingInfo = optReturn.Data as SettingInfo;
             if (settingInfo == null)
             {
                 CurrentApp.WriteLog("LoadSetting", string.Format("Fail.\tSettingInfo is null"));
                 continue;
             }
             var temp =
                 mListSettingInfos.FirstOrDefault(
                     s => s.ParamID == settingInfo.ParamID && s.UserID == settingInfo.UserID);
             if (temp == null)
             {
                 mListSettingInfos.Add(settingInfo);
             }
             else
             {
                 mListSettingInfos.Remove(temp);
                 mListSettingInfos.Add(settingInfo);
             }
         }
     }
     catch (Exception ex)
     {
         ShowException(ex.Message);
     }
 }
        private void LoadQueryConditions()
        {
            try
            {
                mListQueryConditions.Clear();

                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.GetUserQueryCondition;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowException(string.Format("Fail.\tListData is null"));
                    return;
                }
                OperationReturn optReturn;
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string strInfo = webReturn.ListData[i];
                    optReturn = XMLHelper.DeserializeObject <QueryCondition>(strInfo);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("WSFail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    QueryCondition info = optReturn.Data as QueryCondition;
                    if (info == null)
                    {
                        ShowException(string.Format("Fail.\tQueryCondition is null"));
                        return;
                    }
                    if (info.UseCount <= 0)
                    {
                        continue;
                    }
                    mListQueryConditions.Add(info);
                }


                //QueryCondition info = new QueryCondition();
                //info.ID = 3020000000000000001;
                //info.Name = "Test1";
                //info.Description = info.Name;
                //info.UserID = CurrentApp.Session.UserID;
                //info.Creator = info.UserID;
                //info.CreateTime = DateTime.Now.AddHours(-5);
                //info.CreateType = "S";
                //info.SortID = 0;
                //info.LastQueryTime = DateTime.Now.AddMinutes(-30);
                //info.IsEnable = true;
                //info.UseCount = 5;
                //info.RecordCount = 210;
                //mListQueryConditions.Add(info);

                //info = new QueryCondition();
                //info.ID = 3020000000000000002;
                //info.Name = "Test2";
                //info.Description = info.Name;
                //info.UserID = CurrentApp.Session.UserID;
                //info.Creator = info.UserID;
                //info.CreateTime = DateTime.Now.AddHours(-15);
                //info.CreateType = "S";
                //info.SortID = 0;
                //info.LastQueryTime = DateTime.Now.AddMinutes(-120);
                //info.IsEnable = true;
                //info.UseCount = 3;
                //info.RecordCount = 510;
                //mListQueryConditions.Add(info);

                //info = new QueryCondition();
                //info.ID = 3020000000000000003;
                //info.Name = "Test3";
                //info.Description = info.Name;
                //info.UserID = CurrentApp.Session.UserID;
                //info.Creator = info.UserID;
                //info.CreateTime = DateTime.Now.AddHours(-25);
                //info.CreateType = "S";
                //info.SortID = 0;
                //info.LastQueryTime = DateTime.Now.AddMinutes(-10);
                //info.IsEnable = true;
                //info.UseCount = 21;
                //info.RecordCount = 320;
                //mListQueryConditions.Add(info);

                //info = new QueryCondition();
                //info.ID = 3020000000000000004;
                //info.Name = "Test4";
                //info.Description = info.Name;
                //info.UserID = CurrentApp.Session.UserID;
                //info.Creator = info.UserID;
                //info.CreateTime = DateTime.Now.AddHours(-45);
                //info.CreateType = "S";
                //info.SortID = 0;
                //info.LastQueryTime = DateTime.Now.AddMinutes(-330);
                //info.IsEnable = true;
                //info.UseCount = 32;
                //info.RecordCount = 5;
                //mListQueryConditions.Add(info);

                //info = new QueryCondition();
                //info.ID = 3020000000000000005;
                //info.Name = "Test5";
                //info.Description = info.Name;
                //info.UserID = CurrentApp.Session.UserID;
                //info.Creator = info.UserID;
                //info.CreateTime = DateTime.Now.AddHours(-2);
                //info.CreateType = "S";
                //info.SortID = 0;
                //info.LastQueryTime = DateTime.Now.AddMinutes(-10);
                //info.IsEnable = true;
                //info.UseCount = 13;
                //info.RecordCount = 260;
                //mListQueryConditions.Add(info);
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #25
0
        //现在我新建一个方法 将备注存到T_21_001的C072字段里面
        private void SetMemoInfoToT_21_001()
        {
            try
            {
                //这个是存完备注之后,在到备注表里面读取最后的备注再存到下面这里面
                List <RecordMemoItem> mListRecordMemos_new;
                mListRecordMemos_new = new List <RecordMemoItem>();

                if (RecordInfoItem == null)
                {
                    return;
                }
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3102Codes.GetRecordMemoList;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add(RecordInfoItem.SerialID.ToString());
                Service31021Client client = new Service31021Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31021"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                mListRecordMemos_new.Clear();
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.DeserializeObject <RecordMemoInfo>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    RecordMemoInfo info = optReturn.Data as RecordMemoInfo;
                    if (info != null)
                    {
                        RecordMemoItem item = new RecordMemoItem(info);
                        mListRecordMemos_new.Add(item);
                    }
                }
                string TempMemo = string.Empty;
                for (int i = 0; i < mListRecordMemos_new.Count; i++)
                {
                    if (TempMemo.Length > 500)
                    {
                        break;
                    }
                    if (i < mListRecordMemos_new.Count - 1)
                    {
                        TempMemo += mListRecordMemos_new[i].UserID + ConstValue.SPLITER_CHAR_2 + mListRecordMemos_new[i].Content + ConstValue.SPLITER_CHAR;
                    }
                    else
                    {
                        TempMemo += mListRecordMemos_new[i].UserID + ConstValue.SPLITER_CHAR_2 + mListRecordMemos_new[i].Content;
                    }
                }

                //下面是获得记录表的名字(考虑到分表的情况)
                QueryStateInfo queryStateInfo = new QueryStateInfo();
                queryStateInfo.RowID = 0;
                var tableInfo =
                    CurrentApp.Session.ListPartitionTables.FirstOrDefault(
                        t => t.TableName == ConstValue.TABLE_NAME_RECORD && t.PartType == TablePartType.DatetimeRange);
                if (tableInfo == null)
                {
                    tableInfo =
                        CurrentApp.Session.ListPartitionTables.FirstOrDefault(
                            t => t.TableName == ConstValue.TABLE_NAME_RECORD && t.PartType == TablePartType.VoiceID);
                    if (tableInfo == null)
                    {
                        queryStateInfo.TableName = string.Format("{0}_{1}", ConstValue.TABLE_NAME_RECORD,
                                                                 CurrentApp.Session.RentInfo.Token);
                    }
                    else
                    {
                        //按录音服务器查询,没有实现,暂时还是按普通方式来
                        queryStateInfo.TableName = string.Format("{0}_{1}", ConstValue.TABLE_NAME_RECORD,
                                                                 CurrentApp.Session.RentInfo.Token);
                    }
                }
                else
                {
                    DateTime baseTime = RecordInfoItem.StartRecordTime;
                    string   partTable;
                    partTable = baseTime.ToString("yyMM");
                    queryStateInfo.TableName = string.Format("{0}_{1}_{2}", ConstValue.TABLE_NAME_RECORD,
                                                             CurrentApp.Session.RentInfo.Token, partTable);
                }
                SetMemoInfoToT_21_001(RecordInfoItem.SerialID.ToString(), TempMemo, queryStateInfo.TableName);
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Beispiel #26
0
 private void GetRelativeRecordInfos()
 {
     try
     {
         if (RecordInfoItem == null)
         {
             return;
         }
         RecordInfoItem.ListRelativeInfos.Clear();
         //bool isAutoRelative = false;
         //if (ListUserSettingInfos != null)
         //{
         //    var setting =
         //        ListUserSettingInfos.FirstOrDefault(s => s.ParamID == S3103Consts.USER_PARAM_AUTORELATIVEPLAY);
         //    if (setting != null && setting.StringValue == "1")
         //    {
         //        isAutoRelative = true;
         //    }
         //}
         //if (!isAutoRelative) { return; }
         if (RecordInfoItem.MediaType != 1)
         {
             return;
         }
         var recordInfo = RecordInfoItem.RecordInfo;
         if (recordInfo == null)
         {
             return;
         }
         OperationReturn optReturn;
         optReturn = XMLHelper.SeriallizeObject(recordInfo);
         if (!optReturn.Result)
         {
             CurrentApp.WriteLog("GetRelativeInfos", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Session = CurrentApp.Session;
         webRequest.Code    = 41;//(int)S3102Codes.GetRelativeRecordList
         webRequest.ListData.Add(optReturn.Data.ToString());
         Service31021Client client = new Service31021Client(
             WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
             WebHelper.CreateEndpointAddress(
                 CurrentApp.Session.AppServerInfo,
                 "Service31021"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             CurrentApp.WriteLog("GetRelativeInfos", string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             CurrentApp.WriteLog("GetRelativeInfos", string.Format("WSFail.\tListData is null"));
             return;
         }
         int count = webReturn.ListData.Count;
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string strInfo = webReturn.ListData[i];
             optReturn = XMLHelper.DeserializeObject <RecordInfo>(strInfo);
             if (!optReturn.Result)
             {
                 CurrentApp.WriteLog("GetRelativeInfos", string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             RecordInfo relativeRecord = optReturn.Data as RecordInfo;
             if (relativeRecord == null)
             {
                 CurrentApp.WriteLog("GetRelativeInfos", string.Format("WSFail.\tRelativeRecordInfo is null"));
                 return;
             }
             RecordInfoItem.ListRelativeInfos.Add(relativeRecord);
             CurrentApp.WriteLog("GetRelativeInfos", string.Format("{0}", relativeRecord.SerialID));
         }
         CurrentApp.WriteLog("GetRelativeInfos", string.Format("End.\t{0}", count));
     }
     catch (Exception ex)
     {
         CurrentApp.WriteLog("GetRelativeInfos", string.Format("Fail.\t{0}", ex.Message));
     }
 }
        void BtnApply_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                List <SettingInfo> listSettingInfos = new List <SettingInfo>();
                SettingInfo        settingInfo;
                string             strType = "1";
                if (RadioCurrentSelected.IsChecked == true)
                {
                    strType = "1";
                }
                if (RadioCurrentPage.IsChecked == true)
                {
                    strType = "2";
                }
                if (RadioAllPage.IsChecked == true)
                {
                    strType = "3";
                }
                settingInfo             = new SettingInfo();
                settingInfo.UserID      = CurrentApp.Session.UserID;
                settingInfo.ParamID     = S3102Consts.USER_PARAM_EXPORTDATA_TYPE;
                settingInfo.GroupID     = 310202;
                settingInfo.SortID      = 0;
                settingInfo.StringValue = strType;
                settingInfo.DataType    = 2;
                listSettingInfos.Add(settingInfo);

                settingInfo             = new SettingInfo();
                settingInfo.UserID      = CurrentApp.Session.UserID;
                settingInfo.ParamID     = S3102Consts.USER_PARAM_EXPORTDATA_REMEMBER;
                settingInfo.GroupID     = 310202;
                settingInfo.SortID      = 1;
                settingInfo.StringValue = CbRemember.IsChecked == true ? "1" : "0";
                settingInfo.DataType    = 2;
                listSettingInfos.Add(settingInfo);

                settingInfo             = new SettingInfo();
                settingInfo.UserID      = CurrentApp.Session.UserID;
                settingInfo.ParamID     = S3102Consts.USER_PARAM_EXPORTDATA_NOTSHOW;
                settingInfo.GroupID     = 310202;
                settingInfo.SortID      = 2;
                settingInfo.StringValue = CbNotShow.IsChecked == true ? "1" : "0";
                settingInfo.DataType    = 2;
                listSettingInfos.Add(settingInfo);

                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3102Codes.SaveUserSettingInfos;
                webRequest.ListData.Add(CurrentApp.Session.UserID.ToString());
                webRequest.ListData.Add(listSettingInfos.Count.ToString());
                for (int i = 0; i < listSettingInfos.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.SeriallizeObject(listSettingInfos[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    webRequest.ListData.Add(optReturn.Data.ToString());
                }
                Service31021Client client = new Service31021Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(
                        CurrentApp.Session.AppServerInfo,
                        "Service31021"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (PageParent != null)
                {
                    PageParent.ReloadUserSettings();
                    PageParent.ExportData();
                }
                var parent = Parent as PopupPanel;
                if (parent != null)
                {
                    parent.IsOpen = false;
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }