protected void DDLFleet_SelectedIndexChanged() { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); StringBuilder sbFilterFlt = new StringBuilder(); string VslFilter = ""; foreach (DataRow dr in DDLFleet.SelectedValues.Rows) { sbFilterFlt.Append(dr[0]); sbFilterFlt.Append(","); } DataTable dtVesselF = objVsl.Get_VesselList(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString())); if (sbFilterFlt.Length > 1) { sbFilterFlt.Remove(sbFilterFlt.Length - 1, 1); VslFilter = string.Format("fleetCode in (" + sbFilterFlt.ToString() + ")"); dtVesselF.DefaultView.RowFilter = VslFilter; } DDLVesselF.DataSource = dtVesselF; DDLVesselF.DataTextField = "Vessel_name"; DDLVesselF.DataValueField = "Vessel_id"; DDLVesselF.DataBind(); Session["sVesselCode"] = DDLVesselF.SelectedValues; Session["sFleet"] = DDLFleet.SelectedValues; }
public void FillDDLF() { try { BLL_Infra_VesselLib objVsl = new BLL_Infra_VesselLib(); DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLFleet.DataSource = FleetDT; DDLFleet.DataTextField = "Name"; DDLFleet.DataValueField = "code"; DDLFleet.DataBind(); DataTable dtVessel = objVsl.Get_VesselList(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString())); DDLVesselF.DataSource = dtVessel; DDLVesselF.DataTextField = "Vessel_name"; DDLVesselF.DataValueField = "Vessel_id"; DDLVesselF.DataBind(); } catch (Exception ex) { } finally { } }