예제 #1
0
        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
            }));
        }
예제 #2
0
        public PartialViewResult StockStatusEdit(int id)
        {
            StockStatu stockStatu = db.StockStatus.Find(id);

            return(PartialView(stockStatu));
        }
예제 #3
0
 public JsonResult AjaxEdit(StockStatu stockStatu)
 {
     db.Entry(stockStatu).State = EntityState.Modified;
     db.SaveChanges();
     return(Json(stockStatu));
 }
예제 #4
0
 public JsonResult AjaxCreate(StockStatu stockStatu)
 {
     db.StockStatus.Add(stockStatu);
     db.SaveChanges();
     return(Json(stockStatu));
 }