public async Task <IActionResult> OnGet() { orderTotalDetails = new List <OrderTotalDetails>(); searchTypeViewModel = new SearchTypeViewModel(); ClaimsIdentity claimIdentity = (ClaimsIdentity)this.User.Identity; Claim claim = claimIdentity.FindFirst(ClaimTypes.NameIdentifier); string userId = claim.Value; var orderHeaderList = await _db.OrderHeader .Where(odl => odl.Status == SD.StatusPickUpReady) .OrderByDescending(hl => hl.OrderDate) .ToListAsync(); foreach (var oh in orderHeaderList) { List <OrderDetails> orderDetails = _db.OrderDetails .Where(od => od.OrderId == oh.Id) .ToList(); orderTotalDetails.Add(new OrderTotalDetails() { orderDetailsList = orderDetails, orderHeader = oh }); } return(Page()); }
public IActionResult SearchRestaurantsByType() { PopulateDropDownList(); SearchTypeViewModel TypeModel = new SearchTypeViewModel(); return(View(TypeModel)); }
public IActionResult SearchRestaurantsByType(SearchTypeViewModel Model) { PopulateDropDownList(); Model = RestRepoInterface.SearchRestaurantsByType(Model); return(View(Model)); }
public SearchTypeViewModel SearchRestaurantsByType(SearchTypeViewModel model) { List <Restaurant> RestList = database.Restaurants.Include(r => r.priceRange).Include(r => r.deliveryService).ToList <Restaurant>(); if (model.FoodTypeID != null) { RestList = RestList .Where(r => r.FoodTypeID == model.FoodTypeID).ToList <Restaurant>(); } if (model.PriceRangeID != null) { RestList = RestList .Where(v => v.priceRange.PriceRangeID == model.PriceRangeID).ToList <Restaurant>(); } model.RestList = RestList .ToList <Restaurant>(); return(model); }// end class