private void renRecord_Click(object sender, EventArgs e) { optn = 3; Rental_Field instance = new Rental_Field(); DataTable tbl = new DataTable(); tbl = instance.Rental_Record(); tjGridview.DataSource = tbl; }
private void delete_movie_info_Click(object sender, EventArgs e) { Rental_Field instance = new Rental_Field(); if (Rental_Id.Equals("")) { MessageBox.Show("Select Rental Movie To delete"); } else { if (instance.Rental_Delete(Convert.ToInt32(Rental_Id)) == 1) { videorental_ID.Text = ""; rentalInfo_csID.Text = ""; } } }
private void return_movie_info_Click(object sender, EventArgs e) { Rental_Field instance = new Rental_Field(); if (Rental_Id.Equals("")) { MessageBox.Show("Select Rental Movie To Return "); } else { int Charges = instance.Rental_Updte(Convert.ToInt32(Rental_Id), Convert.ToInt32(rentalInfo_csID.Text.ToString()), Convert.ToInt32(videorental_ID.Text.ToString()), IssueDtp.Text, ReturnDtp.Text); if (Charges > 0) { MessageBox.Show("Your Total Bill is: " + Charges); } } }
private void issue_movie_info_Click(object sender, EventArgs e) { Rental_Field instance = new Rental_Field(); if (instance.Customer_Record(Convert.ToInt32(rentalInfo_csID.Text.ToString())) < 2) { DataTable tbl = new DataTable(); tbl = instance.Record("select * from Movie_Field where Movie_Id=" + Convert.ToInt32(videorental_ID.Text.ToString()) + ""); int copies = Convert.ToInt32(tbl.Rows[0]["Copies"].ToString()); if (instance.Movie_Record(Convert.ToInt32(videorental_ID.Text.ToString())) < copies) { instance.Rental_Insert(Convert.ToInt32(rentalInfo_csID.Text.ToString()), Convert.ToInt32(videorental_ID.Text.ToString()), IssueDtp.Text); DataTable tbl1 = new DataTable(); tbl1 = instance.Rental_Record(); tjGridview.DataSource = tbl1; viInfo_Genre.Text = ""; viInfo_Plot.Text = ""; viInfo_copies.Text = ""; viInfo_cost.Text = ""; viInfo_year.Text = ""; viInfo_points.Text = ""; viInfo_Name.Text = ""; videorental_ID.Text = ""; csInfo_City.Text = ""; csInfo_Contact.Text = ""; csInfo_email.Text = ""; csInfo_Name.Text = ""; rentalInfo_csID.Text = ""; } else { MessageBox.Show("All the Movies Copies all already Issued "); } } else { MessageBox.Show("you already issued two movie so can't issue more "); } }