public static void ChangeTheStatus() { Console.WriteLine("Enter ID of user:"******"Enter ID of order:"); int idOfOrder = ConsoleManager.ReadInt(); if (FindOrderByID(idOfOrder, AccountManager.FindUserById(choiceOfUser)) != null) { FindOrderByID(idOfOrder, AccountManager.FindUserById(choiceOfUser)).Status = ChoosenStatus(); } else { Console.WriteLine("There is no such order!"); Console.WriteLine("Please, type the enter to continue...)"); } } else { Console.WriteLine("There is no such user, \nplease, create it first!"); } }
public static void ChangeCommodityType(int commodityID) { Console.WriteLine("Enter a date of waaranty expiration (e.g. 10/22/2020): "); commodities[commodityID].Type = ConsoleManager.GetTheType(); Console.WriteLine("The time of expiration is changed to {0}", commodities[commodityID].Type); }
public static void AddCommodity() { (string name, double price, DateTime timeOfExpiration, CommodityTypes type) = ConsoleManager.TakeDataAboutCommodity(); CountID = commodities.Count; commodities.Add(new Commodity(CountID, name, price, timeOfExpiration, type)); }
public static int GetID(string typeOfEntity) { Console.WriteLine("Please type the Id of your {0}: ", typeOfEntity); return(ConsoleManager.ReadInt()); }
public static void CreateOrder() { Count++; CommodityManager.ShowCommodities(); var currentUser = AccountManager.CurrentUser as RegisteredUser; if (currentUser != null) { ((RegisteredUser)AccountManager.CurrentUser).orders.Add(new Order(Count, AccountManager.CurrentUser, CommodityManager.FindCommodityByID(ConsoleManager.GetID("commodity")), Statuses.New)); } else { ((Administrator)AccountManager.CurrentUser).orders.Add(new Order(Count, AccountManager.CurrentUser, CommodityManager.FindCommodityByID(ConsoleManager.GetID("commodity")), Statuses.New)); } Console.WriteLine("New order is created."); Console.WriteLine("Please, type enter to continue...)"); Console.ReadKey(); }