private async void LoadData() { /*string date = dtpHistory.Value.ToShortDateString();*/ Attendances attendances = await _attendancesRepository.GetByDateTimeAsync(dtpHistory.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat)); List <Attendances> listAttendances = new List <Attendances>(); listAttendances.Add(attendances); dgvCheckAttendanceHistory.DataSource = listAttendances; }
private async void LoadAttendace() { try { List <Attendances> listAttendances = await _attendancesRepository.GetByDateTimeAsync(dtpAttendanceHistory.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat)); if (listAttendances == null) { return; } dgvCheckAttendanceHistory.DataSource = listAttendances; dgvCheckAttendanceHistory.Columns["users"].Visible = false; dgvCheckAttendanceHistory.AutoResizeColumns(); dgvCheckAttendanceHistory.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; } catch (Exception) { } }