Exemple #1
0
    public static void nextStep()
    {
        Debug.Log("Next!");
        if (currentStepIndex == currentRecipe.Count - 1)
        {
            createNewRandomRecipe();
        }
        else
        {
            currentStepIndex++;
        }

        kitchenDisplay = FindObjectOfType <KitchenDisplay>();
        kitchenDisplay.UpdateRecipe();
        kitchenDisplay.UpdateScore();
    }
        public KitchenDisplay GetKitchenDisplay(DateTime TodayDate, int buildingid)
        {
            this.CheckAccess();
            DateTime       TodayDate1     = TodayDate.Date;// System.DateTime.Now.Date;
            KitchenDisplay kitchenDisplay = new KitchenDisplay();


            using (BraathenEiendomEntities entity = new BraathenEiendomEntities())
            {
                // Food Not Cleaned List
                List <FoodNotCleanedList> notcleanedList = new List <FoodNotCleanedList>();
                FoodNotCleanedList        notclean;
                var result = from ord in entity.BookingDetails
                             where ord.BuildingID == buildingid && DbFunctions.TruncateTime(ord.FromDate) == TodayDate1 && ord.IsClean == false && ord.IsDeliver == true && ord.BookingServiceLists.Count(s => s.IsKitchen == true) > 0
                             select ord;

                foreach (var item in result)
                {
                    notclean = new FoodNotCleanedList();
                    //string text = entity.BookingServiceLists.Where(w => w.BookingID == item.BookingID && w.IsMainService == true).Select(s => s.Tekst).FirstOrDefault();
                    string text = entity.Articles.Where(w => w.MainID == item.ServiceID && w.Status == 0).Select(s => s.Headline).FirstOrDefault();
                    notclean.OrderNo    = item.BookingID;
                    notclean.Text       = text + " " + item.BookingName;
                    notclean.Todate     = item.ToDate;
                    notclean.Fromdate   = item.FromDate;
                    notclean.NoOFPeople = item.NoOfPeople;
                    notcleanedList.Add(notclean);
                }
                kitchenDisplay.FoodNotCleanedList = notcleanedList;

                // Food Not Delivered List
                List <FoodNotDeliveredList> notdeliveredList = new List <FoodNotDeliveredList>();
                FoodNotDeliveredList        notdelivered;
                FoodList food;
                var      res = from ord in entity.BookingDetails
                               where ord.BuildingID == buildingid && DbFunctions.TruncateTime(ord.FromDate) == TodayDate1 && ord.IsClean == false && ord.IsDeliver == false && ord.BookingServiceLists.Count(s => s.IsKitchen == true) > 0
                               select ord;
                foreach (var item in res)
                {
                    notdelivered = new FoodNotDeliveredList();
                    List <FoodList> foodList = new List <FoodList>();
                    //string text = entity.BookingServiceLists.Where(w => w.BookingID == item.BookingID && w.IsMainService == true).Select(s => s.Tekst).FirstOrDefault();
                    string text = entity.Articles.Where(w => w.MainID == item.ServiceID && w.Status == 0).Select(s => s.Headline).FirstOrDefault();
                    notdelivered.OrderNo    = item.BookingID;
                    notdelivered.Text       = text + " " + item.BookingName;
                    notdelivered.Todate     = item.ToDate;
                    notdelivered.Fromdate   = item.FromDate;
                    notdelivered.NoOFPeople = item.NoOfPeople;

                    //// food list
                    var resfood = from ord in entity.BookingServiceLists
                                  where ord.BookingID == item.BookingID && ord.IsKitchen == true && ord.Status == false
                                  select ord;
                    bool isFoodservice = false;
                    foreach (var it in resfood)
                    {
                        food             = new FoodList();
                        food.Text        = it.Tekst;
                        food.Quantity    = it.Qty;
                        food.DeliverTime = it.Time;
                        foodList.Add(food);
                        isFoodservice = true;
                    }
                    if (isFoodservice)
                    {
                        notdelivered.FoodList = foodList;
                        notdeliveredList.Add(notdelivered);
                    }
                }
                kitchenDisplay.FoodNotDeliveredList = notdeliveredList;
            }
            return(kitchenDisplay);
        }