Beispiel #1
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());
 }
Beispiel #2
0
        public ActionResult Create(ONhaXuatBan model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    nxbService.Add(model);
                    return(RedirectToAction("Search", "QuanLyNXB"));
                }
                catch (Exception e)
                {
                }
            }

            ViewBag.IsEdit = true;
            return(View("Update", model));
        }