Пример #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 ");
     }
 }