public string GetDay([FromBody] string date) { var requestedDate = DateTime.Parse(date); Day day = _dayRepository.GetDay(requestedDate); return(JsonConvert.SerializeObject(day)); }
/// <summary> /// Просчитать остаток за день /// </summary> /// <param name="date"></param> /// <returns></returns> public decimal CountForDay(DateTime date) { var day = _repo.GetDay(date); if (day == null) { return(0); } return(day.PurchaseList.Sum(w => w.Price * w.Count)); }
public ActionResult OrderPage(int Id) { DinnerOrder dinnerOrder = new DinnerOrder(); List <Day> days = new List <Day>(); Restaurant restaurant = restaurantRepository.GetRestaurant(Id); List <DinnerSession> dinnerSessions = dinnerSessionRepository.GetAllDinnerSessionsByRestaurantId(Id).ToList(); //filter all days from dinnerSessions per restaurant so only new days are add to days list foreach (DinnerSession dinnerSession in dinnerSessions) { if (!days.Contains(dayRepository.GetDay(dinnerSession.DayId))) { days.Add(dayRepository.GetDay(dinnerSession.DayId)); } } dinnerOrder.days = days; dinnerOrder.restaurant = restaurant; dinnerOrder.timeslot = retrieveStarttimes(Id, false).startTimeSession.ToList(); return(View(dinnerOrder)); }
//Nadat op de index op een dag is geklikt kom die hier binnen en wordt voor die dag een festivalDay gemaakt public ActionResult ConcertOverview(int dayId) { Day day = dayRepository.GetDay(dayId); return(View(concertRepository.CreateFestivalDay(day))); }