private void btnretmov_Click(object sender, EventArgs e) { RentedMovies rmov = new RentedMovies(); int index = ddcust.SelectedIndex; if (index != 0) { int val = (int)ddcust.SelectedValue; rmov.set_CID(val); } else { MessageBox.Show("Select Customer"); } index = ddmov.SelectedIndex; if (index != 0) { int val = (int)ddmov.SelectedValue; rmov.set_MID(val); } else { MessageBox.Show("Select Customer"); } if (rmov.get_CID() != 0 && rmov.get_MID() != 0) { //rmov.set_RMID(int.Parse(textrmid.Text)); //rmov.set_CID(int.Parse(lblcidfk.Text)); //rmov.set_MID(int.Parse(lblmidfk.Text)); rmov.returned(); } BindRetnal(); }
//Rented Movie private void btnissumov_Click(object sender, EventArgs e) { RentedMovies rmov = new RentedMovies(); int index = ddcust.SelectedIndex; if (index != 0) { int val = (int)ddcust.SelectedValue; rmov.set_CID(val); } else { MessageBox.Show("Select Customer"); } index = ddmov.SelectedIndex; if (index != 0) { int val = (int)ddmov.SelectedValue; rmov.set_MID(val); } else { MessageBox.Show("Select Customer"); } if (rmov.get_CID() != 0 && rmov.get_MID() != 0) { rmov.insert(); } BindRetnal(); }