Пример #1
0
        public ActionResult Create(AddFeedBackViewModel model)
        {
            if (ModelState.IsValid)
            {
                Feedback fb = new Feedback();
                Mapper.Map(model, fb);

                fb.Author = this.UserProfile;

                this.Data.Feedbacks.Add(fb);
                this.Data.SaveChanges();

                this.TempData["Notification"] = "Feedback successfully sent";
                return(this.Redirect("/"));
            }

            return(this.View(model));
        }
Пример #2
0
        public ActionResult Create(AddFeedBackViewModel model)
        {
            if (ModelState.IsValid)
            {
                Feedback fb = new Feedback();
                Mapper.Map(model, fb);

                fb.Author = this.UserProfile;

                this.Data.Feedbacks.Add(fb);
                this.Data.SaveChanges();

                this.TempData["Notification"] = "Feedback successfully sent";
                return this.Redirect("/");
            }

            return this.View(model);
        }