public long UpdatePassword(UserModel model) { long res = 0; // Declare new DataAccess object UserDa dataAccess = new UserDa(); using (var transaction = new TransactionScope()) { TblUser entity = new TblUser(); entity.ID = model.ID; entity.Password = SafePassword.GetSaltedPassword(model.NEW_PASSWORD); res = dataAccess.UpdatePassword(entity); if (res <= 0) { transaction.Dispose(); } transaction.Complete(); } return(res); }