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
 // 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);
 }
 public bool Create(CustomerModel model)
 {
     return(_res.Create(model));
 }
示例#4
0
 public void UpdateCustomersAccount(CustomerModel customer, AccountModel account)
 {
     DALMngr dalMngr = new DALMngr();
     dalMngr.UpdateCustomersAccount(customer, account);
 }
示例#5
0
        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();
        }