Example #1
0
        public JsonResult UpdateModel(int id, string ten, string hang, int stt)
        {
            var bonho = new Model.EF.Model();

            bonho.ID_Model = id;
            bonho.Ten      = ten;
            bonho.STT      = stt;
            bonho.IDHang   = Convert.ToInt32(hang);
            var result = new UpdateData().Models(bonho);

            return(Json(new
            {
                status = result
            }));
        }
Example #2
0
 public ActionResult Model(Admin.Models.ModelData model)
 {
     if (ModelState.IsValid)
     {
         var data = new Model.EF.Model();
         data.Ten    = model.Ten;
         data.IDHang = model.IDHang;
         bool check = new DataDao().Models(data);
         if (check)
         {
             SetAlert("thêm thành công", "success");
             return(RedirectToAction("Model", "Data"));
         }
         else
         {
             ModelState.AddModelError("", "Thêm không thành công");
         }
     }
     return(View("Model"));
 }