public bool DeleteAccount(Account account) { try { AccountTable.DeleteOnSubmit(account); AccountTable.Context.SubmitChanges(); return true; } catch { return false; } }
public bool SaveAccount(Account account) { try { if (account.AccountId == 0) { AccountTable.InsertOnSubmit(account); } else { AccountTable.Context.Refresh(RefreshMode.KeepCurrentValues, account); } AccountTable.Context.SubmitChanges(); return true; } catch { return false; } }
public List<Payment> GetPaymentsByAccount(Account account) { return PaymentTable.Where(x => x.AccountId == account.AccountId).ToList(); }
public bool SaveUserAccount(User user, Account.AccountTypeList accountType) { var account = new Account() { AccountType = accountType, AccountTypeId = (int)accountType, Active = true, CreatedDate = DateTime.Now, Credits = (user.UserType == User.UserTypeList.Admin) ? 9999 : 0, UserId = user.UserId }; try { return SqlAccountRepository.SaveAccount(account); } catch (Exception ex) { util.ErrorNotification(ex); throw; } }