static void Main(string[] args) { Item item = new Item(); ItemManagement itemManagement = new ItemManagement(); do { item.display(); Console.WriteLine("Enter your choice:"); string yourChoice = Console.ReadLine(); switch (yourChoice) { case "1": itemManagement.addItem(); break; case "2": itemManagement.update(); break; case "3": itemManagement.delete(); break; case "4": //search item by code itemManagement.search(); break; case "5": //display item itemManagement.showAll(); break; case "6": //quit System.Environment.Exit(1); Console.WriteLine("GoodBye!!!!"); break; } } while (true); }
public async Task <IActionResult> AddItemStocks(AddItemStockViewModel itemModel) { if (HttpContext.Session.GetString("Id") == null) { HttpContext.Session.Clear(); return(RedirectToAction("Index", "Account")); } if (ModelState.IsValid) { ItemManagement i = new ItemManagement(db); await i.addItem(itemModel, Convert.ToInt32(HttpContext.Session.GetString("WorksAt"))); TempData["ItemMsg"] = "success"; return(RedirectToAction("AddItemStock")); } else { return(RedirectToAction("AddItemStock", itemModel)); } }