Пример #1
0
    protected IEnumerator ArriveCafeteria(Cafeteria place)
    {
        UpdateHeader(" entering cafeteria");

        // Get food tray.
        yield return(StartCoroutine(GetTray(place)));

        yield return(StartCoroutine(WaitpointQueue(place.foodPoint)));

        place.foodPoint.IsBusy = false;

        // Find a vacant seat.
        Seat seat = FindRandomSeat(place);

        // Wander and wait if no seats are available.
        while (!seat)
        {
            UpdateHeader(" looking for seat");

            Vector2 circle = Random.insideUnitCircle;
            navMeshAgent.SetDestination(new Vector3(circle.x * 2 + transform.position.x, 0f, circle.y * 2 + transform.position.z));
            yield return(sec3);

            seat = FindSeat(place);
        }

        yield return(StartCoroutine(Sit(seat)));

        UpdateState(Patient.PatientState.sittingEating);
        UpdateHeader(" eating");

        isBusy = false;
    }
Пример #2
0
        public CafeteriaPage()
        {
            // instantiate our view model
            ViewModel = new CafeteriaViewModel();

            // bind our view model to our view
            BindingContext = ViewModel;

            InitializeComponent();


            lsvCafeterias.ItemTapped += async(sender, e) => {
                // get the tapped item
                Cafeteria selected = (Cafeteria)e.Item;

                // make sure it was casted right
                if (selected == null)
                {
                    return;
                }

                // navigate to our menu page with our selected cafeteria
                await Navigation.PushAsync(new CafeteriaMenuPage(selected));
            };
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Cafeteria cafeteria = db.Cafeteria.Find(id);

            db.Cafeteria.Remove(cafeteria);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #4
0
        //
        // GET: /Home/
        public ActionResult Index()
        {
            Cafeteria c = new Cafeteria();

            c.readXML();

            return View(c);
        }
        public void ServirCafe()
        {
            var espresso = new Cafeteria();

            espresso.Ligar();
            espresso.PrepararCafe();
            espresso.Desligar();
        }
Пример #6
0
// END CUT HERE
// BEGIN CUT HERE
    public static void Main()
    {
        try {
            Cafeteria ___test = new Cafeteria();
            ___test.run_test(-1);
        } catch (Exception e) {
//Console.WriteLine(e.StackTrace);
            Console.WriteLine(e.ToString());
        }
    }
Пример #7
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     Cafeteria ___test = new Cafeteria();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
 public ActionResult Edit([Bind(Include = "ID,Descripcion,Estado")] Cafeteria cafeteria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cafeteria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cafeteria));
 }
 public ActionResult Edit([Bind(Include = "ID,Descripcion,CampusId,Encargado,Estado")] Cafeteria cafeteria)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cafeteria).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CampusId = new SelectList(db.Campus, "ID", "Descripcion", cafeteria.CampusId);
     return(View(cafeteria));
 }
        public ActionResult Create([Bind(Include = "ID,Descripcion,Estado")] Cafeteria cafeteria)
        {
            if (ModelState.IsValid)
            {
                db.Cafeteria.Add(cafeteria);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cafeteria));
        }
Пример #11
0
    protected IEnumerator ExitCafeteria(Cafeteria place)
    {
        isBusy = true;
        UpdateHeader(" exiting cafeteria");
        yield return(StartCoroutine(Stand(false)));

        // Dropoff food tray.
        yield return(StartCoroutine(DropTray(place)));

        isBusy = false;
    }
Пример #12
0
    protected IEnumerator GetTray(Cafeteria cafeteria)
    {
        yield return(StartCoroutine(WaitpointQueue(cafeteria.trayPickup)));

        animator.SetLayerWeight(1, 1);
        animator.SetTrigger("UseHand");
        yield return(sec3);

        animator.SetLayerWeight(1, 0);

        cafeteria.trayPickup.IsBusy = false;
        hasTray = true;
    }
        // GET: Cafeteria/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Cafeteria cafeteria = db.Cafeteria.Find(id);

            if (cafeteria == null)
            {
                return(HttpNotFound());
            }
            return(View(cafeteria));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Cafeteria cafeteria = db.Cafeterias.Find(id);

            if (cafeteria == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CampusId = new SelectList(db.Campus, "ID", "Descripcion", cafeteria.CampusId);
            return(View(cafeteria));
        }
Пример #15
0
    protected IEnumerator DropTray(Cafeteria cafeteria)
    {
        yield return(StartCoroutine(Waitpoint(cafeteria.trayDropoff)));

        animator.SetLayerWeight(1, 1);
        animator.SetTrigger("DropoffTray");
        yield return(sec3);

        animator.SetLayerWeight(1, 0);

        cafeteria.trayDropoff.IsBusy = false;
        hasTray = true;
        isBusy  = false;
        SetIdle();
    }
Пример #16
0
        public CafeteriaMenuPage(Cafeteria cafeteria)
        {
            // set our Cafeteria Property to the selected cafeteria
            Cafeteria = cafeteria;

            // instantiate our service
            Service = new CafeteriaService();

            // call load to get the cafeteria information
            Load();

            // bind our cafeteria to our view
            BindingContext = Cafeteria;

            InitializeComponent();
        }
