private void txt_Password_TextChanged(object sender, TextChangedEventArgs e)
 {
     connect = new CTUConnection();                     // refreshens the 'CTUConnection' class //
     connect.SelectCustomer();                          //*Selects the specified columns in the Patient table*//
     connect.SearchCustomerPassword(txt_Password.Text); //Searches the customer's 'name' within the populated table//
     DGV_Cust.ItemsSource = connect.dataset;            //*All the selected fields are filtered inside the table and stored inside the grid-view*//
 }
        private void can_Show_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            try
            {
                connect = new CTUConnection();
                connect.SelectCustomer();
                DGV_Cust.ItemsSource = connect.table.DefaultView;
            }

            catch (Exception)
            {
            }
        }
        private void can_Delete_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            connect = new CTUConnection(); // refreshens the 'Connection' class //

            try
            {
                connect.DeleteCustomer(int.Parse(ID));
                connect.SelectCustomer();
                DGV_Cust.ItemsSource = connect.table.DefaultView;
            }

            catch (Exception)
            {
            }
        }
Exemplo n.º 4
0
        private void can_Submit_MouseDown(object sender, MouseButtonEventArgs e)
        {
            connect  = new CTUConnection();
            viewCust = new ViewCustomer();

            if (txt_BankNO.MaxLength != 18 || string.IsNullOrEmpty(txt_BankNO.Text))
            {
                MessageBox.Show("Make sure the bank account number is correct");
            }

            else if (string.IsNullOrEmpty(txt_firstname.Text))
            {
                MessageBox.Show("Please enter the firstname of the customer");
            }

            else if (txt_IDnumber.MaxLength != 13 || string.IsNullOrEmpty(txt_IDnumber.Text))
            {
                MessageBox.Show("Please enter the ID number of the customer");
            }

            else if (string.IsNullOrEmpty(txt_Surname.Text))
            {
                MessageBox.Show("Please enter the surname of the customer");
            }

            else if (string.IsNullOrEmpty(txt_Password.Text))
            {
                MessageBox.Show("Please enter the password of the customer");
            }

            else
            {
                connect.GetCustomer(txt_username.Text, txt_Password.Text, txt_firstname.Text, txt_Surname.Text, txt_IDnumber.Text, txt_BankNO.Text);
                connect.SelectCustomer();
                viewCust.DGV_Cust.ItemsSource = connect.table.DefaultView;
            }
        }