From 7681d3a5661196bf6eef827c83af712abce44d4a Mon Sep 17 00:00:00 2001 From: Janie <109517022+Janie06@users.noreply.github.com> Date: Wed, 29 Mar 2023 16:00:58 +0800 Subject: [PATCH] =?UTF-8?q?BookingCardList=20API=20=E5=A2=9E=E5=8A=A0servi?= =?UTF-8?q?ce=E6=98=AF=E5=90=A6=E7=82=BAnull=E5=88=A4=E6=96=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShowEasy/BookingMaintain_QryService.cs | 64 +++++++++++-------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_QryService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_QryService.cs index 3c75658..7a3f64c 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_QryService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/BookingMaintain_QryService.cs @@ -234,7 +234,6 @@ namespace EasyBL.WEBAPP.SYS sMsg = Util.GetLastExceptionMsg(ex); LogAndSendEmail(sMsg + "Params:" + JsonToString(i_crm), ex, i_crm.ORIGID, i_crm.USERID, nameof(BookingMaintain_QryService), "", "QueryPage 預訂管理(分頁查詢)", "", "", ""); - System.Diagnostics.Debug.WriteLine("預訂管理 sMsg" + ": " + sMsg); } @@ -734,7 +733,6 @@ namespace EasyBL.WEBAPP.SYS { var rsBookingDic = new Dictionary(); - var BookingDic = FindAllByIDsAsDictionary(sBookingID, sBookingNo, sAccount); MemberMaintain_QryService mm_qry = new MemberMaintain_QryService(); @@ -780,52 +778,63 @@ namespace EasyBL.WEBAPP.SYS if (!string.IsNullOrEmpty(Booking.ServiceID)) { - var Service = Booking.OnSiteService; - + var Service = Booking.OnSiteService; ////////////////////////////////////Service is null if (OnSiteServiceDic.ContainsKey(Booking.ServiceID)) { Service = OnSiteServiceDic[Booking.ServiceID]; + } - rsService.ServiceID = Service.ServiceID; - rsService.ServiceName = Service.ServiceName; - var ServiceLogoPath = AllFileDic.Values.Where(w => w.ParentID == Service.PreviewFile).Select(s => s.FilePath).FirstOrDefault(); - rsService.Logo = SEFileService.FilePathToURL(ServiceLogoPath); + if (Service != null) { + rsService.ServiceID = Service.ServiceID; + rsService.ServiceName = Service.ServiceName; + var ServiceLogoPath = AllFileDic.Values.Where(w => w.ParentID == Service.PreviewFile).Select(s => s.FilePath).FirstOrDefault(); + rsService.Logo = SEFileService.FilePathToURL(ServiceLogoPath); + } //rsService.BoothNo = ""; List SubCategoryIDs = new List(); + if (Service != null) + { + if (!string.IsNullOrEmpty(Service.SubCategoryID)) + { + SubCategoryIDs = JsonConvert.DeserializeObject>(Service.SubCategoryID); + } + rsService.SubCategoryIDs = SubCategoryIDs; - if (!string.IsNullOrEmpty(Service.SubCategoryID)) { - SubCategoryIDs = JsonConvert.DeserializeObject>(Service.SubCategoryID); } - - rsService.SubCategoryIDs = SubCategoryIDs; - + var rsSupplier = new View_SCM_Supplier(); - if (rsSupplierDic.ContainsKey(Service.SupplierID)) + if (Service != null) { - rsSupplier = rsSupplierDic[Service.SupplierID]; + if (rsSupplierDic.ContainsKey(Service.SupplierID)) + { + rsSupplier = rsSupplierDic[Service.SupplierID]; - ProviderDTO Provider = new ProviderDTO(); - Provider.ProviderID = rsSupplier.SupplierID; - Provider.ProviderName = rsSupplier.CompanyName; - Provider.ProviderStatus = Booking.SupplierStatus; + ProviderDTO Provider = new ProviderDTO(); + Provider.ProviderID = rsSupplier.SupplierID; + Provider.ProviderName = rsSupplier.CompanyName; + Provider.ProviderStatus = Booking.SupplierStatus; - var ProviderLogoPath = AllFileDic.Values.Where(w => w.ParentID == rsSupplier.LogoFile).Select(s => s.FilePath).FirstOrDefault(); - Provider.Logo = SEFileService.FilePathToURL(ProviderLogoPath); + var ProviderLogoPath = AllFileDic.Values.Where(w => w.ParentID == rsSupplier.LogoFile).Select(s => s.FilePath).FirstOrDefault(); + Provider.Logo = SEFileService.FilePathToURL(ProviderLogoPath); - rsService.Provider = Provider; + rsService.Provider = Provider; - } + } - rsService.ServiceStartDate = Booking.ServiceDateS; - rsService.ServiceEndDate = Booking.ServiceDateE; + rsService.ServiceStartDate = Booking.ServiceDateS; + rsService.ServiceEndDate = Booking.ServiceDateE; + rsBooking.CancellationPolicy = Service.CancelPolicy; - rsBooking.CancellationPolicy = Service.CancelPolicy; + } + + + rsBooking.OnSiteService = rsService; } - rsBooking.OnSiteService = rsService; + if (!string.IsNullOrEmpty(Booking.OrderQuestion)) { @@ -850,7 +859,6 @@ namespace EasyBL.WEBAPP.SYS rsMember.FirstName = Member.FirstName; rsMember.LastName = Member.LastName; rsMember.Email = Member.Email; - rsBooking.Member = rsMember; }