Пример #17
0
        public CafeTeria()
        {
            InitializeComponent();
            items       = new DatabaseClasses.Cafeteria_DataHelper();
            orders      = new List <Classes.Cafeteria>();
            myCafeteria = new Cafeteria(20, "Coffee", 5);
            phidget     = new phidget();

            try
            {
                phidget.OpenRFID();
                phidget.RFID.Tag += new RFIDTagEventHandler(AssignRFID);
                //   phidget.RFID.Tag += new RFIDTagEventHandler(RFIDTagNr);
                if (RFIDTagNr == null)
                {
                    MessageBox.Show("Please scan the rfid chip");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("There was an error opening the rfid reader.");
            }
        }
Пример #18
0
        public async Task <IActionResult> Create(cafeteriaViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            var user = await GetCurrentUserAsync();

            var cafeteria = new Cafeteria
            {
                Id          = viewModel.Id,
                EmployeeID  = viewModel.EmployeeID,
                Date        = viewModel.Date,
                Income      = viewModel.Income,
                Expenditure = viewModel.Expenditure
            };

            _context.Cafeteria.Add(cafeteria);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Пример #19
0
        public Cafeteria GetItemID(int ID)
        {
            //  String eventnr = Convert.ToString(ID);
            MySqlCommand command = new MySqlCommand("SELECT * FROM CAFETERIA WHERE ITEMNR=" + ID, connection);
            //    Visitor Visitor = null;
            Cafeteria cafe = null;

            try
            {
                connection.Open();
                MySqlDataReader r = command.ExecuteReader();

                r.Read();

                int     ITEMNR = Convert.ToInt32(r["ITEMNR"]);
                decimal price  = Convert.ToDecimal(r["PRICE"]);

                string Name = r["NAME"].ToString();

                int quantity = Convert.ToInt16(r["QUANTITY"]);

                //bool isCheckedIn;

                //if (r["ISCHECKEDIN"].ToString() == "NO")
                //{
                //    isCheckedIn = false;
                //}
                //else
                //{// YES
                //    isCheckedIn = true;
                //}


                //int spotID;
                //if (r["SPOTID"] == DBNull.Value)
                //{// in case there is no camping spot
                //    spotID = 0;
                //}
                //else
                //{// The participant/co-camper has a camping spot.
                //    spotID = Convert.ToInt32(r["SPOTID"]);
                //}
                //int boatid;
                //if (r["boatid"] == DBNull.Value)
                //{
                //    boatid = 0;
                //}
                //else
                //{
                //    boatid = Convert.ToInt32(r["boatid"]);
                //}


                return(cafe = new Cafeteria(ITEMNR, price, Name, quantity));
            }
            catch
            {
                MessageBox.Show("Error occurred.");
            }
            finally
            {
                connection.Close();
            }

            return(cafe); // no visitor found.
        }
Пример #20
0
    void CompileLists()
    {
        // Find all places and add them to correct list.
        foreach (var p in GameObject.FindGameObjectsWithTag("Place"))
        {
            switch (p.GetComponent <Place>().placeType)
            {
            case Place.PlaceType.hall:
                hall = p.GetComponent <Place>();
                break;

            case Place.PlaceType.cafeteria:
                cafeteria = p.GetComponent <Cafeteria>();
                break;

            case Place.PlaceType.kitchen:
                kitchen = p.GetComponent <Kitchen>();
                break;

            case Place.PlaceType.cell:
                cells.Add(p.GetComponent <Cell>());
                break;

            // Bathrooms.
            case Place.PlaceType.bathroomCentre:
                bathroomCentre = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                p.GetComponent <Place>().added = true;
                break;

            case Place.PlaceType.bathroomEast:
                bathroomEast = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                break;

            case Place.PlaceType.bathroomWest:
                bathroomWest = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                break;

            case Place.PlaceType.shower:
                showerRooms.Add(p.GetComponent <Place>());
                break;

            // Therapy Rooms
            case Place.PlaceType.therapy1:
                therapy1 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy2:
                therapy2 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy3:
                therapy3 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy4:
                therapy4 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy5:
                therapy5 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy6:
                therapy6 = p.GetComponent <Therapy>();
                break;

            // Other rooms.
            case Place.PlaceType.dayRoom:
                dayRoom = p.GetComponent <DayRoom>();
                break;

            // Staff
            case Place.PlaceType.pharmacy:
                pharmacy = p.GetComponent <Pharmacy>();
                break;

            case Place.PlaceType.records:
                records = p.GetComponent <Records>();
                break;

            case Place.PlaceType.office:
                office = p.GetComponent <Office>();
                break;

            case Place.PlaceType.staffRoom:
                staffroom = p.GetComponent <StaffRoom>();
                break;

            case Place.PlaceType.staffQuarters:
                staffquarters = p.GetComponent <StaffQuarters>();
                break;

            default:
                break;
            }
            p.GetComponent <Place>().added = true;
        }
    }