public ActionResult DeleteConfirmed(int id) { AdminMarketsModel adminMarketsModel = db.GetMarkets().Where(m => m.Id == id).FirstOrDefault(); //db.DeleteMarket(adminMarketsModel); return(RedirectToAction("Index")); }
internal void UpdateMarket(AdminMarketsModel adminStockModel) { MarketService.UpdateMarket(new MarketModel() { Id = adminStockModel.Id, name = adminStockModel.name, work_hours = adminStockModel.work_hours }); }
internal void SaveNewMarket(AdminMarketsModel adminStockModel) { MarketService.CreateMarket(new MarketModel() { name = adminStockModel.name, work_hours = adminStockModel.work_hours }); }
public ActionResult Edit([Bind(Include = "Id,name,work_hours")] AdminMarketsModel adminMarketsModel) { if (ModelState.IsValid) { db.UpdateMarket(adminMarketsModel); return(RedirectToAction("Index")); } return(View(adminMarketsModel)); }
// GET: AdminMarkets/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AdminMarketsModel adminMarketsModel = db.GetMarkets().Where(m => m.Id == id).FirstOrDefault(); if (adminMarketsModel == null) { return(HttpNotFound()); } return(View(adminMarketsModel)); }
internal void DeleteMarket(AdminMarketsModel adminStockModel) { MarketService.DeleteMarket(adminStockModel.Id); }