private void AttendanceByDay_Search_Click(object sender, RoutedEventArgs e) { try { int ProjectID = int.Parse(txtPId.Text); DateTime date = txtDateFrom.SelectedDate.Value; dgProjectAttendance.DataContext = attendanceBLL.LoadGridPADBLL(ProjectID, date, LoginEntity.UserID); } catch (Exception ex) { Console.WriteLine(ex.Message); } }