public BasicScoreSheetInfo InitExportScoreSheet(ScoreSheetItem item) { try { BasicScoreSheetInfo scoreSheetItemInfo = new BasicScoreSheetInfo(); scoreSheetItemInfo.ID = item.ID; scoreSheetItemInfo.Name = item.Name; scoreSheetItemInfo.State = item.State; scoreSheetItemInfo.TotalScore = item.TotalScore; scoreSheetItemInfo.ViewClassic = item.ViewClassic; scoreSheetItemInfo.ScoreType = item.ScoreType; scoreSheetItemInfo.UseFlag = item.UseFlag; scoreSheetItemInfo.ItemCount = item.ItemCount; scoreSheetItemInfo.Description = item.Description; //OperationReturn temp = XMLHelper.SeriallizeObject<BasicScoreSheetInfo>(scoreSheetItemInfo); return(scoreSheetItemInfo); } catch (Exception ex) { ShowInformation(ex.Message); return(null); } }
private void LoadScoreSheets() { try { ClearChildItem(); WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)S3101Codes.GetScoreSheetList; webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString()); Service31011Client client = new Service31011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31011")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.{0}\t{1}", webReturn.Code, webReturn.Message)); return; } List <string> listScoreSheet = webReturn.ListData; OperationReturn optReturn; for (int i = 0; i < listScoreSheet.Count; i++) { string strScoreSheetInfo = listScoreSheet[i]; optReturn = XMLHelper.DeserializeObject <BasicScoreSheetInfo>(strScoreSheetInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo scoreSheetInfo = optReturn.Data as BasicScoreSheetInfo; if (scoreSheetInfo == null) { ShowException(string.Format("Fail.\tScoreSheetInfo is null")); return; } ScoreSheetItem scoreSheetItem = new ScoreSheetItem(); scoreSheetItem.ID = scoreSheetInfo.ID; scoreSheetItem.Name = scoreSheetInfo.Name; scoreSheetItem.State = scoreSheetInfo.State; scoreSheetItem.TotalScore = scoreSheetInfo.TotalScore; scoreSheetItem.ItemCount = scoreSheetInfo.ItemCount; scoreSheetItem.ViewClassic = scoreSheetInfo.ViewClassic; scoreSheetItem.ScoreType = scoreSheetInfo.ScoreType; scoreSheetItem.UseFlag = scoreSheetInfo.UseFlag; scoreSheetItem.Description = scoreSheetInfo.Description; scoreSheetItem.TipState = "State:" + scoreSheetItem.State; scoreSheetItem.TipViewClassic = "ViewClassic" + scoreSheetItem.ViewClassic; scoreSheetItem.TipScoreType = "ScoreType:" + scoreSheetItem.ScoreType; scoreSheetItem.Data = scoreSheetInfo; AddChildItem(scoreSheetItem); } CurrentApp.WriteLog("PageLoad", string.Format("Load ScoreSheet")); } catch (Exception ex) { ShowException(ex.Message); } }
private void LoadUserScoreSheetList() { try { mListScoreSheetItems = new List <BasicScoreSheetItem>(); WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3105Codes.GetUserScoreSheetList; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(selTaskRecord.RecoredReference.ToString()); webRequest.ListData.Add(ParentPage.AgentID); webRequest.ListData.Add("0"); Service31051Client client = new Service31051Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31051")); 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 == null || webReturn.ListData.Count == 0) { ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null"))); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; OperationReturn optReturn = XMLHelper.DeserializeObject <BasicScoreSheetInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo info = optReturn.Data as BasicScoreSheetInfo; if (info == null) { ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null"))); return; } BasicScoreSheetItem item = new BasicScoreSheetItem(info); item.RowNumber = i + 1; item.Background = GetScoreSheetBackground(item); //控制唯一評分表 2016年6月7日 16:37:47 目前修改:列出所有可用评分表,但是提示打分被申诉所用的那张评分表 if (item.ScoreSheetID == Convert.ToInt64(selTaskRecord.TemplateID)) { item.Title = string.Format("({0})", CurrentApp.GetLanguageInfo("", "Last Score")) + item.Title; } mListScoreSheetItems.Add(item); } } catch (Exception ex) { ShowException(ex.Message); } }
private void LoadUserScoreResultList() { try { WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3105Codes.GetUserScoreSheetList; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(selTaskRecord.RecoredReference.ToString()); //webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add(selTaskRecord.AgentID); webRequest.ListData.Add("1"); Service31051Client client = new Service31051Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31051")); 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 == 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]; OperationReturn optReturn = XMLHelper.DeserializeObject <BasicScoreSheetInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo info = optReturn.Data as BasicScoreSheetInfo; if (info == null) { ShowException(CurrentApp.GetLanguageInfo("3105T00101", string.Format("ListData is null"))); return; } BasicScoreSheetItem item = mListScoreSheetItems.FirstOrDefault(s => s.ScoreSheetID == info.ScoreSheetID); if (item != null) { item.ScoreSheetInfo = info; item.ScoreResultID = info.ScoreResultID; item.Score = info.Score; item.Flag = 1; } } } catch (Exception ex) { ShowException(ex.Message); } }
private void UCExportRecordOption_Loaded(object sender, RoutedEventArgs e) { LbSaveDir.Text = CurrentApp.GetLanguageInfo("3101N011", "Save Directory"); BtnApply.Content = CurrentApp.GetLanguageInfo("3101N012", "Apply"); BtnClose.Content = CurrentApp.GetLanguageInfo("3101N013", "Close"); BasicScoreSheetInfo temp = PageParent.InitExportScoreSheet(ScoreSheetItem); ScoreSheetItemInfo = temp; LoadScoreSheetData(ScoreSheetItemInfo); }
public BasicScoreSheetItem(BasicScoreSheetInfo scoreSheetInfo) { ScoreResultID = scoreSheetInfo.ScoreResultID; ScoreSheetID = scoreSheetInfo.ScoreSheetID; RecordSerialID = scoreSheetInfo.RecordSerialID; Title = scoreSheetInfo.Title; TotalScore = scoreSheetInfo.TotalScore; Score = scoreSheetInfo.Score; UserID = scoreSheetInfo.UserID; OrgID = scoreSheetInfo.OrgID; ScoreSheetInfo = scoreSheetInfo; }
public ExportScoreSheet() { InitializeComponent(); ScoreSheetItemInfo = new BasicScoreSheetInfo(); mExportScoreSheet = new ScoreSheet(); BtnApply.Click += BtnApply_Click; BtnClose.Click += BtnClose_Click; BtnBrowser.Click += BtnBrowser_Click; Loaded += UCExportRecordOption_Loaded; }
//private void SaveScoreSheetData(ScoreSheet scoreSheet) //{ // try // { // OperationReturn optReturn = XMLHelper.SeriallizeObject(scoreSheet); // if (!optReturn.Result) // { // ShowException(string.Format("{0}\t{1}", optReturn.Code, optReturn.Message)); // return; // } // WebRequest webRequest = new WebRequest(); // webRequest.Code = (int)S3101Codes.SaveScoreSheetInfo; // webRequest.Session = CurrentApp.Session; // webRequest.ListData.Add(CurrentApp.Session.UserInfo.UserID.ToString()); // webRequest.ListData.Add(optReturn.Data.ToString()); // Service31011Client client = new Service31011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), // WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31011")); // 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("SaveScoreSheet", webReturn.Data); // #region 写操作日志 // //string strLog = string.Format("{0} {1} ", Utils.FormatOptLogString("COL3101001Name"), // // scoreSheet.Title); // //strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3101001TotalScore"), // // scoreSheet.TotalScore); // //strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3101001ViewClassic"), // // Utils.FormatOptLogString(string.Format("3101Tip002{0}", (int)scoreSheet.ViewClassic))); // //strLog += string.Format("{0} {1} ", Utils.FormatOptLogString("COL3101001ScoreType"), // // Utils.FormatOptLogString(string.Format("3101Tip003{0}", (int)scoreSheet.ScoreType))); // //CurrentApp.WriteOperationLog(CurrentApp.IsModifyScoreSheet ? // // S3101Consts.OPT_MODIFYSCORESHEET.ToString() : S3101Consts.OPT_CREATESCORESHEET.ToString(), // // ConstValue.OPT_RESULT_SUCCESS, strLog); // #endregion // //ShowInformation(CurrentApp.GetMessageLanguageInfo("002", "Save ScoreSheet end")); // //mIsChanged = false; // } // catch (Exception ex) // { // ShowException(ex.Message); // } //} //private long GetSerialID() //{ // try // { // WebRequest webRequest = new WebRequest(); // webRequest.Code = (int)RequestCode.WSGetSerialID; // webRequest.Session = CurrentApp.Session; // webRequest.ListData.Add("31"); // webRequest.ListData.Add("301"); // webRequest.ListData.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); // Service11012Client client = new Service11012Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), // WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11012")); // WebReturn webReturn = client.DoOperation(webRequest); // client.Close(); // if (!webReturn.Result) // { // ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); // return -1; // } // long id = Convert.ToInt64(webReturn.Data); // return id; // } // catch (Exception ex) // { // App.ShowExceptionMessage(ex.Message); // return -1; // } //} private void LoadScoreSheetData(BasicScoreSheetInfo scoreSheetInfo) { try { if (scoreSheetInfo != null) { WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3101Codes.GetScoreSheetInfo; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(scoreSheetInfo.ID.ToString()); Service31011Client client = new Service31011Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31011")); 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("ScoreSheet is null")); return; } scoreSheet.ScoreSheet = scoreSheet; scoreSheet.Init(); mExportScoreSheet = scoreSheet; } } catch (Exception ex) { ShowException(ex.Message); } }
public BasicScoreSheetItem(BasicScoreSheetInfo scoreSheetInfo) { ScoreResultID = scoreSheetInfo.ScoreResultID; ScoreSheetID = scoreSheetInfo.ScoreSheetID; RecordSerialID = scoreSheetInfo.RecordSerialID; Title = scoreSheetInfo.Title; TotalScore = scoreSheetInfo.TotalScore; Score = scoreSheetInfo.Score; UserID = scoreSheetInfo.UserID; AgentID = scoreSheetInfo.AgentID; OrgID = scoreSheetInfo.OrgID; IsFinalScore = scoreSheetInfo.IsFinalScore; //Flag = scoreSheetInfo.Flag; //if (Flag == 0) //{ // StrScore = CurrentApp.GetLanguageInfo("3102TIP001IsScored0", "No Score"); //} //else //{ // StrScore = Score.ToString(); //} //WasteTime = scoreSheetInfo.WasteTime; ScoreSheetInfo = scoreSheetInfo; }
private OperationReturn GetScoreSheetList(SessionInfo session, List <string> listParams) { OperationReturn optReturn = new OperationReturn(); optReturn.Result = true; optReturn.Code = 0; try { if (listParams.Count < 1) { optReturn.Result = false; optReturn.Code = Defines.RET_PARAM_INVALID; optReturn.Message = string.Format("Param count invalid"); return(optReturn); } //ListParams //0 UserID string userID = listParams[0]; string rentToken = session.RentInfo.Token; string strSql; DataSet objDataSet; switch (session.DBType) { case 2: //strSql = // string.Format( // "SELECT A.* FROM T_31_001_{0} A, T_11_201_{0} B WHERE A.C001 = B.C004 AND B.C003 = {1}", // rentToken,userID); strSql = string.Format( "SELECT * FROM T_31_001_{0} ORDER BY C001 ", rentToken); optReturn = MssqlOperation.GetDataSet(session.DBConnectionString, strSql); if (!optReturn.Result) { return(optReturn); } objDataSet = optReturn.Data as DataSet; break; case 3: strSql = string.Format( "SELECT * FROM T_31_001_{0} ORDER BY C001 ", rentToken); optReturn = OracleOperation.GetDataSet(session.DBConnectionString, strSql); if (!optReturn.Result) { return(optReturn); } objDataSet = optReturn.Data as DataSet; break; default: optReturn.Result = false; optReturn.Code = Defines.RET_PARAM_INVALID; optReturn.Message = string.Format("DBType invalid"); return(optReturn); } if (objDataSet == null || objDataSet.Tables.Count <= 0) { optReturn.Result = false; optReturn.Code = Defines.RET_OBJECT_NULL; optReturn.Message = string.Format("DataSet is null or DataTables empty"); return(optReturn); } List <string> listReturn = new List <string>(); for (int i = 0; i < objDataSet.Tables[0].Rows.Count; i++) { DataRow dr = objDataSet.Tables[0].Rows[i]; BasicScoreSheetInfo scoreSheetInfo = new BasicScoreSheetInfo(); scoreSheetInfo.ID = Convert.ToInt64(dr["C001"]); scoreSheetInfo.Name = dr["C002"].ToString(); scoreSheetInfo.State = dr["C018"].ToString() == "Y" ? 0 : 1; scoreSheetInfo.TotalScore = Convert.ToDouble(dr["C004"]); scoreSheetInfo.ViewClassic = dr["C003"].ToString() == "C" ? 1 : 0; scoreSheetInfo.ScoreType = dr["C014"].ToString() == "F" ? 2 : dr["C014"].ToString() == "P" ? 1 : 0; scoreSheetInfo.UseFlag = Convert.ToInt32(dr["C017"]); scoreSheetInfo.ItemCount = Convert.ToInt32(dr["C012"]); scoreSheetInfo.Description = dr["C019"].ToString(); optReturn = XMLHelper.SeriallizeObject(scoreSheetInfo); if (!optReturn.Result) { return(optReturn); } listReturn.Add(optReturn.Data.ToString()); } optReturn.Data = listReturn; optReturn.Message = strSql; } catch (Exception ex) { optReturn.Result = false; optReturn.Code = Defines.RET_FAIL; optReturn.Message = ex.Message; } return(optReturn); }
public void LoadUserScoreResultList() { try { WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3103Codes.GetUserScoreSheetList; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(selTaskRecord.RecoredReference.ToString()); webRequest.ListData.Add(selTaskRecord.AgtOrExtID); webRequest.ListData.Add("1"); webRequest.ListData.Add(selTaskRecord.ScoreUserID.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)); 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 <BasicScoreSheetInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo info = optReturn.Data as BasicScoreSheetInfo; if (info == null) { ShowException(string.Format("Fail.\tBaiscScoreSheetInfo is null")); return; } long orgID = 0; var agentInfo = S3103App.mListAllObjects.FirstOrDefault(a => a.ObjType == ConstValue.RESOURCE_AGENT && a.Name == selTaskRecord.AgtOrExtName); if (agentInfo != null) { var orgInfo = agentInfo.Parent as ObjectItems; if (orgInfo != null) { if (orgInfo.ObjType == ConstValue.RESOURCE_ORG) { orgID = orgInfo.ObjID; } } } info.OrgID = orgID; BasicScoreSheetItem item = mListScoreSheetItems.FirstOrDefault(s => s.ScoreSheetID == info.ScoreSheetID); if (item != null && info.ScoreResultID == selTaskRecord.OldScoreID) { item.ScoreSheetInfo = info; item.ScoreResultID = info.ScoreResultID; item.Score = info.Score; item.Flag = 1; } } } catch (Exception ex) { ShowException(ex.Message); } }
public void LoadUserScoreSheetList() { try { mListScoreSheetItems = new List <BasicScoreSheetItem>(); WebRequest webRequest = new WebRequest(); webRequest.Code = (int)S3103Codes.GetUserScoreSheetList; webRequest.Session = CurrentApp.Session; webRequest.ListData.Add(selTaskRecord.RecoredReference.ToString()); //if (selTaskRecord.TaskType == "2" || selTaskRecord.TaskType == "4")//如果是自动任务分配,在去匹配座席ID //{ // var item = App.ListCtrolAgentInfos.Where(a => a.AgentName == selTaskRecord.AgtOrExtID).FirstOrDefault(); // webRequest.ListData.Add(item.AgentID); //} //else //{ //} webRequest.ListData.Add(selTaskRecord.AgtOrExtID); webRequest.ListData.Add("0"); webRequest.ListData.Add(selTaskRecord.TaskID.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)); 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 <BasicScoreSheetInfo>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } BasicScoreSheetInfo info = optReturn.Data as BasicScoreSheetInfo; if (info == null) { ShowException(string.Format("Fail.\tBaiscScoreSheetInfo is null")); return; } BasicScoreSheetItem item = new BasicScoreSheetItem(info); item.RowNumber = i + 1; item.Background = GetScoreSheetBackground(item); if (selTaskRecord.TaskType == "3" || selTaskRecord.TaskType == "4") { if (item.ScoreSheetID == oldTemplateID) { item.Title = string.Format("({0})", CurrentApp.GetLanguageInfo("3103T00183", "1st Task")) + item.Title; } } if (ParentPage.mViewScore) { if (item.ScoreSheetID == selTaskRecord.TemplateID) { mListScoreSheetItems.Add(item); } } else { mListScoreSheetItems.Add(item); } } } catch (Exception ex) { ShowException(ex.Message); } }