protected void DataBindBlackListLogGridView(BlackListLogSearchDTO criteria) { using (UserManager um = new UserManager()) { List<DAL.BlacklistLog> blacklistLogs = um.FindBlacklistLogByCriteria(criteria); this.BlackListLogGridView.DataSource = blacklistLogs; this.BlackListLogGridView.DataBind(); } }
protected void SearchButton_Click(object sender, EventArgs e) { try { BlackListLogSearchDTO criteria = new BlackListLogSearchDTO(); DateTime StartDate = DateTime.MinValue; DateTime EndDate = DateTime.MaxValue; if (StartBlackListedDateTextBox.Text.Trim() != "") StartDate = DateTime.Parse(StartBlackListedDateTextBox.Text); if (EndBlackListedDateTextBox.Text.Trim() != "") EndDate = DateTime.Parse(EndBlackListedDateTextBox.Text); criteria.DepartmentID = Convert.ToInt32(this.DepartmentDropDownList.SelectedValue); criteria.StartDateBlackListed = StartDate; criteria.EndDateBlackListed = EndDate; DataBindBlackListLogGridView(criteria); } catch (FormatException) { this.ErrorMessage.Text = "Please enter valid date."; } }
public List<BlacklistLog> FindBlacklistLogByCriteria(BlackListLogSearchDTO criteria) { return udao.FindBlacklistLogsByCriteria(criteria); }