public ExamProductionPage() { InitializeComponent(); _mObservableCollectionTestInfo = new ObservableCollection <TestInfoParam>(); _mObservableCollectionTestUser = new ObservableCollection <TestUserParam>(); _mlstTestInformations = new List <TestInfoParam>(); _mlstTestUserParam = new List <TestUserParam>(); _mTestUserParamTemp = new TestUserParam(); _mListPanels = new List <PanelItem>(); Loaded += PapersListInfo_Loaded; }
private void SetTestUser(List <string> listObjectState) { string strLog; try { List <TestUserParam> lstTestUserParams = new List <TestUserParam>(); foreach (var objectState in listObjectState) { string[] strTemp = objectState.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); TestUserParam testUserParam = new TestUserParam { LongTestNum = MTestInfoParam.LongTestNum, LongTestUserNum = Convert.ToInt64(strTemp[0]), StrTestUserName = strTemp[3], LongPaperNum = MTestInfoParam.LongPaperNum, StrPaperName = MTestInfoParam.StrPaperName, StrTestStatue = "N", IntEable = Convert.ToInt16(strTemp[1]) }; lstTestUserParams.Add(testUserParam); } WebRequest webRequest = new WebRequest { Session = CurrentApp.Session, Code = (int)S3603Codes.OptSetTestUserT36036 }; Service36031Client client = new Service36031Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service36031")); //var client = new Service36031Client(); OperationReturn optReturn = XMLHelper.SeriallizeObject(lstTestUserParams); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } webRequest.ListData.Add(optReturn.Data.ToString()); WebReturn webReturn = client.UmpTaskOperation(webRequest); client.Close(); CurrentApp.WriteLog(CurrentApp.GetLanguageInfo("3603T00007", "Set User")); if (!webReturn.Result) { #region 写操作日志 strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("3603T00007"), Utils.FormatOptLogString("3603T00097"), webReturn.Message); CurrentApp.WriteOperationLog(S3603Consts.OPT_SetUser.ToString(), ConstValue.OPT_RESULT_FAIL, strLog); #endregion CurrentApp.WriteLog(webReturn.Message); ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } #region 写操作日志 strLog = string.Format("{0} {1}", Utils.FormatOptLogString("3603T00007"), Utils.FormatOptLogString("3603T00096")); CurrentApp.WriteOperationLog(S3603Consts.OPT_SetUser.ToString(), ConstValue.OPT_RESULT_FAIL, strLog); #endregion CurrentApp.WriteLog("SetTestUser", webReturn.Data); } catch (Exception ex) { #region 写操作日志 strLog = string.Format("{0} {1} : {2}", Utils.FormatOptLogString("3603T00007"), Utils.FormatOptLogString("3603T00097"), ex.Message); CurrentApp.WriteOperationLog(S3603Consts.OPT_SetUser.ToString(), ConstValue.OPT_RESULT_FAIL, strLog); #endregion CurrentApp.WriteLog(ex.Message); ShowException(ex.Message); } }