Exemple #1
0
        private async void SendGroupCommand(int delay = 0)
        {
            lastCommand = DateTime.Now;
            await Task.Delay(delay);

            if (delay == 0 || DateTime.Now - lastCommand >= new TimeSpan(0, 0, 0, 0, delay))
            {
                IsLoading = true;
                var appliance = Appliances.FirstOrDefault() as Light;
                if (appliance != null)
                {
                    try
                    {
                        var client = new HueClient(appliance.HueUser);
                        await client.SendCommandAsync(HueGroup);
                    }
                    catch (Exception ex)
                    {
                        DebugHelper.Debugger.WriteErrorLog("Error occurred while sending group command.", ex);
                        await new MessageDialog("Error occurred while sending group command: " + ex.Message).ShowAsync();
                    }
                }
                IsLoading = false;
            }
        }
        public async void OnSaveAppliances(object sender, EventArgs e)
        {
            try

            {
                IUserDialogs Dialogs = UserDialogs.Instance;
                Dialogs.ShowLoading("Saving...");
                await Task.Delay(2000);

                Repository repository = new Repository();
                Dialogs.HideLoading();

                Appliances appliances = new Appliances();
                appliances.PropertyAsset = new PropertyAsset();


                appliances.IDPropertyAsset = int.Parse(App.Current.Properties["PropertyId"].ToString());

                appliances.Brand               = brandidea.Text;
                appliances.Warranty            = warrantyidea.Text;
                appliances.Description         = descripctionidea.Text;
                appliances.Comments            = commentsidea.Text;
                appliances.FFile               = fileNameIdea;
                appliances.IDUSERPropertyAsset = int.Parse(App.Current.Properties["UsersId"].ToString());
                repository.PostAppliances(appliances);

                await DisplayAlert("Appliances", "The Appliance:  " + brandidea.Text + "  is saved ", "OK");

                GoToPage();
            }
            catch (Exception ex)
            {
                await DisplayAlert("Appliances", ex.Message, "OK");
            }
        }
Exemple #3
0
        public void PostAppliances(Appliances appliances)
        {
            System.Net.Http.HttpResponseMessage response = null;
            using (var Client = new System.Net.Http.HttpClient())
            {
                try
                {
                    var JSON      = Newtonsoft.Json.JsonConvert.SerializeObject(appliances);
                    var content   = new StringContent(JSON, Encoding.UTF8, "text/json");
                    var URLWebAPI = "http://50.73.94.149/wsMaterialHouse/api/Appliances";
                    response = Client.PostAsync(URLWebAPI, content).Result;

                    //Debug.WriteLine(response.StatusCode);

                    //if (response.StatusCode != System.Net.HttpStatusCode.OK)
                    //{
                    //    throw new Exception();
                    //}
                }
                catch (Exception e)
                {
                    throw e;
                }
            }
        }
Exemple #4
0
 public void toStockUp(Store store, Appliances appliance)
 {
     //   Thread.Sleep(_deliverySpeed);
     store.EventStore += () => Console.WriteLine($"TO STOCK UP IN STORE| {appliance}");
     store.Appliances.Add(appliance);
     store.EventStore -= () => { };
 }
        private async void RunCreateApplianceDialog()
        {
            var       customDialog    = new CustomDialog();
            Appliance newAppliance    = new Appliance();
            var       dialogViewModel = new CreateApplianceDialogViewModel(newAppliance, true,
                                                                           closeHandler => _dialogCoordinator.HideMetroDialogAsync(this, customDialog), async completionHandler =>
            {
                newAppliance = completionHandler.NewAppliance;
                // Save to database
                using (var ctx = new AssistantContext())
                {
                    newAppliance.CreationDate = DateTime.Now;
                    ctx.Appliances.Add(newAppliance);
                    ctx.SaveChanges();
                }

                // Add to local list
                Appliances.Add(newAppliance);

                await _dialogCoordinator.HideMetroDialogAsync(this, customDialog);
                await _dialogCoordinator.ShowMessageAsync(this, "Succes", $"Komponentet {newAppliance.Name} blev gemt.");
            });

            customDialog.Content = new CreateApplianceDialogView {
                DataContext = dialogViewModel
            };

            await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog);
        }
        /// <summary>
        /// Drops an appliance from the database and removes it from the displayed list in the UI
        /// </summary>
        /// <param name="appliance"></param>
        private async void DropAppliance(Appliance appliance)
        {
            // Check if the appliance is used in any packaged solutions
            using (var ctx = new AssistantContext())
            {
                var conflictingSolutions = ctx.PackagedSolutions.Include(a => a.ApplianceInstances)
                                           .Where(s => s.ApplianceInstances.Any(a => a.Appliance.Id == appliance.Id))
                                           .ToList();
                if (conflictingSolutions.Count > 0)
                {
                    var formattedSolutionString = string.Join("\n", conflictingSolutions.Select(x => $"- {x.Name}"));
                    await _dialogCoordinator.ShowMessageAsync(this, "Fejl",
                                                              $"Komponentet kan ikke slettes, da det findes i følgende pakkeløsninger:\n{formattedSolutionString}");

                    return;
                }
            }

            // Remove from current solution
            foreach (var existingAppliance in AppliancesInPackagedSolution.Where(a => a.Appliance == appliance))
            {
                AppliancesInPackagedSolution.Remove(existingAppliance);
            }

            // Remove from visual list of appliances
            Appliances.Remove(appliance);

            // Remove from database
            using (var ctx = new AssistantContext())
            {
                ctx.Entry(appliance).State = EntityState.Deleted;

                ctx.SaveChanges();
            }
        }
