Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Form.Enctype          = "multipart/form-data";
            lblDetailsRequired.Visible = false;
            if (!Page.IsPostBack)
            {
                bool EnableFullMode = (SecurityManager.IsStaffOrAdmin);

                TypeDropDownList.DataSource = SettingsManager.TicketTypesList;
                TypeDropDownList.DataBind();

                PriorityDropDownList.DataSource = SettingsManager.PrioritiesList;
                PriorityDropDownList.DataBind();

                CategoryDropDownList.DataSource = SettingsManager.CategoriesList;
                CategoryDropDownList.DataBind();

                PriorityDropDownList.Enabled = (SecurityManager.SubmitterCanEditPriority || EnableFullMode);


                OwnerUpdatePanel.Visible = EnableFullMode;

                OwnerDropDownList.Items.AddRange(GetOwnerUserList());
            }
        }
Пример #2
0
        private void GetMaType()
        {
            string    sql = "SELECT DISTINCT TY_ID,TY_NAME FROM TBMA_TYPEINFO WHERE TY_FATHERID='ROOT' ORDER BY TY_ID";
            DataTable dt  = DBCallCommon.GetDTUsingSqlText(sql);

            TypeDropDownList.DataSource     = dt;
            TypeDropDownList.DataTextField  = "TY_NAME";
            TypeDropDownList.DataValueField = "TY_ID";
            TypeDropDownList.DataBind();
            ListItem item = new ListItem("--请选择--", "0");

            TypeDropDownList.Items.Insert(0, item);
        }
Пример #3
0
 protected void FillDropDownList()
 {
     try
     {
         Query = "select type_id , name from ItemType";
         dt    = cc.GetData(Query);
         TypeDropDownList.DataValueField = "type_id";
         TypeDropDownList.DataTextField  = "name";
         TypeDropDownList.DataSource     = dt;
         TypeDropDownList.DataBind();
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('" + ex.Message + "');</script>");
     }
 }
        public override void DataBind()
        {
            base.DataBind();

            //load data & default selections
            TypeDropDownList.DataSource = EnumUtils.GetList <SelectableMetadataType>();
            TypeDropDownList.DataBind();

            DepthDropDownList.DataSource = Enumerable.Range(2, Settings.MaxSelectableMetadataDepth);
            DepthDropDownList.DataBind();

            SortTypeRadioButtonList.DataSource = EnumUtils.GetList <SelectableMetadataSortType>();
            SortTypeRadioButtonList.DataBind();
            SortTypeRadioButtonList.SelectedValue = ((int)SelectableMetadataSortType.AlphaNumeric).ToString();

            OrderTypeRadioButtonList.DataSource = EnumUtils.GetList <SelectableMetadataOrderType>();
            OrderTypeRadioButtonList.DataBind();

            ColumnsDropDownList.DataSource = Enumerable.Range(1, 10);
            ColumnsDropDownList.DataBind();

            ApplySelectableTypeLogicToControls();

            //init controls depending on supplied selectable metadata setting);
            if (setting != null && BrandMetadataSelectableSettingId > 0)
            {
                TypeDropDownList.SelectedValue         = setting.SelectableType.ToString();
                DepthDropDownList.SelectedValue        = setting.Depth.ToString();
                SortTypeRadioButtonList.SelectedValue  = setting.SortType.ToString();
                OrderTypeRadioButtonList.SelectedValue = setting.OrderType.ToString();
                ColumnsDropDownList.SelectedValue      = setting.ColumnCount.ToString();

                LinearCheckBox.Checked        = setting.IsLinear;
                AllowMultipleCheckbox.Checked = setting.AllowMultiple;

                if (setting.SelectableType == (int)SelectableMetadataType.Checkboxes)
                {
                    LayoutOptionsPanel.Visible = setting.IsLinear;
                }
            }
        }