public StatusResponse <APE.Cliente> Modificar(APE.Cliente entidad) { StatusResponse <APE.Cliente> statusResponse; try { this.clienteRepositorio.Actualizar(Mapper.Map <DAT.Cliente>(entidad)); statusResponse = new StatusResponse <APE.Cliente> { Success = true, Message = "Actualizado Satisfactoriamente." }; } catch (Exception e) { statusResponse = new StatusResponse <APE.Cliente> { Success = false, Message = "Error en actualización de registro." }; } return(statusResponse); }
public StatusResponse <APE.Cliente> Adicionar(APE.Cliente entidad) { StatusResponse <APE.Cliente> statusResponse; try { //se llama al metodo Insertar del repositorio var cliente = clienteRepositorio.Insertar(Mapper.Map <DAT.Cliente>(entidad)); //se commitean los cambios a traves del unit of work this.unitOfWork.Commit(); statusResponse = new StatusResponse <APE.Cliente> { Success = true, Message = "Adicionado Satisfactoriamente.", Data = Mapper.Map <APE.Cliente>(cliente) }; } catch (Exception e) { statusResponse = new StatusResponse <APE.Cliente> { Success = false, Message = "Error en adición de registro." }; } return(statusResponse); }