예제 #1
0
        private void PopularCustomer_Click(object sender, EventArgs e)
        {
            //print the name of the popular customer
            CustomerClass obj_customer = new CustomerClass();

            obj_customer.popularCustomer();
        }
예제 #2
0
        private void CustomerData_Click(object sender, EventArgs e)
        {
            CustomerClass obj = new CustomerClass();

            obj.CustomerData(dataGridView2);
            optn = 2;
        }
예제 #3
0
 private void CustomerDelete_Click(object sender, EventArgs e)
 {
     /// condition to pass the id and check the id
     if (!CustomerPkID.Text.ToString().Equals(""))
     {
         CustomerClass obj_Class = new CustomerClass();
         //after that pas the id to delete method if the return value is 1
         if (obj_Class.CustomerDelete(Convert.ToInt32(CustomerPkID.Text.ToString())) == 1)
         {
             MessageBox.Show("Customer Record is deleted ");
             CustomerPkID.Text    = "";
             CustomerName.Text    = "";
             CustomerCity.Text    = "";
             CustomerCountry.Text = "";
             CustomerContact.Text = "";
         }
         else
         {
             MessageBox.Show("You already have an video on rent ");
         }
     }
     else
     {
         MessageBox.Show("Select the Customer Record to Delete ");
     }
 }
예제 #4
0
        private void CustomerUpdate_Click(object sender, EventArgs e)
        {
            //pass the record to update the details of the customer
            if (!CustomerPkID.Text.ToString().Equals("") && !CustomerName.Text.ToString().Equals("") && !CustomerCity.Text.ToString().Equals("") && !CustomerContact.Text.ToString().Equals("") && !CustomerCountry.Text.ToString().Equals(""))
            {
                CustomerClass obj_Class = new CustomerClass();
                if (obj_Class.CusotmerUpdate(Convert.ToInt32(CustomerPkID.Text.ToString()), CustomerName.Text.ToString(), CustomerCity.Text.ToString(), CustomerContact.Text.ToString(), CustomerCountry.Text.ToString()) == 1)
                {
                    MessageBox.Show("Customer Record is Updated ");

                    CustomerName.Text    = "";
                    CustomerCity.Text    = "";
                    CustomerCountry.Text = "";
                    CustomerContact.Text = "";
                    CustomerPkID.Text    = "";
                }
                else
                {
                    MessageBox.Show("There is an error check the record once ");
                }
            }
            else
            {
                MessageBox.Show("Fill all the Values to Update the record ");
            }
        }
예제 #5
0
 private void CustomerAdd_Click(object sender, EventArgs e)
 {
     if (!CustomerName.Text.ToString().Equals("") && !CustomerCity.Text.ToString().Equals("") && !CustomerContact.Text.ToString().Equals("") && !CustomerCountry.Text.ToString().Equals(""))
     {
         CustomerClass obj_Class = new CustomerClass();
         if (obj_Class.CusotmerAdd(CustomerName.Text.ToString(), CustomerCity.Text.ToString(), CustomerContact.Text.ToString(), CustomerCountry.Text.ToString()) == 1)
         {
             MessageBox.Show("Customer Record is saved ");
             CustomerName.Text    = "";
             CustomerCity.Text    = "";
             CustomerCountry.Text = "";
             CustomerContact.Text = "";
         }
         else
         {
             MessageBox.Show("There is an error check the record once ");
         }
     }
     else
     {
         MessageBox.Show("Fill all the details ");
     }
 }