private void viInfo_delete_Click(object sender, EventArgs e) { //creating the local object of the movie class to pass the value by calling the refernece of the variable Movie_Field instance = new Movie_Field(); DataTable tbl = new DataTable(); tbl = instance.Record("select * from Rental_Field where Movie_Id=" + Convert.ToInt32(videorental_ID.Text) + " && Return_Date='Issue'"); if (tbl.Rows.Count == 0) { if (instance.Movie_Delete(Convert.ToInt32(videorental_ID.Text)) == 1) { viInfo_Genre.Text = ""; viInfo_Plot.Text = ""; viInfo_copies.Text = ""; viInfo_cost.Text = ""; viInfo_year.Text = ""; viInfo_points.Text = ""; viInfo_Name.Text = ""; videorental_ID.Text = ""; } } else { MessageBox.Show("this Movie is already issued on rent "); } }
private void vsRecord_Click(object sender, EventArgs e) { optn = 2; Movie_Field instance = new Movie_Field(); DataTable tbl = new DataTable(); tbl = instance.Movie_Record(); tjGridview.DataSource = tbl; }
private void viInfo_update_Click(object sender, EventArgs e) { //creating the local object of the movie class to pass the value by calling the refernece of the variable Movie_Field instance = new Movie_Field(); if (instance.Movie_Updte(Convert.ToInt32(videorental_ID.Text), viInfo_Name.Text, viInfo_points.Text, viInfo_year.Text, viInfo_cost.Text, viInfo_copies.Text, viInfo_Plot.Text, viInfo_Genre.Text) == 1) { viInfo_Genre.Text = ""; viInfo_Plot.Text = ""; viInfo_copies.Text = ""; viInfo_cost.Text = ""; viInfo_year.Text = ""; viInfo_points.Text = ""; viInfo_Name.Text = ""; videorental_ID.Text = ""; } }
private void viInfo_add_Click(object sender, EventArgs e) { //creating the local object of the movie class to pass the value by calling the refernece of the variable Movie_Field instance = new Movie_Field(); if (instance.Movie_Insert(viInfo_Name.Text, viInfo_points.Text, viInfo_year.Text, viInfo_cost.Text, viInfo_copies.Text, viInfo_Plot.Text, viInfo_Genre.Text) == 1) { viInfo_Genre.Text = ""; viInfo_Plot.Text = ""; viInfo_copies.Text = ""; viInfo_cost.Text = ""; viInfo_year.Text = ""; viInfo_points.Text = ""; viInfo_Name.Text = ""; DataTable tbl = new DataTable(); tbl = instance.Movie_Record(); tjGridview.DataSource = tbl; } }
private void viBest_Click(object sender, EventArgs e) { Movie_Field instance = new Movie_Field(); MessageBox.Show("Best Movie of the Store :" + instance.Best_Movie()); }