private void csRecord_Click(object sender, EventArgs e) { optn = 1; Customer_Value instance = new Customer_Value(); DataTable tbl = new DataTable(); tbl = instance.Customer_Record(); tjGridview.DataSource = tbl; }
private void csInfo_update_Click(object sender, EventArgs e) { //to update the info of the cutomer like Name or contact weather you want Customer_Value instance = new Customer_Value(); if (instance.Customer_Updte(Convert.ToInt32(rentalInfo_csID.Text.ToString()), csInfo_Name.Text, csInfo_email.Text, csInfo_Contact.Text, csInfo_City.Text) == 1) { csInfo_City.Text = ""; csInfo_Contact.Text = ""; csInfo_email.Text = ""; csInfo_Name.Text = ""; rentalInfo_csID.Text = ""; } }
private void csInfo_delete_Click(object sender, EventArgs e) { //to delete the customer we must have to check weather he has issued a movie or not Customer_Value instance = new Customer_Value(); DataTable tbl = new DataTable(); tbl = instance.Record("select * from Rental_Field where Cust_Id=" + Convert.ToInt32(rentalInfo_csID.Text.ToString()) + " && Return_Date='Issue'"); if (tbl.Rows.Count == 0) { if (instance.Customer_Delete(Convert.ToInt32(rentalInfo_csID.Text.ToString())) == 1) { csInfo_City.Text = ""; csInfo_Contact.Text = ""; csInfo_email.Text = ""; csInfo_Name.Text = ""; rentalInfo_csID.Text = ""; } } else { MessageBox.Show("First Return the Movie then you can "); } }
private void csInfo_Add_Click(object sender, EventArgs e) { //creating the local instance of the customer class to pass the value to store and verify Customer_Value instance = new Customer_Value(); if (instance.Customer_Insert(csInfo_Name.Text, csInfo_email.Text, csInfo_Contact.Text, csInfo_City.Text) == 1) { csInfo_City.Text = ""; csInfo_Contact.Text = ""; csInfo_email.Text = ""; csInfo_Name.Text = ""; DataTable tbl = new DataTable(); tbl = instance.Customer_Record(); tjGridview.DataSource = tbl; } else { csInfo_City.Text = ""; csInfo_Contact.Text = ""; csInfo_email.Text = ""; csInfo_Name.Text = ""; } }
private void csBest_Click(object sender, EventArgs e) { Customer_Value instance = new Customer_Value(); MessageBox.Show("Best Customer of the Store :" + instance.Best_Customer()); }