コード例 #1
0
ファイル: Form1.cs プロジェクト: dilpree7477/video-rental-
        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
ファイル: Form1.cs プロジェクト: dilpree7477/video-rental-
        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
ファイル: Form1.cs プロジェクト: dilpree7477/video-rental-
        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
ファイル: Form1.cs プロジェクト: dilpree7477/video-rental-
        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
ファイル: Form1.cs プロジェクト: dilpree7477/video-rental-
        private void viBest_Click(object sender, EventArgs e)
        {
            Movie_Field instance = new Movie_Field();

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