Exemplo n.º 1
0
        private void GrdDivTbl_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            DatReturn.CustomFormat = " ";
            DatReturn.Format       = DateTimePickerFormat.Custom;

            if (e.RowIndex > -1)
            {
                DataGridViewRow data = GrdRentalTbl.Rows[e.RowIndex];
                TxtIdx.Text             = data.Cells[0].Value.ToString();
                CboMember.SelectedIndex = CboMember.FindString(data.Cells[1].Value.ToString());
                CboBooks.SelectedIndex  = CboBooks.FindString(data.Cells[3].Value.ToString());
                DatRental.CustomFormat  = "yyyy-MM-dd";
                DatRental.Format        = DateTimePickerFormat.Custom;
                DatRental.Value         = DateTime.Parse(data.Cells[5].Value.ToString());

                if (!string.IsNullOrEmpty(data.Cells[6].Value.ToString()))
                {
                    DatReturn.CustomFormat = "yyyy-MM-dd";
                    DatReturn.Format       = DateTimePickerFormat.Custom;
                    DatReturn.Value        = DateTime.Parse(data.Cells[6].Value.ToString());
                }

                mode = "UPDATE";
            }
        }
Exemplo n.º 2
0
 private void ClearTextControls()
 {
     TxtIdx.Text                = "";
     TxtIdx.ReadOnly            = true;
     CboBook.SelectedIndex      = -1;
     CboMember.SelectedIndex    = -1;
     DtpRentalDate.Format       = DateTimePickerFormat.Custom;
     DtpRentalDate.CustomFormat = " ";
     DtpReturnDate.Format       = DateTimePickerFormat.Custom;
     DtpReturnDate.CustomFormat = " ";
     CboMember.Focus();
 }
Exemplo n.º 3
0
        private void GrdDivTbl_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                DataGridViewRow data = GrdrentalTbl.Rows[e.RowIndex];
                TxtIdx.Text = data.Cells[0].Value.ToString();
                //  TxtAuthor.Text = data.Cells[1].Value.ToString();
                TxtIdx.ReadOnly         = true;
                TxtIdx.BackColor        = Color.Beige;
                CboBook.SelectedIndex   = CboBook.FindString(data.Cells[3].Value.ToString());
                CboMember.SelectedIndex = CboMember.FindString(data.Cells[1].Value.ToString());
                //  TxtNames.Text = data.Cells[4].Value.ToString();

                DtpRentalDate.CustomFormat = "yyyy-MM-dd";
                DtpRentalDate.Format       = DateTimePickerFormat.Custom;
                DtpRentalDate.Value        = DateTime.Parse(data.Cells[5].Value.ToString());

                if (string.IsNullOrEmpty(data.Cells[6].Value.ToString()))
                {
                    DtpReturnDate.CustomFormat = " ";
                    DtpReturnDate.Format       = DateTimePickerFormat.Custom;
                }
                else
                {
                    DtpReturnDate.CustomFormat = "yyyy-MM-dd";
                    DtpReturnDate.Format       = DateTimePickerFormat.Custom;
                    DtpReturnDate.Value        = DateTime.Parse(data.Cells[6].Value.ToString());
                }


                //  TxtISBN.Text = data.Cells[6].Value.ToString();
                // TxtPrice.Text = data.Cells[7].Value.ToString();

                mode = "UPDATE";
            }
        }