public BarberShop Create(BarberShop model)
        {
            _ctx.BarberShops.Add(model);
            _ctx.SaveChanges();

            return(model);
        }
Пример #2
0
 public ReviewsM()
 {
     Reviews    = new ObservableCollection <ReviewItem>();
     barberShop = DataBaseConnector.GetBarberShop();
     LoadList();
     Info = "None";
 }
Пример #3
0
 void Start()
 {
     barbershopScript  = GameObject.Find("MainController").GetComponent <BarberShop>();
     barberChairScript = GameObject.Find("barberChair").GetComponent <Chair>();
     barberScript      = this.GetComponent <Barber>();
     toggleAwake       = GameObject.Find("ToggleAwake").GetComponent <Toggle>();
     sleep();
 }
Пример #4
0
        private static void SleepingBarber()
        {
            Console.WriteLine("--- Sleeping Barber ---");

            var barberShop = new BarberShop(3);

            barberShop.StartWork();
        }
Пример #5
0
        // Task 4: Sleeping Barber
        public static void RunTask4(int maxClientsCount)
        {
            var barberShop = new BarberShop(maxClientsCount);
            var barber     = new Barber(barberShop);
            var client     = new Client(barberShop);

            Task.WaitAll(barber.Run(), client.Run());
        }
Пример #6
0
    void Start()
    {
        barberShopScript   = GameObject.Find("MainController").GetComponent <BarberShop>();
        textCustomersValue = GameObject.Find("TextCustomersValue").GetComponent <Text>();

        for (int i = 0; i < totalNumberOfCustomers; i++)
        {
            Invoke("spawnCustomer", Random.Range(minSpawnTime, maxSpawnTime) * i);              // invoke a method after some random time
        }
    }
Пример #7
0
 private static void CustomerAsync(BarberShop bs)
 {
     bool a = false;
     int customer = -1;
     for (int i = 0; i < MaxCustomers; i++)
     {
         a = bs.waitOrLeave(i);
         customer = i;
         Thread.Sleep(6000);
     }
 }
        public BarberShop Update(BarberShop model)
        {
            var entity = _ctx.BarberShops.FirstOrDefault(x => x.Id == model.Id);

            entity.Name    = model.Name;
            entity.Address = model.Address;
            entity.City    = model.City;

            _ctx.SaveChanges();

            return(model);
        }
Пример #9
0
 void Start()
 {
     mainController   = GameObject.Find("MainController");
     barberShopScript = GetComponentInParent <BarberShop>();
     if (!mainController)
     {
         Debug.LogError("Object MainController not found!");
     }
     if (!barberShopScript)
     {
         Debug.LogError("BarberShop script not found in MainController");
     }
 }
Пример #10
0
 void Start()
 {
     barberShopScript = GameObject.Find("MainController").GetComponent <BarberShop>();
     rb2D             = GetComponent <Rigidbody2D>();
     reception        = GameObject.Find("MainController").transform.FindChild("WaypointReception");
     exit             = GameObject.Find("MainController").transform.FindChild("WaypointExit");
     if (!reception)
     {
         Debug.LogError("Waypoint Reception not found as a child of MainController");
     }
     if (!exit)
     {
         Debug.LogError("WaypointExit not found as a child of MainController");
     }
 }
Пример #11
0
        private static void BarberAsync(BarberShop bs)
        {
            while (true)
            {
                while (bs.waitForCustomerArrive())
                {
                    Console.WriteLine("a customer arrived");

                    bs.waitForCustomerInBarberChair();

                    bs.cutHair();

                    bs.doneCutting();
                }

            }
        }
Пример #12
0
        public BarberShopModel GetById(int id)
        {
            BarberShop model = _barberShopEFRepository.GetById(id);

            return(_mapper.Map <BarberShopModel>(model));
        }