Exemplo n.º 1
0
        protected void LoadRegion()
        {
            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();

                if (GlobalCode.Field2String(Session["Region"]) != "")
                {
                    if (uoDropDownListRegion.Items.FindByValue(GlobalCode.Field2String(Session["Region"])) != null)
                    {
                        uoDropDownListRegion.SelectedValue = GlobalCode.Field2String(Session["Region"]);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RegionDataTable != null)
                {
                    RegionDataTable.Dispose();
                }
            }
        }
Exemplo n.º 2
0
        private void BindMapRef()
        {
            DataTable MapRefDataTable = null;

            try
            {
                MapRefDataTable = CountryBLL.MapListByUser(GlobalCode.Field2String(Session["UserName"]));
                uoDropDownListMapRef.Items.Clear();
                ListItem item = new ListItem("--Select Region--", "0");
                uoDropDownListMapRef.Items.Add(item);
                uoDropDownListMapRef.DataSource     = MapRefDataTable;
                uoDropDownListMapRef.DataTextField  = "colMapNameVarchar";
                uoDropDownListMapRef.DataValueField = "colMapIDInt";
                uoDropDownListMapRef.DataBind();

                //CommonFunctions.ChangeToUpperCase(uoDropDownListMapRef);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (MapRefDataTable != null)
                {
                    MapRefDataTable.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created: 19/08/2011
        /// Created By: Marco Abejar
        /// (description) Bind assigned region
        /// </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  = "colRegionNameVarchar";
                uoDropDownListRegion.DataValueField = "colRegionIDInt";
                uoDropDownListRegion.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RegionDataTable != null)
                {
                    RegionDataTable.Dispose();
                }
            }
        }