Exemple #1
0
        private async Task Load_Datagridview1_Data_By_Date()
        {
            try
            {
                pbxBorrowingBalance.Visible = true;
                DateTime dt    = Convert.ToDateTime(dtpBorrowingBalance.Value);
                String   s1    = dt.ToString("yyyy-MM-dd");
                DateTime dtnew = Convert.ToDateTime(s1);

                var source = new BindingSource();
                source.DataSource = await _borrowRepository.GetAllUndepositedByDate(dtnew);

                dgvBorrowingBalance.AutoGenerateColumns           = true;
                dgvBorrowingBalance.DataSource                    = source;
                dgvBorrowingBalance.Columns["Id"].Visible         = false;
                dgvBorrowingBalance.Columns["IsReturned"].Visible = false;
                dgvBorrowingBalance.Columns["ReturnDate"].Visible = false;
                pbxBorrowingBalance.Visible = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }