Browse Source

[WHAT] 展館管理Filter修正 [WHY] feature [HOW]

在查詢頁面的展館名稱搜尋框可以一次搜尋多個欄位:
展館名稱、展館英文名稱、展館簡稱
Dev
Janie 2 years ago
parent
commit
e9083078a3
  1. 10
      EuroTran/EasyBL.WEBAPP/ShowEasy/VenueMaintain_QryService.cs

10
EuroTran/EasyBL.WEBAPP/ShowEasy/VenueMaintain_QryService.cs

@ -39,8 +39,6 @@ namespace EasyBL.WEBAPP.SYS
var iCityID = _fetchInt(i_crm, @"CityID");
var sVenueID = _fetchString(i_crm, @"VenueID");
var sVenueName = _fetchString(i_crm, @"VenueName");
var sVenueName_EN = _fetchString(i_crm, @"VenueName_EN");
var sVenueSlug = _fetchString(i_crm, @"VenueSlug");
var sEffective = _fetchString(i_crm, @"Effective");
var bExcel = _fetchBool(i_crm, @"Excel");
pml.DataList = db.Queryable<SETB_ORG_Venue, SETB_SYS_Region, SETB_SYS_Country, SETB_UTL_City>(
@ -48,14 +46,12 @@ namespace EasyBL.WEBAPP.SYS
JoinType.Left, t1.OrgID == t2.OrgID && t1.RegionID == t2.RegionID,
JoinType.Left, t1.OrgID == t2.OrgID && t1.CountryID == t3.CountryID,
JoinType.Left, t1.OrgID == t2.OrgID && t1.CityID == t4.CityID
})
.Where((t1, t2, t3, t4) => t1.OrgID == i_crm.ORIGID && t1.DelStatus != "Y" && t1.VenueID.Contains(sVenueID) && t1.VenueName.Contains(sVenueName) && sEffective.Contains(t1.Effective))
.Where((t1, t2, t3, t4) => t1.OrgID == i_crm.ORIGID && t1.DelStatus != "Y" && t1.VenueID.Contains(sVenueID) && sEffective.Contains(t1.Effective))
.WhereIF(iRegionID != -1, (t1, t2, t3, t4) => t1.RegionID == iRegionID)
.WhereIF(iCountryID != -1, (t1, t2, t3, t4) => t1.CountryID == iCountryID)
.WhereIF(iCityID != -1, (t1, t2, t3, t4) => t1.CityID == iCityID)
.WhereIF(!string.IsNullOrEmpty(sVenueName), (t1, t2, t3, t4) => (t1.VenueName + t1.VenueName_EN + t1.VenueSlug).Contains(sVenueName))
.Select((t1, t2, t3, t4) => new View_ORG_Venue
{
VenueID = SqlFunc.GetSelfAndAutoFill(t1.VenueID),
@ -67,7 +63,7 @@ namespace EasyBL.WEBAPP.SYS
.MergeTable()
.OrderBy(sSortField, sSortOrder)
.ToPageList(pml.PageIndex, bExcel ? 100000 : pml.PageSize, ref iPageCount);
Console.WriteLine(pml.DataList);
pml.Total = iPageCount;
rm = new SuccessResponseMessage(null, i_crm);
if (bExcel)

Loading…
Cancel
Save