private void LoadData(object parameter)
        {
            KongBuBankEntities db    = KongBuBankEntities.Instance;
            Account            query = (from x in db.Accounts
                                        where x.DebitCardId == Account.Account.DebitCardId
                                        where x.PIN == Account.Account.PIN
                                        select x).FirstOrDefault();

            if (query == null)
            {
                //Account Not Found
                Message = "Account Not Found!";
                MessageBox.Show("Invalid Card / PIN", "Error");
            }
            else
            {
                IndividualAccount temp = new IndividualAccount();
                temp.Account = query;
                Account      = temp;

                Console.WriteLine("Authentication Success: " + Account.Account.Name);
                Message = "Success!";

                RedirectPage();
            }
        }
        public ATMTransferViewModel(IndividualAccount _account)
        {
            Account       = _account;
            tempAccount   = new Account();
            targetAccount = new IndividualAccount();

            targetAccount.Account = tempAccount;
        }
Beispiel #3
0
        public void Withdraw_Throws_When_Exceeds_Limit()
        {
            Account account = new IndividualAccount(new Person("John", "Doe"), 500);

            account.Deposit(25000);

            account.Withdraw(501);
        }
        public ATMAuthenticationViewModel()
        {
            Name        = "ATMAuthentication";
            tempAccount = new Account();
            account     = new IndividualAccount();

            Account.Account = tempAccount;
        }
Beispiel #5
0
        public TellerWithdrawViewModel(Employee _employee)
        {
            Name            = "TellerWithdraw";
            tempAccount     = new Account();
            account         = new IndividualAccount();
            CurrentEmployee = _employee;

            Account.Account = tempAccount;
        }
Beispiel #6
0
        public ATMCheckTransactionViewModel(IndividualAccount _account)
        {
            account   = _account;
            dateLimit = new DateTime();
            dateLimit = DateTime.Now.AddDays(-30);
            Period    = "Period " + dateLimit.Day + "." + dateLimit.Month + "." + dateLimit.Year + " - " +
                        DateTime.Now.Day + "." + DateTime.Now.Month + "." + DateTime.Now.Year;

            LoadDataGrid();
        }
        public TellerTransferViewModel(Employee _employee)
        {
            Name              = "TellerTransfer";
            tempAccount       = new Account();
            tempAccountTarget = new Account();
            account           = new IndividualAccount();
            targetAccount     = new IndividualAccount();
            CurrentEmployee   = _employee;

            Account.Account       = tempAccount;
            TargetAccount.Account = tempAccountTarget;
        }
        public ATMPaymentViewModel(IndividualAccount _account)
        {
            Name    = "ATMPayment";
            account = new IndividualAccount();

            Account = _account;

            //ComboBox
            IList <string> list = new List <string>();

            list.Add("Electricity");
            list.Add("Water");
            paymentTypes = new CollectionView(list);
        }
        private void LoadAccount()
        {
            using (KongBuBankEntities db = new KongBuBankEntities())
            {
                Account query = (from x in db.Accounts
                                 where x.DebitCardId == TargetAccount.Account.DebitCardId
                                 select x).FirstOrDefault();

                if (query != null)
                {
                    IndividualAccount temp = new IndividualAccount();
                    temp.Account  = query;
                    TargetAccount = temp;
                }
            }
        }
Beispiel #10
0
        public void Can_Transfer_Funds()
        {
            Person owner = new Person("John", "Doe");

            Account checking = new CheckingAccount(owner);

            Account individual = new IndividualAccount(owner);

            checking.Deposit(5000);

            checking.Transfer(individual, 2500);

            Assert.AreEqual(2500, checking.Balance);

            Assert.AreEqual(2500, individual.Balance);
        }
Beispiel #11
0
        public TellerPaymentViewModel(Employee _employee)
        {
            Name            = "TellerPayment";
            tempAccount     = new Account();
            account         = new IndividualAccount();
            CurrentEmployee = _employee;

            Account.Account = tempAccount;

            //ComboBox
            IList <string> list = new List <string>();

            list.Add("Electricity");
            list.Add("Water");
            paymentTypes = new CollectionView(list);
        }
