public IActionResult AddFeedback(FeedbackViewModel feedbackViewModel) { if (!CharacterLength.CheckLength(feedbackViewModel.Message)) { ViewData["Limit"] = CharacterLength.LimitNumber; return(View("CharacterLimit")); } if (!EmailValidation.CheckEmail(feedbackViewModel.Email)) { ViewData["Limit"] = FeedbackNumberPerEmail.LimitNumber; return(View("InvalidMail")); } try { string email = _feedbackService.CreteFeedback(feedbackViewModel); if (email == null) { return(View("FeedbackNumber")); } return(RedirectToAction("LeaveFeedback")); } catch { return(View("ExceptionView")); } }
public IActionResult AddFeedback(FeedbackViewModel feedbackViewModel) { try { _feedbackService.CreteFeedback(feedbackViewModel); return(RedirectToAction("LeaveFeedback")); } catch (Exception ex) { ViewData["ErrMessage"] = ex.Message; return(View("ExceptionView")); } }