protected void LoadForMonth() { try { DdlMonth.Items.Clear(); DdlMonthDet.Items.Clear(); DateTime now = new DateTime(); now = DateTime.Today; for (int i = -11; i < 2; i++) { DateTime date = now.AddMonths(i); DdlMonth.Items.Add( new ListItem(date.ToString("MMM yyyy"), date.ToString("MMM yyyy"))); DdlMonthDet.Items.Add( new ListItem(date.ToString("MMM yyyy"), date.ToString("MMM yyyy"))); } DdlMonth.DataBind(); DdlMonthDet.DataBind(); DdlMonth.Items.Insert(0, "Please Select"); DdlMonthDet.Items.Insert(0, "Please Select"); DdlMonth.SelectedValue = now.ToString("MMM yyyy"); DdlMonthDet.SelectedValue = now.ToString("MMM yyyy"); } catch (Exception ex) { } }
public void FillMonthSale() { Object SaleMonth = new Object(); SaleMonth.Year = DdlYear1.SelectedValue; SaleMonth.Month = DdlMonth.SelectedValue; DataTable dt = BSLAYER.MonthSale(SaleMonth); GridView2.DataSource = dt; GridView2.DataBind(); DdlYear1.ClearSelection(); DdlMonth.ClearSelection(); }