/// <summary>
        /// Date Created:   06/07/2012
        /// Created By:     Josephine Gad
        /// (description)   Load Port List using session
        /// </summary>
        private void BindPortList()
        {
            List <PortList> list = new List <PortList>();

            try
            {
                list = PortBLL.GetPortListByRegion(uoHiddenFieldUser.Value, uoDropDownListRegion.SelectedValue, "", uoTextBoxSearchSeaport.Text.Trim());

                uoDropDownListSeaport.Items.Clear();
                ListItem item = new ListItem("--SELECT PORT--", "0");
                uoDropDownListSeaport.Items.Add(item);
                if (list.Count > 0)
                {
                    uoDropDownListSeaport.DataSource     = list;
                    uoDropDownListSeaport.DataTextField  = "PORTName";
                    uoDropDownListSeaport.DataValueField = "PORTID";
                    uoDropDownListSeaport.DataBind();

                    if (GlobalCode.Field2String(Session["Port"]) != "")
                    {
                        if (uoDropDownListSeaport.Items.FindByValue(GlobalCode.Field2String(Session["Port"])) != null)
                        {
                            uoDropDownListSeaport.SelectedValue = GlobalCode.Field2String(Session["Port"]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        /// <summary>
        /// Date Created:   17/Jul/2014
        /// Created By:     Josephine Monteza
        /// (description)   Bind Seaport
        /// </summary>
        private void BindSeaport(Int16 iLoadType)
        {
            List <SeaportDTO> list = new List <SeaportDTO>();

            if (iLoadType == 0)
            {
                if (Session["VehicleVendor_Seaport"] != null)
                {
                    list = (List <SeaportDTO>)Session["VehicleVendor_Seaport"];
                }
            }
            else
            {
                List <PortList> listSeaport = new List <PortList>();

                string sRegion = GlobalCode.Field2Int(uoDropDownListRegion.SelectedValue).ToString();
                listSeaport = PortBLL.GetPortListByRegion(uoHiddenFieldUser.Value, uoDropDownListRegion.SelectedValue, "", "");

                list = (from a in listSeaport
                        select new SeaportDTO
                {
                    SeaportIDString = a.PortId.ToString(),
                    SeaportNameString = a.PortName
                }).ToList();
            }
            uoDropDownListSeaport.Items.Clear();
            ListItem item = new ListItem("--Select Seaport--", "0");

            uoDropDownListSeaport.Items.Add(item);

            uoDropDownListSeaport.DataSource     = list;
            uoDropDownListSeaport.DataTextField  = "SeaportNameString";
            uoDropDownListSeaport.DataValueField = "SeaportIDString";
            uoDropDownListSeaport.DataBind();

            string sSeaport = GlobalCode.Field2String(Session["SeaportID"]);

            if (uoDropDownListSeaport.Items.FindByValue(sSeaport) != null)
            {
                uoDropDownListSeaport.SelectedValue = sSeaport;
            }
        }