Beispiel #12
0
 private void LoadAccount(object parameter)
 {
     using (KongBuBankEntities db = new KongBuBankEntities())
     {
         Account query = (from x in db.Accounts
                          where x.AccountId == Account.Account.AccountId
                          select x).FirstOrDefault();
         if (query == null)
         {
             //Account not found
             Message = "Account Not Found!";
             MessageBox.Show("Account Not Found!", "Error");
         }
         else
         {
             IndividualAccount temp = new IndividualAccount();
             temp.Account = query;
             Account      = temp;
         }
     }
 }
Beispiel #13
0
        private void BuildSavingAccount(IndividualAccount IndividualAcc)
        {
            IndividualAcc.CustomerID = txtId.Text;
            IndividualAcc.Status = AuthoriseStatus.UNA.ToString();
            IndividualAcc.FirstName = txtFirstName.Text;
            IndividualAcc.LastName= txtLastName.Text;
            IndividualAcc.MiddleName =txtMiddleName.Text;
            IndividualAcc.GBShortName =txtGBShortName.Text;
            IndividualAcc.GBFullName =txtGBFullName.Text;
            IndividualAcc.BirthDay =rdpBirthDay.SelectedDate;
            IndividualAcc.GBStreet =txtStreet.Text;
            IndividualAcc.GBDist =txtGBTownDist.Text;
            IndividualAcc.MobilePhone =txtMobilePhone.Text;
            IndividualAcc.MaTinhThanh =  cmbCity.SelectedValue;
            IndividualAcc.TenTinhThanh = cmbCity.SelectedItem.Text.Replace(IndividualAcc.MaTinhThanh + " - ", "");
            IndividualAcc.CountryCode = cmbCountry.SelectedValue;
            IndividualAcc.CountryName = cmbCountry.SelectedItem.Text.Replace(IndividualAcc.CountryCode + " - ", "");
            IndividualAcc.NationalityCode =cmbNationality.SelectedValue;
            IndividualAcc.NationalityName = cmbNationality.SelectedItem.Text.Replace(IndividualAcc.NationalityCode + " - ", "");

            IndividualAcc.ResidenceCode = cmbNationality.SelectedValue;
            IndividualAcc.ResidenceName = cmbNationality.SelectedItem.Text.Replace(IndividualAcc.ResidenceCode + " - ", "");
            IndividualAcc.DocType =cmbDocType.SelectedItem.Text;
            IndividualAcc.DocID = txtDocID.Text;
            IndividualAcc.DocIssuePlace = txtDocIssuePlace.Text;
            IndividualAcc.DocIssueDate =rdpDocIssueDate.SelectedDate;
            IndividualAcc.DocExpiryDate =rdpDocExpiry.SelectedDate;
            IndividualAcc.SectorCode = cmbMainSector.SelectedValue;
            IndividualAcc.SectorName =cmbMainSector.SelectedItem.Text.Replace(IndividualAcc.SectorCode+"-","");
            IndividualAcc.SubSectorCode =cmbSubSector.SelectedValue;
            IndividualAcc.SubSectorName =cmbSubSector.SelectedItem.Text.Replace(IndividualAcc.SubSectorCode+"-","");
            IndividualAcc.IndustryCode = cmbMainIndustry.SelectedValue;
            IndividualAcc.IndustryName = cmbMainIndustry.Text.Replace(IndividualAcc.IndustryCode+" - ","");
            IndividualAcc.SubIndustryCode = cmbIndustry.SelectedValue;
            IndividualAcc.SubIndustryName = cmbIndustry.Text;
            IndividualAcc.TargetCode = cmbTarget.SelectedValue;
            IndividualAcc.MaritalStatus = cmbMaritalStatus.SelectedValue;
            IndividualAcc.AccountOfficer = cmbAccountOfficer.SelectedValue;
            IndividualAcc.Gender = rcbGender.SelectedValue;
            IndividualAcc.Title = rcbTitle.SelectedValue;
            IndividualAcc.ContactDate = rdpContactDate.SelectedDate;
            IndividualAcc.RelationCode = cmbRelationCode.SelectedValue;
            IndividualAcc.OfficeNumber = txtOfficeNumber.Text;
            IndividualAcc.FaxNumber = txtFaxNumber.Text;
            IndividualAcc.NoOfDependant = txtNoOfDependants.Text;
            IndividualAcc.NoOfChildUnder15 = txtNoChild15.Text;
            IndividualAcc.NoOfChildUnder25 = txtNoChild15_25.Text;
            IndividualAcc.NoOfchildOver25 = txtNoChild25.Text;
            IndividualAcc.HomeOwnerShip = rcbHomeOwnership.SelectedValue;
            IndividualAcc.ResidenceType = rcbResidenceType.SelectedValue;
            IndividualAcc.EmploymentStatus = rcbEmployeementStatus.SelectedValue;
            IndividualAcc.CompanyName = txtCompanyName.Text;
            IndividualAcc.Currency = cmbCurrency.SelectedValue;
            IndividualAcc.MonthlyIncome = txtMonthlyIncome.Text;
            IndividualAcc.OfficeAddress = txtOfficeAddress.Text;
            IndividualAcc.CustomerLiability = txtCustomerLiability.Text;
            IndividualAcc.ApprovedUser = UserInfo.Username.ToString();
            IndividualAcc.IndCust_EmailAddress = tbEmailAddress.Text;
        }
