コード例 #1
0
        public ActionResult Editar(int _id)
        {
            PersonaDomainModel personaDM = IpersonaBusiness.GetPersonaById(_id);

            if (personaDM != null)
            {
                PersonaVM personaVM = new PersonaVM();
                AutoMapper.Mapper.Map(personaDM, personaVM);
                TelefonoVM telefonoVM = new TelefonoVM();
                AutoMapper.Mapper.Map(personaDM.TelefonoDomainModel, telefonoVM);
                personaVM.TelefonoVM = telefonoVM;
                return(View("Editar", personaVM));
            }
            return(RedirectToAction("InternalServerError", "Error"));
        }
コード例 #2
0
 public ActionResult Editar(int _id)
 {
     if (User.Identity.IsAuthenticated)
     {
         PersonaDomainModel personaDM = IpersonaBusiness.GetPersonaById(_id);
         if (personaDM != null)
         {
             PersonaVM personaVM = new PersonaVM();
             AutoMapper.Mapper.Map(personaDM, personaVM);
             TelefonoVM telefonoVM = new TelefonoVM();
             AutoMapper.Mapper.Map(personaDM.TelefonoDomainModel, telefonoVM);
             personaVM.TelefonoVM = telefonoVM;
             return(View("Editar", personaVM));
         }
         else
         {
             return(RedirectToAction("InternalServerError", "Error"));
         }
     }
     return(RedirectToAction("Login", "Account"));
 }