public async Task <IActionResult> Edit(string id, [Bind("StreetAddress,Area,Thana,PostCode,District,Country,Phone,Website,Facebook,Email,ContactPerson,ContactPersonPhone,About,LogoURL,Remarks,ExpireDate,DeliveryCharge,RecieptName,ChalanName")] MyShop myShop) { if (id != myShop.StreetAddress) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(myShop); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MyShopExists(myShop.StreetAddress)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(myShop)); }
public ActionResult DeleteConfirmed(int id) { MyShop myShop = db.MyShops.Find(id); db.MyShops.Remove(myShop); db.SaveChanges(); return(RedirectToAction("Index")); }
/* * ======================================================================================== * Shop ---> Where the Hero can spend his/her gold to buy weapons/armor * ======================================================================================== */ public void Shop() { Console.Clear(); MyShop.OpenShopAndTakeUserOrder(); Console.Title = $"Main Menu"; }// End of the Shop Method
public ActionResult Edit([Bind(Include = "ID,Description,Floor")] MyShop myShop) { if (ModelState.IsValid) { db.Entry(myShop).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Floor = new SelectList(db.Floors, "ID", "Description", myShop.Floor); return(View(myShop)); }
public async Task <IActionResult> Create([Bind("StreetAddress,Area,Thana,PostCode,District,Country,Phone,Website,Facebook,Email,ContactPerson,ContactPersonPhone,About,LogoURL,Remarks,ExpireDate,DeliveryCharge,RecieptName,ChalanName")] MyShop myShop) { if (ModelState.IsValid) { _context.Add(myShop); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(myShop)); }
public ActionResult Create([Bind(Include = "ID,Description,Floor")] MyShop myShop) { if (ModelState.IsValid) { db.MyShops.Add(myShop); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Floor = new SelectList(db.Floors, "ID", "Description", myShop.Floor); return(View(myShop)); }
internal void AddShop() { MyBl.AddShop(MyShop); MyShop.UpdateLists(); shopAreaUC = new ShopAreaUC(MyShop.Id); profileBarUC = new ProfileBarUC(MyShop); ((MainWindow)System.Windows.Application.Current.MainWindow).mainVM.UpdateShop(MyShop); ((MainWindow)System.Windows.Application.Current.MainWindow).content_grid.Children.Clear(); ((MainWindow)System.Windows.Application.Current.MainWindow).inner_grid.Children.Clear(); ((MainWindow)System.Windows.Application.Current.MainWindow).content_grid.Children.Add(shopAreaUC); ((MainWindow)System.Windows.Application.Current.MainWindow).profile_grid.Children.Add(profileBarUC); }
// GET: MyShops/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MyShop myShop = db.MyShops.Find(id); if (myShop == null) { return(HttpNotFound()); } return(View(myShop)); }
// GET: MyShops/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MyShop myShop = db.MyShops.Find(id); if (myShop == null) { return(HttpNotFound()); } ViewBag.Floor = new SelectList(db.Floors, "ID", "Description", myShop.Floor); return(View(myShop)); }