Ejemplo n.º 1
0
 public ActionResult Edit(Tag tag)
 {
     if (ModelState.IsValid)
     {
         var tagDao = new TagDAO();
         var res    = tagDao.Edit(tag);
         if (res)
         {
             SetAlert("Tag đã được cập nhật thành công", "success");
             return(RedirectToAction("Index", "Tag"));
         }
     }
     else
     {
         ModelState.AddModelError("", "Thông tin nhập vào không hợp lệ");
     }
     return(View());
 }
 public ActionResult Edit(Tag tag, int id)
 {
     tag.TagID = id;
     if (ModelState.IsValid)
     {
         TagDAO tagDAO = new TagDAO();
         var    check  = tagDAO.Edit(tag);
         if (check > 0)
         {
             TempData["msg"] = MessageBox.Show("Edit successfully");
             return(RedirectToAction("Index", "Tag", new { @page = prioripage }));
         }
         else
         {
             ModelState.AddModelError("", "Edit fail");
         }
     }
     return(View());
 }