Beispiel #1
0
 private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         var item = dataGridView2.Rows[e.RowIndex].Cells[0].Value;
         txt_RuMovieName.Text = item.ToString();
         DBconnection db1 = new DBconnection();
         Movie        m   = db1.searchMovie(txt_RuMovieName.Text);
         movno = m.Movie_Id;
         txt_RuMovieRent.Text = m.Price.ToString();
         Rent r1      = new Rent();
         int  fineval = r1.getfines(m.Movie_Id, txt_RuCusNIC.Text);
         txt_fines.Text   = fineval.ToString();
         txt_RuTotal.Text = ((m.Price) + fineval).ToString();
     }
     catch (Exception)
     {
         MessageBox.Show("Click on a movie name", "Select Movie", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        public Movie searchMovie(String name)
        {
            DBconnection db = new DBconnection();

            return(db.searchMovie(name));
        }