// GET: DashBoard/AccomodationType public ActionResult Index(string searchTerm, int?accomodationTypeID, int?page) { AccomodationPackagesListingViewModel model = new AccomodationPackagesListingViewModel(); //var dummyItems = Enumerable.Range(1, 150).Select(x => "Item " + x); //model.AccomodationPackages = accomodationPackageService.GetAllAccomodationPackages(); model.AccomodationPackages = accomodationPackageService.SearchAccomodationPackages(searchTerm, accomodationTypeID); model.totalRecord = model.AccomodationPackages.Count(); //pagination logic start from here var pager = new Pager(model.totalRecord, page); model.AccomodationPackages = model.AccomodationPackages.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(); model.SearchTerm = searchTerm; model.AccomodationTypes = accomodationTypesService.GetAllAccomodationTypes(); model.AccomodationTypeID = accomodationTypeID; model.pager = pager; return(View(model)); }
public ActionResult Listing() { AccomodationTypesListingModel model = new AccomodationTypesListingModel(); model.AccomodationTypes = accomodationTypesService.GetAllAccomodationTypes(); return(PartialView("_Listing", model)); }
public ActionResult Index(string searchTerm, int?accomodationTypeID, int?page) { int recordSize = 5; page = page ?? 1; AccomodationPackagesListingModel model = new AccomodationPackagesListingModel(); model.SearchTerm = searchTerm; model.AccomodationTypeID = accomodationTypeID; model.AccomodationTypes = accomodationTypesService.GetAllAccomodationTypes(); model.AccomodationPackages = accomodationPackagesService.SearchAccomodationPackages(searchTerm, accomodationTypeID, page.Value, recordSize); var totalRecords = accomodationPackagesService.SearchAccomodationPackagesCount(searchTerm, accomodationTypeID); model.Pager = new Pager(totalRecords, page, recordSize); return(View(model)); }
// GET: Accomodation public ActionResult Index(string searchTerm, int?typeid, int?packageid) { AccomodationViewModel model = new AccomodationViewModel(); model.AccomodationTypes = accomodationTypesService.GetAllAccomodationTypes(); model.AccomodationPackages = accomodationPackagesService.SearchAccomodationPackages(searchTerm, typeid); model.searchTerm = searchTerm; model.CurrentAccomodationType = typeid; model.CurrentAccomodationPackage = packageid; model.Accomodations = accomodationService.SearchAccomodations(searchTerm, typeid, packageid); model.Accomodations.DistinctBy(a => a.AccomodationPackage.Id); return(View(model)); }
public IActionResult Index() { HomeViewModel model = new HomeViewModel(); model.AccomodationTypes = accomodationTypesService.GetAllAccomodationTypes(); model.AccomodationPackages = accomodationPackagesService.GetAllAccomodationPackages(); return(View(model)); }
public ActionResult Index() { HomeViewModels model = new HomeViewModels(); AccomodationTypesService service = new AccomodationTypesService(); model.AccomodationTypes = service.GetAllAccomodationTypes(); return(View()); }
public ActionResult Index() { HomeViewModel model = new HomeViewModel(); //HMSContext context = new HMSContext(); //var a = context.AccomodationTypes.ToList(); model.AccomodationTypes = accomodationTypesService.GetAllAccomodationTypes().ToList(); return(View(model)); }
public ActionResult Index() { AccomodationTypesService accomoTypeService = new AccomodationTypesService(); AccomodationPackagesService accomodationPackagesService = new AccomodationPackagesService(); HomeViewModel model = new HomeViewModel(); model.accomodationTypes = accomoTypeService.GetAllAccomodationTypes(); model.accomodationPackages = accomodationPackagesService.GetAllAccomodationPackages(); return(View(model)); }
public IViewComponentResult Invoke() { var accomodation = _accomodationTypesService.GetAllAccomodationTypes(); return(View(accomodation)); }