Exemplo n.º 1
0
        private void View()
        {
            DataTable dt = ReserveDAO.GetReservation(int.Parse(txtBorrowerNumber.Text));

            dataGridView1.DataSource = dt;
            this.dataGridView1.Columns["date"].DefaultCellStyle.Format = "dd/MM/yyyy";

            lblNumberReservedBooks.Text = dt.Rows.Count.ToString();
        }
Exemplo n.º 2
0
        private void btnReserve_Click(object sender, EventArgs e)
        {
            Reservation re = new Reservation();

            re.BorrowerNumber = int.Parse(txtBorrowerNumber.Text);
            re.BookNumber     = int.Parse(txtBookNumber.Text);
            re.Date           = DateTime.ParseExact(txtDate.Text, "dd/MM/yyyy", null);
            re.Status         = 'R';
            ReserveDAO.Insert(re);
            View();
            txtBookNumber.Text = "";
            displayButtons(1);
        }