Exemplo n.º 1
0
        public ActionResult AddOrUpdate(int id = 0)
        {
            Mapper.Initialize(cfg => cfg.CreateMap <DBFirstDAL.FeedBackEmails, Entity.FeedBack>());
            var model =
                Mapper.Map <DBFirstDAL.FeedBackEmails, Entity.FeedBack>(feedBackEmailRepository.FindBy(i => i.Id == id).SingleOrDefault());

            if (model == null)
            {
                model = new Entity.FeedBack();
            }
            ViewBag.Title = "Редактирование Email";

            return(View(model));
        }
Exemplo n.º 2
0
 public ActionResult AddOrUpdate(Entity.FeedBack model)
 {
     feedBackEmailRepository.AddOrUpdate(model);
     return(RedirectToAction("Index"));
 }