Ejemplo n.º 1
0
 private void LoadScoreItemResultInfo(RecordScoreInfoItem item)
 {
     try
     {
         if (item == null)
         {
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3104Codes.GetScoreResultList;
         webRequest.Session = App.Session;
         webRequest.ListData.Add(item.ScoreID.ToString());
         Service31041Client client = new Service31041Client(WebHelper.CreateBasicHttpBinding(App.Session),
                                                            WebHelper.CreateEndpointAddress(App.Session.AppServerInfo, "Service31041"));
         WebReturn webReturn = client.UMPClientOperation(webRequest);
         client.Close();
         WriteLog.WriteLogToFile("ScoreInfo \t StrQuery", webReturn.Message);
         if (!webReturn.Result)
         {
             App.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData == null)
         {
             App.ShowExceptionMessage(App.GetLanguageInfo("3104T00113", string.Format("Fail.\tListData is null")));
             return;
         }
         mListScoreItemResults.Clear();
         WriteLog.WriteLogToFile("ScoreInfo \t GetScoreResultList 0", webReturn.ListData.Count.ToString());
         for (int i = 0; i < webReturn.ListData.Count; i++)
         {
             string strInfo = webReturn.ListData[i];
             WriteLog.WriteLogToFile("ScoreInfo \t GetScoreResultList 1", strInfo);
             OperationReturn optReturn = XMLHelper.DeserializeObject <BasicScoreItemInfo>(strInfo);
             WriteLog.WriteLogToFile("ScoreInfo \t GetScoreResultList 2", optReturn.StringValue);
             if (!optReturn.Result)
             {
                 App.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                 return;
             }
             BasicScoreItemInfo info = optReturn.Data as BasicScoreItemInfo;
             if (info == null)
             {
                 App.ShowExceptionMessage(App.GetLanguageInfo("3104T00113", string.Format("Fail.\tBasicScoreItemInfo is null")));
                 return;
             }
             mListScoreItemResults.Add(info);
         }
     }
     catch (Exception ex)
     {
         App.ShowExceptionMessage(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void LoadScoreSheetInfo(RecordScoreInfoItem item)
 {
     try
     {
         if (item == null)
         {
             return;
         }
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)S3104Codes.GetScoreSheetInfo;
         webRequest.Session = App.Session;
         webRequest.ListData.Add(item.TemplateID.ToString());
         webRequest.ListData.Add(item.ScoreID.ToString());
         Service31041Client client = new Service31041Client(WebHelper.CreateBasicHttpBinding(App.Session), WebHelper.CreateEndpointAddress(App.Session.AppServerInfo, "Service31041"));
         //Service31041Client client = new Service31041Client();
         WebReturn webReturn = client.UMPClientOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             App.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         OperationReturn optReturn = XMLHelper.DeserializeObject <ScoreSheet>(webReturn.Data);
         if (!optReturn.Result)
         {
             App.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         ScoreSheet scoreSheet = optReturn.Data as ScoreSheet;
         if (scoreSheet == null)
         {
             App.ShowExceptionMessage(App.GetLanguageInfo("3104T00127", string.Format("Fail.\tScoreSheet is null")));
             return;
         }
         scoreSheet.ScoreSheet = scoreSheet;
         scoreSheet.Init();
         mCurrentScoreSheet = scoreSheet;
     }
     catch (Exception ex)
     {
         App.ShowExceptionMessage(ex.Message);
     }
 }