示例#1
0
        public ActionResult Edit(ImpostoVIewModel Imposto)
        {
            if (ModelState.IsValid)
            {
                var ImpostoDomain = Mapper.Map <ImpostoVIewModel, Imposto>(Imposto);
                _impostoApp.Update(ImpostoDomain);

                return(RedirectToAction("Index"));
            }

            return(View(Imposto));
        }
示例#2
0
        public ActionResult Create(ImpostoVIewModel Imposto)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    var ImpostoDomain = Mapper.Map <ImpostoVIewModel, Imposto>(Imposto);
                    _impostoApp.Add(ImpostoDomain);

                    return(RedirectToAction("Index"));
                }

                return(View(Imposto));
            }
            catch
            {
                return(View());
            }
        }