Exemple #7
0
        // old region
        //public IActionResult AddTransaction(int id)
        //{
        //    // When user hit on app icon,transaction table me request create hoge
        //    // chk current status of app from appliances table and prepare responce againts according to current tatus(Opposite)

        //    Transaction t1 = new Transaction();
        //    t1.Request = System.DateTime.Now;
        //    t1.AppId = id;
        //    t1.Day = DateTime.Now.DayOfWeek.ToString();

        //    Appliances app = new Appliances();
        //    app = lc.Appliances.Where(m => m.Id == id).SingleOrDefault();
        //    ViewBag.AppStatus = app.Status;
        //    string Action = "";
        //    if (app.Status != "ON")
        //    {
        //        Action = "1";
        //        t1.Action = "ON";
        //    }
        //    else
        //    {
        //        t1.Action = "OFF";
        //        Action = "0";
        //    }
        //    lc.Transaction.Add(t1);
        //    lc.SaveChanges();

        //    try
        //    {

        //        Uri myurl = new Uri("http://192.168.43.101/gpio" + id + "/" + Action);
        //        WebClient wcl = new WebClient();
        //        var content = wcl.DownloadString(myurl);
        //    }

        //    catch
        //    {
        //        return View();
        //    }

        //    return View();
        //}
        //public IActionResult DATAFORARD()
        //{
        //    //step 2 arduino hit this action


        //    //TRYCATCH
        //    Transaction obj = lc.Transaction.Where(u => u.Permission == null && u.Inspect == null).FirstOrDefault<Transaction>();
        //    Appliances appobj = lc.Appliances.Where(u => u.Id == obj.AppId).SingleOrDefault();

        //    obj.Permission = DateTime.Now.ToString();

        //    if (obj.Action == "OFF")
        //    {
        //        IList<Transaction> olist = lc.Transaction.Where(m => m.Action == "ON" && m.AppId == obj.AppId).OrderByDescending(m => m.Id).ToList();
        //        var obj2 = olist.FirstOrDefault();
        //        DateTime startTime= Convert.ToDateTime(obj.Request);
        //        DateTime EndTime = Convert.ToDateTime(obj2.Request);
        //        TimeSpan time =startTime-EndTime;
        //        obj.Timespan = Convert.ToDateTime(time);
        //    }


        //    if (appobj.Status != "ON")
        //    {
        //        appobj.Status = "ON";
        //    }
        //    else
        //    {
        //        appobj.Status = "OFF";
        //    }

        //    lc.Entry(appobj).State = EntityState.Modified;
        //    lc.Entry(obj).State = EntityState.Modified;
        //    lc.SaveChanges();
        //    return Json("Done");
        //}


        #endregion

        #region Arduino REquests
        // 2nd old region
        //public IActionResult AddTransaction(int id)
        //{
        //    // When user hit on app icon,transaction table me request create hoge
        //    // chk current status of app from appliances table and prepare responce againts according to current tatus(Opposite)

        //    Transaction t1 = new Transaction();
        //    t1.Request = System.DateTime.Now;
        //    t1.AppId = id;
        //    t1.Day = DateTime.Now.DayOfWeek.ToString();


        //    Appliances app = new Appliances();
        //    app = lc.Appliances.Where(m => m.Id == id).SingleOrDefault();
        //    ViewBag.AppStatus = app.Status;
        //    string Action = "";
        //    if (app.Status == "OFF")
        //    {
        //        Action = "1";
        //        t1.Action = "ON";
        //    }
        //    else
        //    {
        //        t1.Action = "OFF";
        //        Action = "0";
        //    }
        //    lc.Transaction.Add(t1);
        //    lc.SaveChanges();

        //    try
        //    {

        //        Uri myurl = new Uri("http://192.168.43.101/gpio" + id + "/" + Action);
        //        WebClient wcl = new WebClient();
        //        var content = wcl.DownloadString(myurl);
        //    }

        //    catch
        //    {
        //        return View();
        //    }

        //    return View();
        //}
        //public IActionResult DATAFORARD()
        //{
        //    //step 2 arduino hit this action


        //    //TRYCATCH
        //    Transaction obj = lc.Transaction.Where(u => u.Permission == null && u.Inspect == null).FirstOrDefault<Transaction>();
        //    Appliances appobj = lc.Appliances.Where(u => u.Id == obj.AppId).SingleOrDefault();

        //    obj.Permission = DateTime.Now.ToString();

        //    if (obj.Action == "OFF")
        //    {
        //        IList<Transaction> olist = lc.Transaction.Where(m => m.Action == "ON" && m.AppId == obj.AppId).OrderByDescending(m => m.Id).ToList();
        //        var obj2 = olist.FirstOrDefault();
        //        DateTime startTime = Convert.ToDateTime(obj2.Request);
        //        DateTime EndTime = Convert.ToDateTime(obj.Request);
        //        TimeSpan time = EndTime - startTime;

        //       // obj.Timespan = EndTime - startTime;
        //    }


        //    if (appobj.Status != "ON")
        //    {
        //        appobj.Status = "ON";
        //    }
        //    else
        //    {
        //        appobj.Status = "OFF";
        //    }

        //    lc.Entry(appobj).State = EntityState.Modified;
        //    lc.Entry(obj).State = EntityState.Modified;
        //    lc.SaveChanges();
        //    return Json("Done");
        //}


        #endregion



        #region Arduino REquests
        public IActionResult AddTransaction(int id)
        {
            // When user hit on app icon,transaction table me request create hoge
            // chk current status of app from appliances table and prepare responce againts according to current tatus(Opposite)
            if (HttpContext.Session.GetString("Id") != null)
            {
                Transaction t1 = new Transaction();
                t1.Request = System.DateTime.Now;
                t1.AppId   = id;
                t1.Day     = DateTime.Now.DayOfWeek.ToString();
                t1.user_id = HttpContext.Session.GetInt32("Id");
                Appliances app = new Appliances();
                app = lc.Appliances.Where(m => m.Id == id).SingleOrDefault();
                ViewBag.AppStatus = app.Status;
                string Action = "";
                if (app.Status == "OFF")
                {
                    Action    = "1";
                    t1.Action = "ON";
                }
                else
                {
                    t1.Action = "OFF";
                    Action    = "0";
                }
                lc.Transaction.Add(t1);
                lc.SaveChanges();

                try
                {
                    Uri       myurl   = new Uri("http://192.168.43.101/gpio" + id + "/" + Action);
                    WebClient wcl     = new WebClient();
                    var       content = wcl.DownloadString(myurl);
                }

                catch
                {
                    return(View());
                }

                return(View());
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }
        public void RestoreState(IStateSnippet savedState)
        {
            var state = (PlayerControllerStateSnippet)savedState;

            _warmthLevelTimeoutCounter  = state.WarmthLevelTimeoutCounter;
            _wetnessLevelTimeoutCounter = state.WetnessLevelTimeoutCounter;
            _warmthLerpTarget           = state.WarmthLerpTarget;
            _warmthLerpCounter          = state.WarmthLerpCounter;
            _warmthLerpBase             = state.WarmthLerpBase;
            _sleepingCounter            = state.SleepingCounter;
            _sleepDurationGameHours     = state.SleepDurationGameHours;
            _sleepHealthCheckPeriod     = state.SleepHealthCheckPeriod;
            _sleepHealthChecksLeft      = state.SleepHealthChecksLeft;
            _sleepStartTime             = state.SleepStartTime;
            _fatigueValueAfterSleep     = state.FatigueValueAfterSleep;

            _wetnessController.RestoreState((WetnessControllerSnippet)state.ChildStates["WetnessController"]);

            Clothes.Clear();

            foreach (var clothesItem in state.Clothes)
            {
                var newId = state.InventoryData.ItemsMapping.ContainsKey(clothesItem) ? state.InventoryData.ItemsMapping[clothesItem] : (Guid?)null;
                var item  = newId.HasValue ? _gc.Inventory.Items.FirstOrDefault(x => x.Id == newId.Value) : null;

                if (item as ClothesItemBase != null)
                {
                    Clothes.Add((ClothesItemBase)item);
                }
            }

            Appliances.Clear();

            foreach (var applianceItem in state.Appliances)
            {
                var newId = state.InventoryData.ItemsMapping.ContainsKey(applianceItem.ItemId) ? state.InventoryData.ItemsMapping[applianceItem.ItemId] : (Guid?)null;
                var item  = newId.HasValue ? _gc.Inventory.Items.FirstOrDefault(x => x.Id == newId.Value) : null;

                if (item as InventoryMedicalItemBase != null)
                {
                    Appliances.Add(new MedicalBodyAppliance {
                        BodyPart = applianceItem.BodyPart,
                        Item     = (InventoryMedicalItemBase)item
                    });
                }
            }
        }
Exemple #9
0
        public IActionResult Appliances(Appliances c, int rid, string appliances)
        {
            string id = HttpContext.Session.GetString("Id");

            var account = lc.Residents.Where(u => u.Id.ToString() == id).SingleOrDefault();



            if (account.Usertype == "Admin")
            {
                c.Name = appliances;

                var foo      = lc.Appliances.Where(v => v.Name == c.Name && v.RoomId == rid);
                var foocount = foo.Count();
                if (foocount == 0)
                {
                    lc.Appliances.Add(c);

                    lc.SaveChanges();

                    Room b_obj = lc.Room.Where(u => u.Id == rid).SingleOrDefault <Room>();
                    c.RoomId = b_obj.Id;


                    b_obj.NoOfAppliances++;


                    lc.SaveChanges();

                    ModelState.Clear();
                    TempData["messagesuc"] = "Successfully Saved";
                    return(RedirectToAction("Showrooms"));
                }

                else
                {
                    TempData["message"] = "Appliance already entered please select another one";

                    // System.Threading.Thread.Sleep(5000);
                    // System.Threading.Tasks.Task.Delay(3000).Wait();
                    return(RedirectToAction("Showrooms"));
                }
            }
            return(View());
        }
Exemple #10
0
 public IActionResult Deleteapp(int id)
 {
     if (HttpContext.Session.GetString("Id") != null)
     {
         Appliances obj = lc.Appliances.Where(s => s.Id == id).SingleOrDefault();
         lc.Appliances.Remove(obj);
         lc.SaveChanges();
         Room objr = lc.Room.Where(s => s.Id == obj.RoomId).SingleOrDefault();
         objr.NoOfAppliances--;
         lc.SaveChanges();
         TempData["del"] = "Successfully deleted";
         return(RedirectToAction("Showrooms"));
     }
     else
     {
         RedirectToAction("Login");
     }
     return(View());
 }
Exemple #11
0
 public House()
 {
     Appliances.Add(new WashingMachine()
     {
         Name = "Clothes Washer",
         Description = "A middle of the range LG washer.",
         Power = 500.0f,
         UsePerYear = 52.0f,
         StarRating = 1.0f
     });
     Appliances.Add(new Television()
     {
         Name = "Television",
         Description = "42inch Samsung television.",
         Power = 58.0f,
         UsePerYear = 2*200.0f,
         StarRating = 1.0f
     });
 }
Exemple #12
0
        static void Main(string[] args)
        {
            Boat boat1 = new Boat(2, 500, "White and yellow", 70.0d, .78d);

            boat1.Move();
            boat1.Move();
            Console.WriteLine("Boat" + boat1.GetDistanceTraveled());


            Automobile car1 = new Automobile(4, 20, 4, 5, 5000, "red", 260);

            car1.Move();
            car1.Color = "gold";
            Console.WriteLine("Automobile " + car1.GetDistanceTraveled());

            Aircraft plane1 = new Aircraft(100, 1000000, "yellow", 600);

            plane1.Move();
            Console.WriteLine("Aircraft " + plane1.GetDistanceTraveled());

            Appliances stove = new Appliances();
        }
Exemple #13
0
        public IActionResult DATAFORARD()
        {
            //step 2 arduino hit this action


            //TRYCATCH
            Transaction obj    = lc.Transaction.Where(u => u.Permission == null && u.Inspect == null).FirstOrDefault <Transaction>();
            Appliances  appobj = lc.Appliances.Where(u => u.Id == obj.AppId).SingleOrDefault();

            obj.Permission = DateTime.Now.ToString();

            if (obj.Action == "OFF")
            {
                IList <Transaction> olist = lc.Transaction.Where(m => m.Action == "ON" && m.AppId == obj.AppId).OrderByDescending(m => m.Id).ToList();
                var      obj2             = olist.FirstOrDefault();
                DateTime startTime        = Convert.ToDateTime(obj2.Request);
                DateTime EndTime          = Convert.ToDateTime(obj.Request);
                TimeSpan time             = EndTime - startTime;
                obj.Timespan = Convert.ToDateTime(time.Seconds);
                // obj.Timespan = EndTime-startTime;
            }


            if (appobj.Status != "ON")
            {
                appobj.Status = "ON";
            }
            else
            {
                appobj.Status = "OFF";
            }

            lc.Entry(appobj).State = EntityState.Modified;
            lc.Entry(obj).State    = EntityState.Modified;
            lc.SaveChanges();
            return(Json("Done"));
        }
Exemple #14
0
        public void ApplianceProductCatalogTests()
        {
            Product product = new Toy();

            product.Name  = "Barbie1";
            product.Count = 10;
            product.Price = 9999;
            product.Unit  = "Шт";
            productTestCatalog.Add(product);

            Product productNew3 = new Appliances();

            productNew3.Name  = "Samsung";
            productNew3.Count = 20;
            productNew3.Price = 30000;
            productNew3.Unit  = "Шт";
            productTestCatalog.Add(productNew3);

            ///Проверка GetProducts
            var products = productTestCatalog.GetProducts();

            Assert.AreEqual(products.Count, 2);
            Assert.AreEqual(products[0].Name, "Barbie1");
        }
Exemple #15
0
        private async void SendSceneCommand()
        {
            if (SelectedHueScene != null)
            {
                IsLoading = true;
                var appliance = Appliances.FirstOrDefault() as Light;
                if (appliance != null && SelectedHueScene != null)
                {
                    try
                    {
                        var client = new HueClient(appliance.HueUser);
                        await client.SendCommandAsync(SelectedHueScene);

                        HueGroup = await client.GetHueGroupByIdAsync(HueGroup.Id);
                    }
                    catch (Exception ex)
                    {
                        DebugHelper.Debugger.WriteErrorLog("Error occurred while sending scene command.", ex);
                        await new MessageDialog("Error occurred while sending scene command: " + ex.Message).ShowAsync();
                    }
                }
                IsLoading = false;
            }
        }
Exemple #16
0
        public GameModule()
        {
            Get["/api/time"] = response => JsonConvert.SerializeObject(Game.Clock);

            Get["/api/start"] = response =>
            {
                Game.Clock.Begin();
                return("Clock started...");
            };

            Get["/api/stop"] = response =>
            {
                Game.Clock.Pause();
                return("Clock stopped...");
            };

            Get["/api/community"] = response =>
            {
                Game.Community = new Community(GameDefaults.NumberOfHouses, Game.Clock);
                return(Game.Community.AsJson());
            };

            Get["/api/consumption"] = response =>
            {
                if (Game.Community == null)
                {
                    return(HttpStatusCode.NotFound);
                }

                return(Game.Community.Usage.AsJson());
            };

            Get["/api/household/{id}"] = household =>
            {
                if (Game.Community == null)
                {
                    return(HttpStatusCode.NotFound);
                }

                var selectedHousehold = (Household)Game.Community.Households[household.id - 1];
                return(selectedHousehold.AsJson());
            };

            Post["/api/appliances"] = _ =>
            {
                var addingAppliance   = this.Bind <ApplianceDto>();
                var appliance         = new Appliances(Game.Clock).MakeAppliance(addingAppliance.Type);
                var selectedHousehold = Game.Community.Households[addingAppliance.HouseholdIndex()];
                selectedHousehold.AddAppliance(appliance);
                return(appliance.AsJson());
            };

            Put["/api/appliances/{id}"] = appliance =>
            {
                foreach (var household in Game.Community.Households)
                {
                    household.SwitchOnOff(appliance.id);
                }
                return(HttpStatusCode.OK);
            };

            Delete["/api/appliances/{id}"] = appliance => {
                foreach (var household in Game.Community.Households)
                {
                    household.RemoveAppliance(appliance.id);
                }
                return(HttpStatusCode.OK);
            };
        }
 public DtoAppliances(Appliances appliances)
 {
     Count = appliances.Count;
     Price = appliances.Price;
     Date = appliances.Date.Day.ToString() + "." + appliances.Date.Month.ToString() + "." + appliances.Date.Year.ToString();
 }
 public void AddAppliances(Appliances appliances)
 {
     appliances.UserId = GetUserId();
     _service.AddAppliances(appliances);
 }
 public void AddAppliances(Appliances appliances)
 {
     _repository.Add(appliances);
 }
Exemple #20
0
        public static void ShowMenu()
        {
            string buf;
            bool   check = false;

            while (true)
            {
                PrintMenuTemplate();
                buf = Console.ReadLine();
                Console.Clear();
                switch (buf)
                {
                case "1":
                    int doorNum;
                    check = false;
                    Console.WriteLine("Please choose the (1)Rectangle or (2)Round doors: ");
                    while (!check)
                    {
                        if (int.TryParse(Console.ReadLine(), out doorNum))
                        {
                            switch (doorNum)
                            {
                            case 1:
                                CheckParams(out int heigth, out int width);
                                Console.WriteLine("Enter door model:");
                                Program.Doors.Add(new RectangleDoor(heigth, width, Console.ReadLine()));
                                check = true;
                                break;

                            case 2:
                                CheckParams(out int diametr);
                                Console.WriteLine("Enter door model:");
                                Program.Doors.Add(new RoundDoor(diametr, Console.ReadLine()));
                                check = true;
                                break;

                            default:
                                Console.WriteLine("Enter correct number!");
                                break;
                            }
                        }
                    }
                    break;

                case "2":
                    check = false;
                    while (!check)
                    {
                        Console.WriteLine("Please enter applience type(Fridge ,Cupboard ,Barrel , Ball ): ");
                        switch (Console.ReadLine().ToLower())
                        {
                        case "fridge":
                            CheckParams(out int frHeigth, out int frWidth, out int frLength);
                            Console.WriteLine("Enter item name:");
                            Appliances.Add(new Fridge(frHeigth, frWidth, frLength, Console.ReadLine()));
                            check = true;
                            break;

                        case "cupboard":
                            CheckParams(out int cbHeigth, out int cbWidth, out int cbLength);
                            Console.WriteLine("Enter item name:");
                            Appliances.Add(new Cupboard(cbHeigth, cbWidth, cbLength, Console.ReadLine()));
                            check = true;
                            break;

                        case "barrel":
                            CheckParams(out int brHeigth, out int brWidth);
                            Console.WriteLine("Enter item name:");
                            Appliances.Add(new Barrel(brHeigth, brWidth, Console.ReadLine()));
                            check = true;
                            break;

                        case "ball":
                            CheckParams(out int diametr);
                            Console.WriteLine("Enter item name:");
                            Appliances.Add(new Ball(diametr, Console.ReadLine()));
                            check = true;
                            break;

                        default:
                            Console.WriteLine("Wrong type, try again...");
                            break;
                        }
                    }
                    break;

                case "3":
                    foreach (Appliance item in Appliances)
                    {
                        foreach (Door door in Doors)
                        {
                            item.PrintStatus(item, door);
                        }
                    }
                    break;


                case "4":
                    Environment.Exit(0);
                    return;

                default:
                    Console.WriteLine("Please enter only existing menu option numbers!");
                    break;
                }
            }
        }