Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            task         = 3;
            BookingVideo = new BookingVideo(1, 1, 1, "ok", "Book");
            DataTable tbl = new DataTable();

            tbl = BookingVideo.CmdRecord("select * from CustomerPannel");
            ViewData.DataSource = tbl;
        }
Exemplo n.º 2
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            BookingVideo = new BookingVideo(BookID, Convert.ToInt32(txtMovieID.Text), Convert.ToInt32(txtCustomerID.Text), dtpIssue.Text, "Book");


            // movie Cost
            DataTable tbl = new DataTable();

            tbl = new DataTable();
            tbl = BookingVideo.CmdRecord("select * from VideoPannel where VideoID=" + Convert.ToInt32(txtMovieID.Text) + "");
            int Cost = Convert.ToInt32(tbl.Rows[0]["Price"].ToString());



            DateTime current_date = DateTime.Now;

            //date converersion
            DateTime prev_date = Convert.ToDateTime(dtpIssue.Text);


            String Daysdiff = (current_date - prev_date).TotalDays.ToString();


            //date calculater
            Double DaysInterval = Math.Round(Convert.ToDouble(Daysdiff));


            int Bill = Cost * Convert.ToInt32(DaysInterval);



            BookingVideo.ReturnVideo();
            MessageBox.Show("Thanks for the using you need to pay $" + Bill);
            txtMovieID.Text    = "";
            vd_Name.Text       = "";
            vd_Plot.Text       = "";
            Vd_Genre.Text      = "";
            Vd_Year.Text       = "";
            Vd_Copies.Text     = "";
            Vd_Price.Text      = "";
            txtCustomerID.Text = "";
            txtName.Text       = "";
            txtPhone.Text      = "";
            txtAddress.Text    = "";
            txtCountry.Text    = "";
        }
Exemplo n.º 3
0
 // video Delete
 private void btnRentalDelete_Click(object sender, EventArgs e)
 {
     BookingVideo = new BookingVideo(BookID, Convert.ToInt32(txtMovieID.Text), Convert.ToInt32(txtCustomerID.Text), dtpIssue.Text, "Book");
     BookingVideo.DeleteBookVideo();
     MessageBox.Show("Video is issed on rent ");
     txtMovieID.Text    = "";
     vd_Name.Text       = "";
     vd_Plot.Text       = "";
     Vd_Genre.Text      = "";
     Vd_Year.Text       = "";
     Vd_Copies.Text     = "";
     Vd_Price.Text      = "";
     txtCustomerID.Text = "";
     txtName.Text       = "";
     txtPhone.Text      = "";
     txtAddress.Text    = "";
     txtCountry.Text    = "";
 }
Exemplo n.º 4
0
        private void rental_Click(object sender, EventArgs e)
        {
            task         = 1;
            BookingVideo = new BookingVideo(1, 1, 1, "ok", "Book");
            DataTable tbl = new DataTable();

            tbl = BookingVideo.CmdRecord("select * from BookingPannel");
            ViewData.DataSource = tbl;

            txtMovieID.Text    = "";
            vd_Name.Text       = "";
            vd_Plot.Text       = "";
            Vd_Genre.Text      = "";
            Vd_Year.Text       = "";
            Vd_Copies.Text     = "";
            Vd_Price.Text      = "";
            txtCustomerID.Text = "";
            txtName.Text       = "";
            txtPhone.Text      = "";
            txtAddress.Text    = "";
            txtCountry.Text    = "";
        }
Exemplo n.º 5
0
        private void button4_Click(object sender, EventArgs e)
        {
            //compare the booking and fetch the most viewed movie
            DataTable    tblData = new DataTable();
            BookingVideo booking = new BookingVideo(1, 1, 1, "1", "1");

            tblData = booking.CmdRecord("select * from VideoPannel");
            int    x = 0, y = 0, c**t = 0;
            String Title = "";

            for (x = 0; x < tblData.Rows.Count; x++)
            {
                DataTable tblData1 = new DataTable();
                tblData1 = booking.CmdRecord("select * from BookingPannel where MovieID='" + tblData.Rows[x]["VideoID"].ToString() + "'");

                if (tblData1.Rows.Count > c**t)
                {
                    Title = tblData.Rows[x]["Name"].ToString();
                    c**t  = tblData1.Rows.Count;
                }
            }

            MessageBox.Show("Best Video is " + Title);
        }