public TransferModel TransferMoney(TransferModel deposit) { deposit.Date = DateTime.Now; deposit.Time = DateTime.Now.TimeOfDay; var newDeposit = _context.Transferencia.Add(_mapper.Map <Transferencium>(deposit)); _context.SaveChanges(); return(_mapper.Map <TransferModel>(newDeposit.Entity)); }
public UserModel EditProfile(UserModel profile) { var user = (from u in _context.Usuarios where u.IdUsuario == profile.Id select u).FirstOrDefault(); user.Mail = profile.Email; user.Contraseña = profile.Password; _context.SaveChanges(); return(_mapper.Map <UserModel>(user)); }
public bool AddMovement(MovementModel movement) { try { _context.MovimientosXusuarios.Add(_mapper.Map <MovimientosXusuario>(movement)); _context.SaveChanges(); } catch (Exception) { return(false); } return(true); }
public UserModel SignInUser(UserModel user) { var newUserDb = new Usuario(); newUserDb.Mail = user.Email; newUserDb.NombreUsuario = user.Firstname; newUserDb.Apellido = user.Lastname; newUserDb.Contraseña = user.Password; newUserDb.Cbu = "12345"; newUserDb.Dnidorsal = new byte[] { 255 }; newUserDb.Dnifrontal = new byte[] { 234 }; var newUser = _context.Usuarios.Add(newUserDb); _context.SaveChanges(); return(_mapper.Map <UserModel>(newUser.Entity)); }
public void CreateAccount(AccountModel account) { _context.Cuenta.Add(_mapper.Map <Cuentum>(account)); _context.SaveChanges(); }