Пример #1
0
        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 ");
            }
        }
Пример #2
0
        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;
        }
Пример #3
0
        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 = "";
            }
        }
Пример #4
0
        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;
            }
        }
Пример #5
0
        private void viBest_Click(object sender, EventArgs e)
        {
            Movie_Field instance = new Movie_Field();

            MessageBox.Show("Best Movie of the Store :" + instance.Best_Movie());
        }