Exemplo n.º 1
0
        //protected void uoDropDownListRegion_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    BindCountry();
        //    UpdatePanel2.Update();
        //}
        #endregion

        #region METHODS

        ///// <summary>
        ///// Date Created: 03/10/2011
        ///// Created By: Charlene Remotigue
        ///// Description: binds all regions to dropdownlist
        ///// </summary>
        //private void BindRegion()
        //{
        //    DataTable RegionDataTable = null;
        //    try
        //    {
        //        RegionDataTable = CountryBLL.MapListByUser(GlobalCode.Field2String(Session["UserName"]));

        //        uoDropDownListRegion.Items.Clear();
        //        ListItem item = new ListItem("--Select Region--", "0");
        //        uoDropDownListRegion.Items.Add(item);
        //        uoDropDownListRegion.DataSource = RegionDataTable;
        //        uoDropDownListRegion.DataTextField = "colMapNameVarchar";
        //        uoDropDownListRegion.DataValueField = "colMapIDInt";
        //        uoDropDownListRegion.DataBind();

        //        item = new ListItem("--Select Country--", "0");
        //        uoDropDownListCountry.Items.Add(item);

        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        if (RegionDataTable != null)
        //        {
        //            RegionDataTable.Dispose();
        //        }
        //    }
        //}

        /// <summary>
        /// Date Created: 03/10/2011
        /// Created By: Charlene Remotigue
        /// Descrition: binds country to dropdownlist
        /// </summary>

        private void BindCountry()
        {
            DataTable CountryDataTable = null;

            try
            {
                //CountryDataTable = CountryBLL.CountryListByRegion(uoDropDownListRegion.SelectedValue, "");
                CountryDataTable = CountryBLL.CountryList();
                uoDropDownListCountry.Items.Clear();
                ListItem item = new ListItem("--Select Country--", "0");
                uoDropDownListCountry.Items.Add(item);
                uoDropDownListCountry.DataSource     = CountryDataTable;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (CountryDataTable != null)
                {
                    CountryDataTable.Dispose();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Date Created: 01/08/2011
        /// Created By: Marco Abejar
        /// (description) Loads port city to dropdownlist
        /// -----------------------------------------------
        /// Date Edited:    18/07/2012
        /// Created By:     Jefferson Bermundo
        /// (description)   Remove-- Port city not being used
        /// </summary>
        //private void PortCityLoad(int CountryID)
        //{
        //    DataTable dt = new DataTable();
        //    dt = CityBLL.CityListbyCountry(CountryID);
        //    if (dt.Rows.Count > 0)
        //    {
        //        uoDropDownListCity.DataSource = dt;
        //        uoDropDownListCity.DataTextField = "colCityNameVarchar";
        //        uoDropDownListCity.DataValueField = "colCityIDInt";
        //        uoDropDownListCity.DataBind();
        //        uoDropDownListCity.Items.Insert(0, new ListItem("- Select a City -", ""));
        //    }
        //    else
        //    {
        //        uoDropDownListCity.DataBind();
        //    }
        //}

        private void PortCountryLoad()
        {
            /// <summary>
            /// Date Created: 01/08/2011
            /// Created By: Marco Abejar
            /// (description) Loads port country to dropdownlist
            /// </summary>

            DataTable dt = new DataTable();

            dt = CountryBLL.CountryList();
            if (dt.Rows.Count > 0)
            {
                uoDropDownListCountry.DataSource     = dt;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
                uoDropDownListCountry.Items.Insert(0, new ListItem("- Select a Country -", ""));
                uoDropDownListCountry.SelectedValue = dt.Rows[0]["colCountryIDInt"].ToString();
            }
            else
            {
                uoDropDownListCountry.DataBind();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Date Created: 29/07/2011
        /// Created By: Gabriel Oquialda
        /// (description) Loads vendor city to dropdownlist
        /// -----------------------------------------------------
        /// Date Modified:  05/Aug/2013
        /// Created By:     Josephine Gad
        /// (description)   Change Datatable to Session
        /// -----------------------------------------------------
        /// </summary>
        private void vendorCountryLoad()
        {
            List <CountryList> listCountry = new List <CountryList>();

            uoDropDownListCountry.Items.Clear();
            if (Session["CountryList"] != null)
            {
                listCountry = ((List <CountryList>)Session["CountryList"]);
                uoDropDownListCountry.DataSource     = listCountry;
                uoDropDownListCountry.DataTextField  = "CountryName";
                uoDropDownListCountry.DataValueField = "CountryId";
            }
            else
            {
                DataTable dtCountry = CountryBLL.CountryList();
                if (dtCountry.Rows.Count > 0)
                {
                    listCountry = (from a in dtCountry.AsEnumerable()
                                   select new CountryList
                    {
                        CountryId = GlobalCode.Field2Int(a["colCountryIDInt"]),
                        CountryName = GlobalCode.Field2String(a["colCountryNameVarchar"]),
                    }).ToList();

                    uoDropDownListCountry.DataSource     = listCountry;
                    uoDropDownListCountry.DataTextField  = "CountryName";
                    uoDropDownListCountry.DataValueField = "CountryId";

                    HttpContext.Current.Session["CountryList"] = listCountry;
                }
            }
            uoDropDownListCountry.Items.Insert(0, (new ListItem("--Select Country--", "0")));
            uoDropDownListCountry.DataBind();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Date Created: 07/09/2011
        /// Created By: Gabriel Oquialda
        /// (description) Select country list by vendor id
        /// </summary>
        private void countryList()
        {
            DataTable dt = new DataTable();

            dt = CountryBLL.CountryList();
            if (dt.Rows.Count > 0)
            {
                uoDropDownListCountry.DataSource     = dt;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
                uoDropDownListCountry.Items.Insert(0, new ListItem("--Select a Country--", "0"));
            }
            else
            {
                uoDropDownListCountry.DataBind();
            }

            //DataTable dt = null;
            //try
            //{
            //    uoDropDownListCountry.Items.Clear();
            //    dt = VendorMaintenanceBLL.countryList();
            //    if (dt.Rows.Count > 0)
            //    {
            //        uoDropDownListCountry.DataSource = dt;
            //        uoDropDownListCountry.DataTextField = "colCountryNameVarchar";
            //        uoDropDownListCountry.DataValueField = "colCountryIDInt";
            //        uoDropDownListCountry.DataBind();
            //    }
            //    else
            //    {
            //        uoDropDownListCountry.DataBind();
            //    }

            //    uoDropDownListCountry.Items.Insert(0, (new ListItem("--Select Country--", "0")));
            //    if (dt.Rows.Count == 1)
            //    {
            //        uoDropDownListCountry.SelectedIndex = 1;
            //    }
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    if (dt != null)
            //    {
            //        dt.Dispose();
            //    }
            //}
        }
Exemplo n.º 5
0
        /// <summary>
        /// Date Created: 29/07/2011
        /// Created By: Gabriel Oquialda
        /// (description) Loads vendor city to dropdownlist
        /// </summary>
        private void vendorCountryLoad()
        {
            DataTable dt = new DataTable();

            dt = CountryBLL.CountryList();
            if (dt.Rows.Count > 0)
            {
                uoDropDownListCountry.DataSource     = dt;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
                uoDropDownListCountry.Items.Insert(0, new ListItem("- Select a Country -", ""));
                uoDropDownListCountry.SelectedValue = dt.Rows[0]["colCountryIDInt"].ToString();
            }
            else
            {
                uoDropDownListCountry.DataBind();
            }
        }
        /// <summary>
        /// Date Created:   05/Nov/2013
        /// Created By:     Josephine Gad
        /// (description)   Change Datatable to Session
        /// -----------------------------------------------------
        /// </summary>
        private void vendorCountryLoad()
        {
            DataTable dt = null;

            try
            {
                List <CountryList> listCountry = new List <CountryList>();

                uoDropDownListCountry.Items.Clear();
                if (Session["CountryList"] != null)
                {
                    listCountry = ((List <CountryList>)Session["CountryList"]);
                    uoDropDownListCountry.DataSource     = listCountry;
                    uoDropDownListCountry.DataTextField  = "CountryName";
                    uoDropDownListCountry.DataValueField = "CountryId";
                }
                else
                {
                    dt = CountryBLL.CountryList();
                    if (dt.Rows.Count > 0)
                    {
                        uoDropDownListCountry.DataSource     = dt;
                        uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                        uoDropDownListCountry.DataValueField = "colCountryIDInt";
                    }
                }

                uoDropDownListCountry.Items.Insert(0, (new ListItem("--Select Country--", "0")));
                uoDropDownListCountry.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        private void CompanyCountryLoad()
        {
            /// <summary>
            /// Date Created: 29/07/2011
            /// Created By: Gabriel Oquialda
            /// (description) Loads vendor city to dropdownlist
            /// </summary>

            DataTable dt = new DataTable();

            dt = CountryBLL.CountryList();
            if (dt.Rows.Count > 0)
            {
                uoDropDownListCountry.DataSource     = dt;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
                uoDropDownListCountry.Items.Insert(0, new ListItem("- Select Country -", ""));
            }
            else
            {
                uoDropDownListCountry.DataBind();
            }
        }