Exemplo n.º 1
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    = "";
        }