public void Sale() { FindObjectOfType <Sound>().ButtonSound(); OrderSlot orderSlot = GameObject.Find("OrderContainer").GetComponent <OrderSlot>(); FindObjectOfType <OrderCheck>().CheckOnSale(); orderSlot.DeleteOrderItems(); FindObjectOfType <DialogManager>().Sale(); FindObjectOfType <OrderSlot>().SetLabel(); FindObjectOfType <CashCount>().Clear(); }
/* * public PickASlotTimeView(TimeSpan StartTime, TimeSpan StopTime) * { * //Creates a list of Times per 15 minutes steps. Starting from StartTime up to StopTime. * for (TimeSpan i=StartTime; i < StopTime; i = i + TimeSpan.FromMinutes(15)) * { * ListOfPossibleTimes.Add(new PossibleTime { Available = false, Id = i.Ticks.ToString(), TimeFrom = i }); * } * }*/ public void Add(OrderSlot SlotToAdd) { // The view should display the available slot times by step of 15 minutes. The slots should be grouped that way. DateTime roundedTime = RoundDown(SlotToAdd.OrderSlotTime, TimeSpan.FromMinutes(15)); if (ListOfPossibleTimes.FirstOrDefault(r => r.TimeFrom == roundedTime) == null) { ListOfPossibleTimes.Add(new PossibleTimeView { TimeFrom = roundedTime, TimeTo = roundedTime.AddMinutes(15), Available = true, Id = roundedTime.Ticks.ToString(), SlotGroup = SlotToAdd.SlotGroup }); } }
public async Task <IHttpActionResult> Get(int id) { OrderSlot orderSlot = await DbManager.OrderSlots.FirstOrDefaultAsync(o => o.OrderSlotId == 57); var userName = User.Identity.GetUserName(); var user = await UserManager.FindByNameAsync(userName); if (user == null) { return(BadRequest()); } // Check and creates the list of available slottimes // TODO: Current strategy is to create this list on request. See for optimization to schedule this list creation one time a day (off ressources- Resto resto = await DbManager.Restos.FirstOrDefaultAsync(r => r.Id == id); if (resto == null) { return(BadRequest()); } await new OrderHelper().CreateOrderSlotListForDay(id, DateTime.Today, DbManager); // Collect the available slot times. List <OrderSlot> availableOrderSlots = new List <OrderSlot>(); availableOrderSlots = resto.OrderIntakeSlots .Where(r => r.OrderSlotTime != null).ToList(); List <OrderSlotAPI> slotTimeAPI = new List <OrderSlotAPI>(); foreach (var item in resto.OrderIntakeSlots .Where(r => r.Order == null) // Check this slot time is free .Where(r => r.OrderSlotTime.CompareTo(DateTime.Now) > 0)) { slotTimeAPI.Add(new OrderSlotAPI { OrderSlotId = item.OrderSlotId, OrderSlotTime = item.OrderSlotTime, SlotGroup = item.SlotGroup }); } return(Ok(slotTimeAPI)); }