public ActionResult DeleteConfirmed(int id)
        {
            AdminMarketsModel adminMarketsModel = db.GetMarkets().Where(m => m.Id == id).FirstOrDefault();

            //db.DeleteMarket(adminMarketsModel);
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 internal void UpdateMarket(AdminMarketsModel adminStockModel)
 {
     MarketService.UpdateMarket(new MarketModel()
     {
         Id = adminStockModel.Id, name = adminStockModel.name, work_hours = adminStockModel.work_hours
     });
 }
Esempio n. 3
0
 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));
        }
Esempio n. 6
0
 internal void DeleteMarket(AdminMarketsModel adminStockModel)
 {
     MarketService.DeleteMarket(adminStockModel.Id);
 }