Beispiel #14
0
        public ATMWindow(IndividualAccount account)
        {
            InitializeComponent();

            DataContext = new ATMViewModel(account);
        }
 public ATMWithdrawViewModel(IndividualAccount _account)
 {
     Account = _account;
 }
 public ATMDepositViewModel(IndividualAccount _account)
 {
     Account = _account;
 }
Beispiel #17
0
 private bool CommitSaveAcctoDB()
 {
     var IndividualAccount = new IndividualAccount(); // tao 1 doi tuong co day du properties
     BuildSavingAccount(IndividualAccount); // gan gia tri hien co cho doi tuong
     if (TriTT.OPEN_INDIVIDUAL_CUSTOMER_CheckDocID_Exists("", "P", IndividualAccount.DocID).Tables[0].Rows[0]["Exists"].ToString() == "YES")
     {
         ShowMsgBox("This Doc ID is existed. Please check again !");
         return false;
     }
     if (SavingAccount_SQL.CheckIndividualCustomerExist(IndividualAccount.CustomerID))
     {
         IndividualAccount.AccountOfficer = this.cmbAccountOfficer.SelectedItem.Text;
         return SavingAccount_SQL.UpdateSavingAccount(IndividualAccount);
     }
     else
     {
         IndividualAccount.AccountOfficer = this.cmbAccountOfficer.SelectedItem.Text;
         return SavingAccount_SQL.CreateSavingAccount(IndividualAccount);
     }
 }
Beispiel #18
0
 public ATMViewModel(IndividualAccount _account)
 {
     Name              = "ATM";
     Account           = _account;
     SelectedViewModel = new ATMAccountViewModel(Account);
 }
Beispiel #19
0
 private bool CommitSaveAcctoDB()
 {
     var IndividualAccount = new IndividualAccount(); // tao 1 doi tuong co day du properties
     BuildSavingAccount(IndividualAccount); // gan gia tri hien co cho doi tuong
     if (SavingAccount_SQL.CheckIndividualCustomerExist(IndividualAccount.CustomerID))
     {
         IndividualAccount.AccountOfficer = this.cmbAccountOfficer.SelectedItem.Text;
         return SavingAccount_SQL.UpdateSavingAccount(IndividualAccount);
     }
     else
     {
         IndividualAccount.AccountOfficer = this.cmbAccountOfficer.SelectedItem.Text;
         return SavingAccount_SQL.CreateSavingAccount(IndividualAccount);
     }
 }