public async Task <ActionResult> Save(Guid id, Guid declaracionID) { if (id == null) { return(View(new DeudaBancariaModel())); } var deuda = await _getDeudasBancariasUserCase.Execute(id); if (deuda == null) { return(View(new DeudaBancariaModel { ID = Guid.Empty, DeclaracionID = declaracionID, InstitucionFinanciera = String.Empty, Tipo = String.Empty, TiposDeDeuda = DeudaBancariaModel.GetTiposDeuda(), Monto = 0 } )); } var modelView = Mapper.Map <DeudaBancariaOutput, DeudaBancariaModel>(deuda); return(PartialView(modelView)); }
public async Task <ActionResult> Save(DeudaBancariaModel deuda) { try { var deudaOutput = await _saveDeudasBancariasUserCase.Execute(deuda.ID, deuda.DeclaracionID, deuda.InstitucionFinanciera, deuda.Monto, deuda.Tipo); return(Json(new { success = true, message = "Actualizado correctamente" }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public static void Configure() { Mapper.Initialize(x => { x.CreateMap <DepositoOutput, DepositoModel>() .ForMember(destination => destination.TiposDeCuenta, source => source.MapFrom(list => DepositoModel.GetTipoDeCuenta())); x.CreateMap <InmuebleOutput, InmuebleModel>() .ForMember(destination => destination.TiposDeInmuebles, source => source.MapFrom(list => InmuebleModel.GetTiposDeInmuebles())); x.CreateMap <DeudaBancariaOutput, DeudaBancariaModel>() .ForMember(destination => destination.TiposDeDeuda, source => source.MapFrom(list => DeudaBancariaModel.GetTiposDeuda())); }); }