Ejemplo n.º 1
0
        public static int Insert(PublisherDto dto)
        {
            int id = PublisherDao.Insert(dto);

            dto.PublisherId = id;
            allNotDeletedPublishers.Add(dto);
            allNotDeletedPublishers = allNotDeletedPublishers.OrderByDescending(n => n.PublisherId).ToList();
            return(id);
        }
Ejemplo n.º 2
0
 public ActionResult Create(NhaXB tt)
 {
     if (ModelState.IsValid)
     {
         var  dao = new PublisherDao();
         long id  = dao.Insert(tt);
         if (id > 0)
         {
             SetAlert("Thêm nhà xuất bản thành công", "success");
             return(RedirectToAction("Index", "Publisher"));
         }
         else
         {
             ModelState.AddModelError("", "Thêm nhà xuất bản không thành công");
         }
     }
     return(View("Index"));
 }