public ActionResult CreateFeedBack(Feedback f)
 {
     try
     {
         if (Session["account"] == null)
         {
             f.AccountId = null;
         }
         else
         {
             var account = Session["account"] as AccountLogin;
             f.AccountId = account.AccountName;
             f.Time      = DateTime.Now;
             f.Email     = account.Email;
         }
         if (_feedback.AddFeedback(f) != null)
         {
             return(RedirectToAction("Index", "Home"));
         }
     }
     catch (Exception)
     {
         return(View("CreateFeedBack"));
     }
     return(View("CreateFeedBack"));
 }
 public ActionResult CreateFeedBack(Feedback f)
 {
     try
     {
         Account acc = _account.GetById(f.AccountId);
         if (acc == null)
         {
             f.AccountId = null;
         }
         f.Time = DateTime.Now;
         if (_feedback.AddFeedback(f) != null)
         {
             return(RedirectToAction("Index"));
         }
     }
     catch (Exception)
     {
         return(View("CreateFeedBack"));
     }
     return(View("CreateFeedBack"));
 }
Пример #3
0
 public Model.Users.Feedback AddFeedback(Feedback feedback)
 {
     return(feedbackService.AddFeedback(feedback));
 }