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; }
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); }
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 = ""; }
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 = ""; }