Exemple #1
0
 public ActionResult Edit(tblTINTUC tintuc)
 {
     if (ModelState.IsValid)
     {
         var dao    = new TinTucDAO();
         var result = dao.Update(tintuc);
         if (result)
         {
             return(RedirectToAction("Index", "TinTuc"));
         }
         else
         {
             ModelState.AddModelError("", "Sửa tin không thành công");
         }
     }
     return(View("Edit"));
 }
Exemple #2
0
        public ActionResult Edit(TINTUC tin)
        {
            if (ModelState.IsValid)
            {
                var dao = new TinTucDAO();

                tin.MODIFILEDBY = ((UserLogin)Session[CommonStants.USER_SESSION]).userName;
                var id = dao.Update(tin);
                if (id)
                {
                    SetAlert("Sửa thành công", "success");
                    return(RedirectToAction("Index", "tin"));
                }
                else
                {
                    SetAlert("Sửa không thành công", "danger");
                    ModelState.AddModelError("", "Cập nhật không thành Công!");
                }
            }
            return(View("Index"));
        }