Ejemplo n.º 1
0
 public ActionResult Update(NhaXuatBanViewModel model)
 {
     if (ModelState.IsValid)
     {
         var nxb = new NhaXuatBan();
         nxb.UpdateNhaXuatBan(model);
         _nhaXuatBanService.Update(nxb);
         context.SaveChanges();
         ViewData["successMsg"] = "Sua thành công";
     }
     return(View(model));
 }
Ejemplo n.º 2
0
 public ActionResult Add(NhaXuatBanViewModel model)
 {
     if (ModelState.IsValid)
     {
         model.CreateDate = DateTime.Now;
         var nxb = new NhaXuatBan();
         nxb.UpdateNhaXuatBan(model);
         _nhaXuatBanService.Add(nxb);
         context.SaveChanges();
         ViewData["successMsg"] = "Thêm thành công";
     }
     return(View());
 }