Esempio n. 1
0
 public ActionResult SendAgain(Guid id)
 {
     if (id == Guid.Empty)
     {
         throw new HttpRequestValidationException();
     }
     try
     {
         SendMail model = _SendmailSvc.Getbykey(id);
         TryUpdateModel(model);
         if (ChangeStatusMail(model, "1") == true)
         {
             Messages.AddFlashMessage("Hệ thống đang gửi lại mail!");
             return(RedirectToAction("Index", new { EmailTo = model.Email }));
         }
         _SendmailSvc.Update(model);
         _SendmailSvc.CommitChanges();
         log.Info("SendAgain Email by: " + HttpContext.User.Identity.Name);
     }
     catch (Exception ex)
     {
         log.Error(" Index -" + ex);
         Messages.AddErrorFlashMessage("Có lỗi xảy ra, vui lòng thực hiện lại!");
     }
     return(RedirectToAction("Index"));
 }