From 6189c49c1201cc01f7b19dc040a417184689971f Mon Sep 17 00:00:00 2001 From: berlin-tzen Date: Tue, 14 Feb 2023 14:51:41 +0800 Subject: [PATCH] =?UTF-8?q?[WHAT]=20=E6=9B=B4=E6=96=B0=E5=B1=95=E8=A6=BD?= =?UTF-8?q?=E7=8B=80=E6=85=8B=E5=88=97=E8=A1=A8=E5=8F=AA=E5=88=97=E5=87=BA?= =?UTF-8?q?=E6=9C=89=E7=94=A8=E5=88=B0=E7=9A=84=E7=8B=80=E6=85=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShowEasy/ExhibMaintain_QryService.cs | 57 +++++++++++++++++-- .../ShowEasy/ExhibitionService.cs | 7 +-- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs index 74f95db..b7c65de 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibMaintain_QryService.cs @@ -444,6 +444,8 @@ namespace EasyBL.WEBAPP.SYS public ResponseMessage QueryShowStatusList(RequestMessage i_crm) { + ArgumentMaintain_QryService am_qry = new ArgumentMaintain_QryService(); + ResponseMessage rm = null; string sMsg = null; var db = SugarBase.GetIntance(); @@ -457,11 +459,14 @@ namespace EasyBL.WEBAPP.SYS var sArgumentClassID = "ShowStatus"; - saShowStatus = db.Queryable() - .Where(x => x.OrgID == i_crm.ORIGID && x.Effective == "Y" && x.DelStatus == "N") - .Where(t1 => t1.ArgumentClassID == sArgumentClassID) - .ToList(); + var sLanguageID = _fetchString(i_crm, @"LanguageID"); + if (string.IsNullOrEmpty(sLanguageID)) { + sLanguageID = WebAppGlobalConstWord.DEFAULT_LANGUAGE; + } + + saShowStatus = am_qry.FindAllByIDsAsDictionary(sLanguageID, i_crm.ORIGID, sArgumentClassID).Values.ToList(); + rm = new SuccessResponseMessage(null, i_crm); rm.DATA.Add(BLWording.REL, saShowStatus); } while (false); @@ -485,6 +490,46 @@ namespace EasyBL.WEBAPP.SYS #endregion 展覽管理(List 查詢展覽狀態) + #region 展覽管理(Dictionary 查詢展覽狀態) + + /// + /// 展覽管理(Dictionary 查詢展覽狀態) + /// + /// + /// + public Dictionary QueryShowStatusDic(string sLanguageID) { + + Dictionary rsResult = new Dictionary(); + + if (string.IsNullOrEmpty(sLanguageID)) { + sLanguageID = WebAppGlobalConstWord.DEFAULT_LANGUAGE; + } + + ArgumentMaintain_QryService am_qry = new ArgumentMaintain_QryService(); + var StatusDic = am_qry.FindAllByIDsAsDictionary(sLanguageID, "", "ShowStatus"); + + var rsExhibitionStatusList = QueryAllDetailExhibitionAsDictionary(sLanguageID).Values.ToList().Where(w => !string.IsNullOrEmpty(w.Status)).Select(s => s.Status); + + foreach (var sStatus in rsExhibitionStatusList) { + + if (StatusDic.ContainsKey(sStatus)) { + + StatusDTO rsStatus = new StatusDTO(); + rsStatus.Key = sStatus; + rsStatus.Value = StatusDic[sStatus].ArgumentValue; + + rsResult[sStatus] = rsStatus; + + } + + } + + return rsResult; + + } + + #endregion 展覽管理(Dictionary 查詢展覽狀態) + #region 展覽管理(List 查詢展覽週期選單) /// @@ -495,6 +540,8 @@ namespace EasyBL.WEBAPP.SYS public ResponseMessage QueryFrequencyList(RequestMessage i_crm) { + ArgumentMaintain_QryService am_qry = new ArgumentMaintain_QryService(); + ResponseMessage rm = null; string sMsg = null; var db = SugarBase.GetIntance(); @@ -710,8 +757,6 @@ namespace EasyBL.WEBAPP.SYS sLanguageID = WebAppGlobalConstWord.DEFAULT_LANGUAGE; } - System.Diagnostics.Debug.WriteLine("sLanguageID" + ": "+sLanguageID); - var rsExhibitionList = FindAllByIDsAsDictionary(sLanguageID).Values.ToList(); if (MainCategoryIDs.Count > 0) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs index b4fb110..e242e49 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/ExhibitionService.cs @@ -44,15 +44,12 @@ namespace EasyBL.WEBAPP.SYS } ExhibMaintain_QryService em_qry = new ExhibMaintain_QryService(); - var rsResult = em_qry.QueryShowStatusList(i_crm); - var rsStatusList = new List(); - - rsStatusList = StatusEntityToDTO(rsResult.DATA[BLWording.REL]); + var rsResult = em_qry.QueryShowStatusDic(sLanguageID).Values.ToList(); //返回token信息 srm = new SuccessResponseMessage(null, null); - srm.DATA.Add(BLWording.REL, rsStatusList); + srm.DATA.Add(BLWording.REL, rsResult); } while (false); }