예제 #1
0
        public Customer GetCustomer(string userId, short pin)
        {
            Customer customer = new Customer();

            ATM.CustomerDataTable customerTable = CustomerAdapter.GetCustomerBySecureInfo(userId, pin);

            if (customerTable.Count == 0)
            {
                return(customer);
            }
            return(createCustomer(customerTable[0]));
        }
예제 #2
0
        public Customer GetCustomerObject(string userId, short pin)
        {
            ATM.CustomerDataTable customerTable = CustomerAdapter.GetCustomerBySecureInfo(userId, pin);
            if (customerTable.Count == 0)
            {
                return(new Customer());
            }
            Customer customer = new Customer(customerTable[0].CustomerNumber, customerTable[0].FirstName, customerTable[0].LastName);

            customer.Status = ObjectStatus.Clean;
            return(customer);
        }
예제 #3
0
 public virtual ATM.CustomerDataTable GetCustomerBySecureInfo(string UserId, System.Nullable<int> Pin) {
     this.Adapter.SelectCommand = this.CommandCollection[1];
     if ((UserId == null)) {
         this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
     }
     else {
         this.Adapter.SelectCommand.Parameters[0].Value = ((string)(UserId));
     }
     if ((Pin.HasValue == true)) {
         this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Pin.Value));
     }
     else {
         this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
     }
     ATM.CustomerDataTable dataTable = new ATM.CustomerDataTable();
     this.Adapter.Fill(dataTable);
     return dataTable;
 }
예제 #4
0
 public virtual ATM.CustomerDataTable GetCustomers() {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     ATM.CustomerDataTable dataTable = new ATM.CustomerDataTable();
     this.Adapter.Fill(dataTable);
     return dataTable;
 }