예제 #1
0
        private void RentalData_Click(object sender, EventArgs e)
        {
            RentalClass obj_rent = new RentalClass();

            obj_rent.RentalData(dataGridView2);
            optn = 3;
        }
예제 #2
0
        private void RetnalVideoDelete_Click(object sender, EventArgs e)
        {
            if (rentId == 0)
            {
                RentalClass obj_rent = new RentalClass();
                if (obj_rent.rentalDelete(rentId) == 1)
                {
                    MessageBox.Show(" Rental Record is deleted");
                }

                VideoPkID.Text    = "";
                VideoName.Text    = "";
                VideoRatting.Text = "";
                VideoDate.Text    = "";
                VideoCost.Text    = "";
                VideoCopies.Text  = "";

                CustomerPkID.Text    = "";
                CustomerName.Text    = "";
                CustomerCity.Text    = "";
                CustomerCountry.Text = "";
                CustomerContact.Text = "";
            }
            else
            {
                MessageBox.Show("Select the rental video to delete ");
            }
        }
예제 #3
0
        private void VideoReturn_Click(object sender, EventArgs e)
        {
            if (rentId > 0 && !VideoPkID.Text.ToString().Equals("") && !CustomerPkID.Text.ToString().Equals(""))
            {
                RentalClass obj_Rent = new RentalClass();

                if (obj_Rent.rentalUpdate(rentId, Convert.ToInt32(VideoPkID.Text.ToString()), Convert.ToInt32(CustomerPkID.Text.ToString()), RentalIssueDate.Text.ToString(), RentalReturnDate.Text.ToString()) == 1)
                {
                }
                else
                {
                    MessageBox.Show("Check your record once ");
                }


                VideoPkID.Text    = "";
                VideoName.Text    = "";
                VideoRatting.Text = "";
                VideoDate.Text    = "";
                VideoCost.Text    = "";
                VideoCopies.Text  = "";

                CustomerPkID.Text    = "";
                CustomerName.Text    = "";
                CustomerCity.Text    = "";
                CustomerCountry.Text = "";
                CustomerContact.Text = "";
            }
        }
예제 #4
0
        private void VideoIssue_Click(object sender, EventArgs e)
        {
            //verfy the Id of the Video and Customer
            if (!VideoPkID.Text.ToString().Equals("") && !CustomerPkID.Text.ToString().Equals(""))
            {
                RentalClass obj_rent = new RentalClass();
                if (obj_rent.rentalAdd(Convert.ToInt32(VideoPkID.Text.ToString()), Convert.ToInt32(CustomerPkID.Text.ToString()), RentalIssueDate.Text.ToString()) == 1)
                {
                    MessageBox.Show("Video is issued on rent ");
                }
                VideoPkID.Text    = "";
                VideoName.Text    = "";
                VideoRatting.Text = "";
                VideoDate.Text    = "";
                VideoCost.Text    = "";
                VideoCopies.Text  = "";

                CustomerPkID.Text    = "";
                CustomerName.Text    = "";
                CustomerCity.Text    = "";
                CustomerCountry.Text = "";
                CustomerContact.Text = "";
            }
            else
            {
                MessageBox.Show("Select the Video to book on rent ");
            }
        }