private void RentalData_Click(object sender, EventArgs e) { RentalClass obj_rent = new RentalClass(); obj_rent.RentalData(dataGridView2); optn = 3; }
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 "); } }
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 = ""; } }
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 "); } }