Пример #1
0
        public static void UpdateUserPassword(string UserId, string HashedPwd, int CustomerNumber)
        {
            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@UserId", SqlDbType.NVarChar, UserId);
            paramList.Add("@CustomerNumber", SqlDbType.Int, CustomerNumber);
            paramList.Add("@NewPassword", SqlDbType.NVarChar, HashedPwd);

            SqlTools.ExecuteNonQuery("dbo.User_ChangePassword", paramList);
        }
Пример #2
0
        public static int? ValidateUserCredentials(string UserId, string HashedPwd)
        {
            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@UserId", SqlDbType.NVarChar, UserId);
            paramList.Add("@HashedPwd", SqlDbType.NVarChar, HashedPwd);

            int? customerId = (int?)SqlTools.ExecuteScalar("dbo.User_Validate", paramList);

            return customerId;
        }
Пример #3
0
        public static Customer Update(Customer Cust)
        {
            SqlParamsColl paramList = new SqlParamsColl();

            paramList.Add("@CustomerId", SqlDbType.Int, Cust.Id);
            paramList.Add("@FirstName", SqlDbType.NVarChar, Cust.FirstName);
            paramList.Add("@LastName", SqlDbType.NVarChar, Cust.LastName);
            paramList.Add("@TFN", SqlDbType.NVarChar, Cust.TaxFileNumber);
            paramList.Add("@AddressStreet", SqlDbType.NVarChar, Cust.CustomerAddress.StreetDetail);
            paramList.Add("@AddressCity", SqlDbType.NVarChar, Cust.CustomerAddress.City);
            paramList.Add("@AddressState", SqlDbType.NVarChar, Cust.CustomerAddress.State);
            paramList.Add("@AddressZipCode", SqlDbType.NVarChar, Cust.CustomerAddress.ZipCode);
            paramList.Add("@PhoneNumber", SqlDbType.NVarChar, Cust.PhoneNumber);

            Customer updatedCustomer = new Customer();

            SqlTools.ExecuteReader("dbo.Customer_Update", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        PopulateObjectFromReader(reader, updatedCustomer);
                    }
                });
            return updatedCustomer;
        }
Пример #4
0
        public static void Update(Account acc)
        {
            SqlParamsColl paramList = new SqlParamsColl();

            paramList.Add("@AccountNumber", SqlDbType.Int, acc.AccountNumber);
            paramList.Add("AvailableBalance", SqlDbType.Money, acc.AvailableBalance);

            SqlTools.ExecuteReader("Account_Update", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        PopulateObjectFromReader(reader, acc);
                    }
                });
        }
Пример #5
0
        public static void CancelBPAYItem(int BPAYId)
        {
            SqlParamsColl paramList = new SqlParamsColl();

            paramList.Add("@BPAYId", SqlDbType.Int, BPAYId);

            SqlTools.ExecuteNonQuery("dbo.BillPay_Cancel", paramList);
        }
Пример #6
0
        public static void Insert_DepositTransaction(int AccountNumber, decimal Amount, string Comment)
        {
            decimal feeAmount = 0;

            try
            {
                feeAmount = Decimal.Parse(ConfigurationManager.AppSettings["Fee_ATMTransaction"]);
            }
            catch (FormatException) { }

            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@AccountNumber", SqlDbType.Int, AccountNumber);
            paramList.Add("@Amount", SqlDbType.Money, Amount);
            paramList.Add("@FeeAmount", SqlDbType.Money, feeAmount);
            if (Comment != null)
                paramList.Add("@Comment", SqlDbType.NVarChar, Comment);

            SqlTools.ExecuteNonQuery("dbo.Transaction_InsertDeposit", paramList);
        }
Пример #7
0
        public static TransactionList GetAccountTransactions(int AccountNumber)
        {
            TransactionList list = new TransactionList();
            SqlParamsColl paramList = new SqlParamsColl();
            decimal feeAmount = 0;

            try
            {
                feeAmount = Decimal.Parse(ConfigurationManager.AppSettings["Fee_TransactionHistory"]);
            }
            catch (FormatException) { }

            paramList.Add("@AccountNumber", SqlDbType.Int, AccountNumber);
            paramList.Add("@FeeAmount", SqlDbType.Money, feeAmount);
            SqlTools.ExecuteReader("Account_RetrieveTransactions", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        list.Add(PopulateObjectFromReader(reader));
                    }
                });
            return list;
        }
Пример #8
0
        public static BillPayItem LoadBillPayItem(int Id)
        {
            BillPayItem item = new BillPayItem();

            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@BillPayId", SqlDbType.Int, Id);

            SqlTools.ExecuteReader("[dbo].[BillPay_LoadBillPay]", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        PopulateFromReader(reader, item);
                    }
                });
            return item;
        }
Пример #9
0
        public static TransactionList GetTransactionsByCustomer(int CustomerId)
        {
            TransactionList list = new TransactionList();
            SqlParamsColl paramList = new SqlParamsColl();

            paramList.Add("@CustomerId", SqlDbType.Int, CustomerId);

            SqlTools.ExecuteReader("dbo.Admin_LoadCustomerTransactions", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        list.Add(PopulateObjectFromReader(reader));
                    }
                });
            return list;
        }
Пример #10
0
        public static Customer GetCustomerById(int Id)
        {
            Customer custDetail = new Customer();

            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@CustomerId", SqlDbType.Int, Id);

            SqlTools.ExecuteReader("Customer_Load", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        PopulateObjectFromReader(reader, custDetail);
                    }
                });
            return custDetail;
        }
Пример #11
0
        public static AccountList GetAccountsByCustomer(int Id)
        {
            AccountList list = new AccountList();

            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@CustomerId", SqlDbType.Int, Id);

            SqlTools.ExecuteReader("dbo.Accounts_RetrieveByCustomer", paramList, reader =>
                {
                    while (reader.Read())
                    {
                        Account acc = new Account();
                        PopulateObjectFromReader(reader, acc);
                        list.Add(acc);
                    }
                });

            return list;
        }
Пример #12
0
        public static int? InsertUpdateBillPay(int? BPAYId, int FromAccount, decimal Amount, int PayeeId, DateTime NextBillDate, char Frequency)
        {
            int? returnedBPAYId = 0;

            SqlParamsColl paramList = new SqlParamsColl();

            if (BPAYId != null)
                paramList.Add("@BPAYId", SqlDbType.Int, BPAYId);

            paramList.Add("@FromAccountId", SqlDbType.Int, FromAccount);
            paramList.Add("@Amount", SqlDbType.Money, Amount);
            paramList.Add("@PayeeId", SqlDbType.Int, PayeeId);
            paramList.Add("@BillDate", SqlDbType.DateTime, NextBillDate);
            paramList.Add("@Frequency", SqlDbType.NVarChar, Frequency);

            returnedBPAYId = (int)SqlTools.ExecuteScalar("dbo.BillPay_InsertUpdate", paramList);

            if (returnedBPAYId != null)
                return returnedBPAYId;
            else
                return 0;
        }
Пример #13
0
        public static BillPayItemList LoadCustomerBillPayList(int CustomerId)
        {
            BillPayItemList list = new BillPayItemList();

            SqlParamsColl paramList = new SqlParamsColl();
            paramList.Add("@CustomerId", SqlDbType.Int, CustomerId);

            SqlTools.ExecuteReader("dbo.BillPay_LoadByCustomer", paramList, reader =>
            {
                while (reader.Read())
                {
                    BillPayItem item = new BillPayItem();
                    PopulateFromReader(reader, item);
                    list.Add(item);
                }
            });
            return list;
        }