コード例 #1
0
        public Customer GetCustomerByTcNo(long tcNo)
        {
            Customer c = new Customer();
            c.TCNo = tcNo;


            BankServiceClient bankService = new BankServiceClient();
            List<Gateway.BankServiceReferance.WorkingBank> workingBanks=bankService.GetWorkingBankByTcNo(tcNo).ToList();
            List<Bank> banks = new List<Bank>();
            banks = workingBanks.Select(i => new Bank() {
                BankID=i.BankId,
                BankaAdi=i.BankName
            }).ToList();
            c.WorkingBanks = banks;

            CreditNoteServiceClient creditNoteService = new CreditNoteServiceClient();
            c.CreditNote=creditNoteService.GetCreditNote(tcNo);

            CustomerModel cm = new CustomerModel();
            c.CustomerName= cm.GetCustomerNameByTcNo(tcNo);

            return c;
        }
コード例 #2
0
ファイル: BLLMngr.cs プロジェクト: joeLloyd/OOP_v3
 // Taking Objects from AddCustomer //
 public void CreateCustomerAccount(CustomerModel newCustomer, AccountModel newAccount, TransactionModel newTransaction)
 {
     // Sending to DAL //
     DALMngr dalMngr = new DALMngr();
     dalMngr.CreateCustomerAccount(newCustomer, newAccount, newTransaction);
 }
コード例 #3
0
 public bool Create(CustomerModel model)
 {
     return(_res.Create(model));
 }
コード例 #4
0
ファイル: BLLMngr.cs プロジェクト: joeLloyd/OOP_v3
 public void UpdateCustomersAccount(CustomerModel customer, AccountModel account)
 {
     DALMngr dalMngr = new DALMngr();
     dalMngr.UpdateCustomersAccount(customer, account);
 }
コード例 #5
0
ファイル: AddCustomer.cs プロジェクト: joeLloyd/OOP_v3
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // CUSTOMER INFO //
            string firstName = txtFirstName.Text;
            string surname = txtSurname.Text;
            string address1 = txtAddress1.Text;
            string address2 = txtAddress2.Text;
            string city = txtCity.Text;
            string county = cboCounty.SelectedItem.ToString();

            // ACCOUNT INFO //
            accountNo = 0;
            int.TryParse(txtAccountNo.Text, out accountNo);
            int sortCode = 0;
            int.TryParse(txtSortCode.Text, out sortCode);
            string amountEuro = txtAmountEuro.Text.Trim();
            string amountCent = txtAmountCent.Text.Trim();
            string amountString = amountEuro + amountCent;
            int amount;
            int.TryParse(amountString, out amount);

            string accountType = "";
            if (rdoCurrent.Checked)
            {
                accountType = "Current";
            }
            else if (rdoSavings.Checked)
            {
                accountType = "Savings";
            }

            // TRANSACTION INFO //
            string description = "Initial Transaction";

            string type = "Deposit";

            // Creating three Objects //
            CustomerModel customer = new CustomerModel(firstName, surname, email, phone, address1, address2, city, county);
            AccountModel account = new AccountModel(accountType, accountNo, sortCode, amount, overDraftLimit);
            TransactionModel transaction = new TransactionModel(amount, type, description);

            // Sending to BLL //
            BLLMngr bllMngr = new BLLMngr();
            bllMngr.CreateCustomerAccount(customer, account, transaction);

            MessageBox.Show("Customer Account Added");

            this.Close();
        }