/// <summary> /// Date Created: 06/07/2012 /// Created By: Josephine Gad /// (description) Load Port List /// </summary> private void BindPortList() { List <PortList> list = new List <PortList>(); try { list = PortBLL.GetPortListByRegionCountry(GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue, "0", ""); uoDropDownListPortPerRegion.Items.Clear(); ListItem item = new ListItem("--SELECT PORT--", "0"); uoDropDownListPortPerRegion.Items.Add(item); if (list.Count > 0) { uoDropDownListPortPerRegion.DataSource = list; uoDropDownListPortPerRegion.DataTextField = "PORTName"; uoDropDownListPortPerRegion.DataValueField = "PORTID"; uoDropDownListPortPerRegion.DataBind(); if (GlobalCode.Field2String(Session["Port"]) != "") { if (uoDropDownListPortPerRegion.Items.FindByValue(GlobalCode.Field2String(Session["Port"])) != null) { uoDropDownListPortPerRegion.SelectedValue = GlobalCode.Field2String(Session["Port"]); } } } } catch (Exception ex) { throw ex; } }
/// <summary> /// Author: Josephine Gad /// Date Created: 15/08/2012 /// Description: Bind Seaport /// </summary> private void BindSeaport() { List <PortList> port = new List <PortList>(); port = PortBLL.GetPortListByRegionCountry(GlobalCode.Field2String(Session["UserName"]), "0", "0", uoHiddenFieldRole.Value); uoDropDownListPort.Items.Clear(); if (port.Count > 0) { uoDropDownListPort.DataSource = port; uoDropDownListPort.DataTextField = "PortName"; uoDropDownListPort.DataValueField = "PortId"; } uoDropDownListPort.DataBind(); if (port.Count == 1) { if (uoDropDownListPort.Items.FindByValue(GlobalCode.Field2String(port[0].PortId)) != null) { uoDropDownListPort.SelectedValue = GlobalCode.Field2String(port[0].PortId); } } if (GlobalCode.Field2String(Session["Port"]) != "") { if (uoDropDownListPort.Items.FindByValue(GlobalCode.Field2String(Session["Port"])) != null) { uoDropDownListPort.SelectedValue = GlobalCode.Field2String(Session["Port"]); } } uoDropDownListPort.Items.Insert(0, new ListItem("--Select Seaport--", "0")); Session["Port"] = uoDropDownListPort.SelectedValue; }
/// <summary> /// Date Created: 28/09/2011 /// Created By: Josephine Gad /// (description) Get port by user and city /// --------------------------------------------------------------------------- /// Date Modified: 06/07/2012 /// Modified By: Josephine Gad /// (description) Change DataTable to List and use session /// </summary> private void BindPort() { List <PortList> list = new List <PortList>(); try { //PortDataTable = PortBLL.GetPortListByCity(Session["UserName"].ToString(), uoDropDownListCity.SelectedValue); GetPortListByRegion //PortDataTable = PortBLL.GetPortListByCity(TravelMartVariable.TreadUserID, uoDropDownListCity.SelectedValue); //list = PortBLL.GetPortListByRegionCountry(GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue, uoDropDownListCountry.SelectedValue); list = PortBLL.GetPortListByRegionCountry(GlobalCode.Field2String(Session["UserName"]), uoDropDownListRegion.SelectedValue, "0", ""); uoDropDownListPort.Items.Clear(); ListItem item = new ListItem("--Select Port--", "0"); uoDropDownListPort.Items.Add(item); if (list.Count > 0) { uoDropDownListPort.DataSource = list; uoDropDownListPort.DataTextField = "PORTName"; uoDropDownListPort.DataValueField = "PORTID"; uoDropDownListPort.DataBind(); if (GlobalCode.Field2String(Session["Port"]) != "") { if (uoDropDownListPort.Items.FindByValue(GlobalCode.Field2String(Session["Port"])) != null) { uoDropDownListPort.SelectedValue = GlobalCode.Field2String(Session["Port"]); } } } } catch (Exception ex) { throw ex; } }