private ObservableCollection <CustomerDataObjects> GetCustomerList()
        {
            _icust = new CustomerDataAccessLayer();
            var list = _icust.GetCustomers();

            return(new ObservableCollection <CustomerDataObjects>(list));
        }
        private void DeleteButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var Cust_List = new CustomerDataObjects();

            Cust_List.Customer_ID = Convert.ToInt32(txt_ID.Text);
            _icust = new CustomerDataAccessLayer();
            _icust.DeleteCustomer(Cust_List);
            Clear();
            CustomerdataGrid.ItemsSource = GetCustomerList();
        }
        private void AddButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var Cust_List = new CustomerDataObjects();

            Cust_List.Customer_ID   = Convert.ToInt32(txt_ID.Text);
            Cust_List.FirstName     = txt_FirstName.Text.ToString().Trim();
            Cust_List.LastName      = txt_LastName.Text.ToString().Trim();
            Cust_List.Address       = txt_Address.Text.ToString().Trim();
            Cust_List.Customer_Type = txt_CType.Text.ToString().Trim();
            _icust = new CustomerDataAccessLayer();
            _icust.UpdateCustomer(Cust_List);
            CustomerdataGrid.ItemsSource = GetCustomerList();
            Clear();
        }
예제 #4
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            var Cust_List = new LoginData();

            Cust_List.Username     = txtName.Text;
            Cust_List.UserPassword = txtPassword.Password.ToString();

            _icust = new CustomerDataAccessLayer();
            var IsValid = _icust.IsValid(Cust_List);

            if (IsValid > 0)
            {
                Stock_Main s = new Stock_Main();
                s.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid Username or password");
            }
        }
예제 #5
0
 public CustomerEntity(ICustomerDataAccessLayer customerDataAccess)
 {
     this.customerDataAccess = customerDataAccess;
 }
예제 #6
0
 public CustomerBusinessLogicLayer()
 {
     cdal = new CustomerDataAccessLayer();
 }
예제 #7
0
 public CustomerBusinessLayer(ICustomerDataAccessLayer customerBusinessLayer)
 {
     _customerBusinessLayer = customerBusinessLayer;
 }
예제 #8
0
 public CustomerController(ICustomerDataAccessLayer customerDataAccessLayer)
 {
     this.customerDataAccessLayer = customerDataAccessLayer;
 }