Ejemplo n.º 1
0
        public bool DeleteAccount(Account account)
        {
            try
            {
                AccountTable.DeleteOnSubmit(account);
                AccountTable.Context.SubmitChanges();

                return true;
            }
            catch
            {
                return false;
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 public List<Payment> GetPaymentsByAccount(Account account)
 {
     return PaymentTable.Where(x => x.AccountId == account.AccountId).ToList();
 }
Ejemplo n.º 4
0
        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;
            }
        }