[HttpPost] //List PropertyList and Accommodation While Edit public ActionResult PropertyListAccommodationListByOfferId(Models.OfferModel data) { int type = 0; if (data.SearchValue > 0) { type = data.SearchValue; data.SearchValueForAccommodation = type; } else { type = data.SearchValueForAccommodation; } if (type == 1) { StayBazar.Areas.Admin.Models.OffersaveModel search = new StayBazar.Areas.Admin.Models.OffersaveModel(); List <CLayer.Accommodation> acc = BLayer.Offers.PropertyListAccommodationListByOfferId((int)CLayer.ObjectStatus.StatusType.Active, data.OfferId, data.SearchValueForAccommodation, 0, 25); ViewBag.Filter = new Models.OfferModel(); search.Accommodations = acc; Models.OfferModel forPager = new Models.OfferModel() { TotalRows = 0, Limit = 25, currentPage = 1 }; if (search.Accommodations.Count > 0) { search.Accommodation.TotalRows = acc[0].TotalRows; } ViewBag.Filter = forPager; return(PartialView("_AccommodationList", search)); } else { StayBazar.Areas.Admin.Models.OffersaveModel search = new StayBazar.Areas.Admin.Models.OffersaveModel(); List <CLayer.Accommodation> acc = BLayer.Offers.PropertyListAccommodationListByOfferId((int)CLayer.ObjectStatus.StatusType.Active, data.OfferId, data.SearchValueForAccommodation, 0, 25); ViewBag.Filter = new Models.OfferModel(); search.Accommodations = acc; Models.OfferModel forPager = new Models.OfferModel() { TotalRows = 0, Limit = 25, currentPage = 1 }; if (search.Accommodations.Count > 0) { search.Accommodation.TotalRows = acc[0].TotalRows; } ViewBag.Filter = forPager; return(PartialView("_PropertyList", search)); } }
[HttpPost] //search public ActionResult GetPropertiesList(Models.OfferModel data) { // if(data.SearchValueForProperty==0) StayBazar.Areas.Admin.Models.OffersaveModel search = new StayBazar.Areas.Admin.Models.OffersaveModel(); List <CLayer.Accommodation> acc = BLayer.Offers.GetProperties((int)CLayer.ObjectStatus.StatusType.Active, data.SearchString, data.SearchValueForProperty, 0, 25); ViewBag.Filter = new Models.OfferModel(); search.Accommodations = acc; Models.OfferModel forPager = new Models.OfferModel() { TotalRows = 0, Limit = 25, currentPage = 1 }; if (search.Accommodations.Count > 0) { search.Accommodation.TotalRows = acc[0].TotalRows; } ViewBag.Filter = forPager; return(PartialView("_PropertyList", search)); }