public JsonResult AjaxDelete(int id) { StockStatu stockStatu = db.StockStatus.Find(id); db.StockStatus.Remove(stockStatu); db.SaveChanges(); var message = $"Deleted {stockStatu.StockStatus} from the database"; return(Json(new { id = id, message = message })); }
public PartialViewResult StockStatusEdit(int id) { StockStatu stockStatu = db.StockStatus.Find(id); return(PartialView(stockStatu)); }
public JsonResult AjaxEdit(StockStatu stockStatu) { db.Entry(stockStatu).State = EntityState.Modified; db.SaveChanges(); return(Json(stockStatu)); }
public JsonResult AjaxCreate(StockStatu stockStatu) { db.StockStatus.Add(stockStatu); db.SaveChanges(); return(Json(stockStatu)); }