Exemple #1
0
        /// <summary>
        /// Gets list of regular accounts based on CustomerID
        /// </summary>
        /// <param name="searchCustomerID">Contains the Customer ID to search the accounts.</param>
        /// <returns>Returns the list of RegularAccount class objects where the Customer ID matches.</returns>
        public override List <GetRegularAccountsByCustomerID_Result> GetAccountsByCustomerIDDAL(Guid searchCustomerID)
        {
            using (TeamEEntities db = new TeamEEntities())
            {
                List <GetRegularAccountsByCustomerID_Result> RegularAccountsByCustomerID = db.GetRegularAccountsByCustomerID(searchCustomerID);

                return(RegularAccountsByCustomerID);
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets list of regular accounts based on Account Type
        /// </summary>
        /// <param name="searchAccountType">Contains the type of regular account(Savings or Current) to search the accounts.</param>
        /// <returns>Returns the list of RegularAccount class objects.</returns>
        public override List <GetRegularAccountsByAccountType_Result> GetAccountsByTypeDAL(string searchAccountType)
        {
            using (TeamEEntities db = new TeamEEntities())
            {
                List <GetRegularAccountsByAccountType_Result> AccountsByType = db.GetRegularAccountsByAccountType(searchAccountType);

                return(AccountsByType);
            }
        }
Exemple #3
0
        /// <summary>
        /// Gets list of regular accounts based on branch
        /// </summary>
        /// <param name="searchBranch">Contains the account in a particular branch.</param>
        /// <returns>Returns the list of Regular Account class objects.</returns>
        public override List <GetRegularAccountsByBranch_Result> GetAccountsByBranchDAL(string searchBranch)
        {
            using (TeamEEntities db = new TeamEEntities())
            {
                List <GetRegularAccountsByBranch_Result> AccountsByBranch = db.GetRegularAccountsByBranch(searchBranch);

                return(AccountsByBranch);
            }
        }
Exemple #4
0
        /// <summary>
        /// Gets regular account based on AccountNo
        /// </summary>
        /// <param name="searchAccountNo">Contains the account no to search the account.</param>
        /// <returns>returns the object of RegularAccount Class.</returns>
        public override GetRegularAccountByAccountNo_Result GetAccountByAccountNoDAL(string searchAccountNo)
        {
            //existingAccount = new RegularAccount();

            using (TeamEEntities db = new TeamEEntities())
            {
                GetRegularAccountByAccountNo_Result existingAccount = db.GetRegularAccountByAccountNo(searchAccountNo).FirstOrDefault();
                return(existingAccount);
            }
        }
Exemple #5
0
        /// <summary>
        /// Gets all regular accounts from the collection.
        /// </summary>
        /// <returns>Returns list of all accounts.</returns>
        public override List <GetAllRegularAccounts_Result> GetAllAccountsDAL()
        {
            using (TeamEEntities db = new TeamEEntities())
            {
                List <GetAllRegularAccounts_Result> AllRegularAccounts = db.GetAllRegularAccounts().ToList();
                //List<RegularAccount> AllRegularAccounts = (from a in db.RegularAccounts select a).ToList();

                return(AllRegularAccounts);
            }
        }
Exemple #6
0
        /// <summary>
        /// Gets list of regular accounts based on range of dates
        /// </summary>
        /// <param name="startDate">Contains the starting date.</param>
        /// <param name="endDate">Contains the ending date.</param>
        /// <returns>Returns the list of RegularAccount class objects.</returns>
        public override List <GetRegularAccountsByAccountOpeningDate_Result> GetAccountsByAccountOpeningDateDAL(DateTime startDate, DateTime endDate)
        {
            List <RegularAccount> AccountsByDate = new List <RegularAccount>();

            using (TeamEEntities db = new TeamEEntities())
            {
                List <GetRegularAccountsByAccountOpeningDate_Result> AccountsByDate = db.GetRegularAccountsByBranch(searchBranch);

                return(AccountsByDate);
            }
        }
Exemple #7
0
        /// <summary>
        /// Adds new account to Regular Accounts collection.
        /// </summary>
        /// <param name="newAccount">Contains the account details to be added.</param>
        /// <returns>Determinates whether the new account is added.</returns>
        public override bool CreateAccountDAL(RegularAccount newAccount)
        {
            using (TeamEEntities db = new TeamEEntities())
            {
                ObjectResult <CreateRegularAccount_Result> CreateRegularAccount = db.CreateRegularAccount(newAccount.CustomerID, newAccount.AccountType, newAccount.Branch, newAccount.MinimumBalance, newAccount.InterestRate);
                var result = CreateRegularAccount.FirstOrDefault();

                int v = result.Column1;
                newAccount.AccountNo = result.Column2;
            }

            return(true);
        }