/// <summary> /// Method that opens starting state of the menu /// </summary> public void OnStart() { long phone = validation.ValidatePhone("Hello, please enter your phone number in the format 1234567890"); _dogManager = _mBL.FindManager(phone); if (_dogManager == null) { string name = validation.ValidateName("Please enter your name in the format Firstname Lastname"); string address = validation.ValidateAddress("Please enter your address in the format CityName, ST"); _dogManager = new DogManager(phone, address, name); _mBL.AddManager(_dogManager); } bool repeat = true; do { Console.WriteLine("Welcome manager, please select an option from the list:"); Console.WriteLine("[0] Add a store"); Console.WriteLine("[1] Stock some shelves"); Console.WriteLine("[2] View a store's inventory"); Console.WriteLine("[3] View a store's order history"); Console.WriteLine("[4] View a list of managers"); Console.WriteLine("Enter anything else to return"); string input = Console.ReadLine(); switch (input) { case "0": _location = validation.ValidateString("Enter the store's name:"); _address = validation.ValidateAddress("Enter the store's address in format CityName, ST"); StoreLocation store = new StoreLocation(_address, _location); _storeLoBL.AddStoreLocation(store, _dogManager); break; case "1": StockShelves(); break; case "2": ViewStoreInv(); break; case "3": ViewOrders(); break; case "4": ViewManagers(); break; default: repeat = false; break; } }while(repeat); }
public ActionResult Create(ManagerCRVM newManager) { if (ModelState.IsValid) { try { _managerBL.AddManager(_mapper.cast2Manager(newManager)); //Helper.WriteInformation($"manager created-- Email: {newmanager.managerEmail}"); Log.Information($"Manager created-- Email: {newManager.ManagerEmail}"); return(Redirect("/Manager/Login")); } catch (Exception e) { Helper.WriteError(e, "Error"); Helper.WriteFatal(e, "Fatal"); Helper.WriteVerbose(e, "Verbose"); return(View()); } finally { } } return(View()); }
public void CreateManager() { _managerBL.AddManager(GetManagerDetails()); Console.WriteLine("Manager Successfully Created!"); Console.ReadLine(); }