protected void Load_Years() { DataSet dsdate = BLL_PB_PortageBill.Get_PB_YearMonth(null); ddlYear.DataSource = dsdate.Tables[0]; ddlYear.DataTextField = "pbyear"; ddlYear.DataValueField = "pbyear"; ddlYear.DataBind(); ddlMonth.DataSource = dsdate.Tables[1]; ddlMonth.DataTextField = "smonth"; ddlMonth.DataValueField = "imonth"; ddlMonth.DataBind(); ddlYear.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); ddlMonth.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); if (ddlYear.Items.FindByValue(DateTime.Now.Year.ToString()) != null) { ddlYear.Items.FindByValue(DateTime.Now.Year.ToString()).Selected = true; } if (ddlMonth.Items.FindByValue(DateTime.Now.Month.ToString()) != null) { ddlMonth.Items.FindByValue(DateTime.Now.Month.ToString()).Selected = true; } }
protected void ddlYear_SelectedIndexChanged(object sender, EventArgs e) { DataSet dsdate = BLL_PB_PortageBill.Get_PB_YearMonth(UDFLib.ConvertIntegerToNull(ddlYear.SelectedValue.ToString())); ddlMonth.ClearSelection(); ddlMonth.DataSource = dsdate.Tables[1]; ddlMonth.DataTextField = "smonth"; ddlMonth.DataValueField = "imonth"; ddlMonth.DataBind(); ddlMonth.Items.Insert(0, new ListItem("-SELECT ALL-", "0")); if (ViewState["Month"] != null && ViewState["Month"] != "0") { if (dsdate.Tables[1].Rows.Count > 0) { DataRow[] result = dsdate.Tables[1].Select("imonth = '" + UDFLib.ConvertIntegerToNull(ViewState["Month"].ToString()) + "' "); if (result.Length > 0) { ddlMonth.SelectedValue = ViewState["Month"].ToString(); } else { ddlMonth.SelectedIndex = 0; ViewState["Month"] = null; } } } Load_PB_Received(); int Fleet_ID = UDFLib.ConvertToInteger(ddlFleet.SelectedValue); int Vessel_ID = UDFLib.ConvertToInteger(ddlVessel.SelectedValue); int?Month = UDFLib.ConvertIntegerToNull(ddlMonth.SelectedValue); int?Year = UDFLib.ConvertIntegerToNull(ddlYear.SelectedValue); int iscount = ucCustomPagerPB.isCountRecord; }