Пример #1
0
        private void SetupDropdown()
        {
            var isTesting = SessionVariables.IsTesting;
            var layerData = LayerDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(layerData, drpLayerList, StandardDataModel.StandardDataColumns.Name, LayerDataModel.DataColumns.LayerId);

            if (isTesting)
            {
                drpLayerList.AutoPostBack = true;
                if (drpLayerList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtLayerId.Text.Trim()))
                    {
                        drpLayerList.SelectedValue = txtLayerId.Text;
                    }
                    else
                    {
                        txtLayerId.Text = drpLayerList.SelectedItem.Value;
                    }
                }
                txtLayerId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtLayerId.Text.Trim()))
                {
                    drpLayerList.SelectedValue = txtLayerId.Text;
                }
            }
        }
Пример #2
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("LayerId"))
            {
                var layerData = LayerDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(layerData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, LayerDataModel.DataColumns.LayerId);
            }

            if (fieldName.Equals("GroupBy") || fieldName.Equals("SubGroupBy"))
            {
            }
        }
Пример #3
0
        private int GetNextValidId(int tempId)
        {
            var dt = LayerDataManager.GetList(SessionVariables.RequestProfile);

            foreach (DataRow dr in dt.Rows)
            {
                if (dr[LayerDataModel.DataColumns.LayerId].ToString().Equals(tempId.ToString()))
                {
                    tempId -= 1;
                    return(GetNextValidId(tempId));
                }
            }

            return(tempId);
        }