protected void GetUsersBillsForSite(object sender, DirectEventArgs e) { if (BillDateField.SelectedValue != null && FilterUsersBySite.SelectedItem != null) { int siteId = Convert.ToInt32(FilterUsersBySite.SelectedItem.Value); DateTime beginningOfTheMonth = new DateTime(BillDateField.SelectedDate.Year, BillDateField.SelectedDate.Month, 1); DateTime endOfTheMonth = beginningOfTheMonth.AddMonths(1).AddDays(-1); UsersBillsGrid.GetStore().DataSource = GetUsersBills(siteId, beginningOfTheMonth, endOfTheMonth); UsersBillsGrid.GetStore().DataBind(); } }
protected void FilterUsersBySite_Selected(object sender, DirectEventArgs e) { if (FilterUsersBySite.SelectedItem.Index != -1 && !string.IsNullOrEmpty(FilterUsersBySite.SelectedItem.Value)) { BillDateField.Disabled = false; if (BillDateField.SelectedValue != null) { int siteId = Convert.ToInt32(FilterUsersBySite.SelectedItem.Value); DateTime beginningOfTheMonth = new DateTime(BillDateField.SelectedDate.Year, BillDateField.SelectedDate.Month, 1); DateTime endOfTheMonth = beginningOfTheMonth.AddMonths(1).AddDays(-1); UsersBillsGrid.GetStore().DataSource = GetUsersBills(siteId, beginningOfTheMonth, endOfTheMonth); UsersBillsGrid.GetStore().DataBind(); } } else { BillDateField.Disabled = true; //BillDateField.Clear(); //UsersBillsGrid.ClearContent(); } }