Exemplo n.º 1
0
        /// <summary>
        /// Returns initialized selection control according to the specified selection type.
        /// </summary>
        private Control GetSelectionControl()
        {
            if (this.OptionCategory != null)
            {
                switch (this.OptionCategory.CategorySelectionType)
                {
                    // Dropdownlist
                    case OptionCategorySelectionTypeEnum.Dropdownlist:

                        LocalizedDropDownList dropDown = new LocalizedDropDownList();
                        dropDown.ID = "dropdown";
                        dropDown.DataTextField = "SKUName";
                        dropDown.DataValueField = "SKUID";
                        dropDown.DataBound += new EventHandler(SelectionControl_DataBound);
                        return dropDown;

                    // Checkbox list with horizontal direction
                    case OptionCategorySelectionTypeEnum.CheckBoxesHorizontal:

                        LocalizedCheckBoxList boxListHorizontal = new LocalizedCheckBoxList();
                        boxListHorizontal.ID = "chkHorizontal";
                        boxListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                        boxListHorizontal.DataTextField = "SKUName";
                        boxListHorizontal.DataValueField = "SKUID";
                        boxListHorizontal.DataBound += new EventHandler(SelectionControl_DataBound);
                        return boxListHorizontal;

                    // Checkbox list with vertical direction
                    case OptionCategorySelectionTypeEnum.CheckBoxesVertical:

                        LocalizedCheckBoxList boxListVertical = new LocalizedCheckBoxList();
                        boxListVertical.ID = "chkVertical";
                        boxListVertical.RepeatDirection = RepeatDirection.Vertical;
                        boxListVertical.DataTextField = "SKUName";
                        boxListVertical.DataValueField = "SKUID";
                        boxListVertical.DataBound += new EventHandler(SelectionControl_DataBound);
                        return boxListVertical;

                    // Radiobuton list with horizontal direction
                    case OptionCategorySelectionTypeEnum.RadioButtonsHorizontal:

                        LocalizedRadioButtonList buttonListHorizontal = new LocalizedRadioButtonList();
                        buttonListHorizontal.ID = "radHorizontal";
                        buttonListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                        buttonListHorizontal.DataTextField = "SKUName";
                        buttonListHorizontal.DataValueField = "SKUID";
                        buttonListHorizontal.DataBound += new EventHandler(SelectionControl_DataBound);
                        return buttonListHorizontal;

                    // Radiobuton list with vertical direction
                    case OptionCategorySelectionTypeEnum.RadioButtonsVertical:

                        LocalizedRadioButtonList buttonListVertical = new LocalizedRadioButtonList();
                        buttonListVertical.ID = "radVertical";
                        buttonListVertical.RepeatDirection = RepeatDirection.Vertical;
                        buttonListVertical.DataTextField = "SKUName";
                        buttonListVertical.DataValueField = "SKUID";
                        buttonListVertical.DataBound += new EventHandler(SelectionControl_DataBound);
                        return buttonListVertical;

                    // Text box
                    case OptionCategorySelectionTypeEnum.TextBox:

                        TextBox text = new TextBoxWithLabel();
                        text.ID = "txtText";
                        text.CssClass = "TextBoxField";
                        return text;

                    // Text area
                    case OptionCategorySelectionTypeEnum.TextArea:

                        TextBox textarea = new TextBoxWithLabel();
                        textarea.ID = "txtArea";
                        textarea.CssClass = "TextAreaField";
                        textarea.TextMode = TextBoxMode.MultiLine;
                        return textarea;
                }
            }

            return null;
        }
        /// <summary>
        /// Returns initialized selection control according to the specified selection type.
        /// </summary>
        private Control GetSelectionControl()
        {
            if (OptionCategory != null)
            {
                switch (OptionCategory.CategorySelectionType)
                {
                // Dropdownlist
                case OptionCategorySelectionTypeEnum.Dropdownlist:

                    LocalizedDropDownList dropDown = new LocalizedDropDownList();
                    dropDown.ID             = "dropdown";
                    dropDown.CssClass       = "DropDownField";
                    dropDown.DataTextField  = "SKUName";
                    dropDown.DataValueField = "SKUID";
                    dropDown.DataBound     += new EventHandler(SelectionControl_DataBound);

                    return(dropDown);

                // Checkbox list with horizontal direction
                case OptionCategorySelectionTypeEnum.CheckBoxesHorizontal:

                    LocalizedCheckBoxList boxListHorizontal = new LocalizedCheckBoxList();
                    boxListHorizontal.ID = "chkHorizontal";
                    boxListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                    boxListHorizontal.DataTextField   = "SKUName";
                    boxListHorizontal.DataValueField  = "SKUID";
                    boxListHorizontal.DataBound      += new EventHandler(SelectionControl_DataBound);

                    return(boxListHorizontal);

                // Checkbox list with vertical direction
                case OptionCategorySelectionTypeEnum.CheckBoxesVertical:

                    LocalizedCheckBoxList boxListVertical = new LocalizedCheckBoxList();
                    boxListVertical.ID = "chkVertical";
                    boxListVertical.RepeatDirection = RepeatDirection.Vertical;
                    boxListVertical.DataTextField   = "SKUName";
                    boxListVertical.DataValueField  = "SKUID";
                    boxListVertical.DataBound      += new EventHandler(SelectionControl_DataBound);

                    return(boxListVertical);

                // Radiobuton list with horizontal direction
                case OptionCategorySelectionTypeEnum.RadioButtonsHorizontal:

                    LocalizedRadioButtonList buttonListHorizontal = new LocalizedRadioButtonList();
                    buttonListHorizontal.ID = "radHorizontal";
                    buttonListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                    buttonListHorizontal.DataTextField   = "SKUName";
                    buttonListHorizontal.DataValueField  = "SKUID";
                    buttonListHorizontal.DataBound      += new EventHandler(SelectionControl_DataBound);

                    return(buttonListHorizontal);

                // Radiobuton list with vertical direction
                case OptionCategorySelectionTypeEnum.RadioButtonsVertical:

                    LocalizedRadioButtonList buttonListVertical = new LocalizedRadioButtonList();
                    buttonListVertical.ID = "radVertical";
                    buttonListVertical.RepeatDirection = RepeatDirection.Vertical;
                    buttonListVertical.DataTextField   = "SKUName";
                    buttonListVertical.DataValueField  = "SKUID";
                    buttonListVertical.DataBound      += new EventHandler(SelectionControl_DataBound);

                    return(buttonListVertical);

                // Text box
                case OptionCategorySelectionTypeEnum.TextBox:

                    TextBox text = new TextBoxWithLabel();
                    text.ID       = "txtText";
                    text.CssClass = "TextBoxField";

                    return(text);

                // Text area
                case OptionCategorySelectionTypeEnum.TextArea:

                    TextBox textarea = new TextBoxWithLabel();
                    textarea.ID       = "txtArea";
                    textarea.CssClass = "TextAreaField";
                    textarea.TextMode = TextBoxMode.MultiLine;

                    return(textarea);

                // Form control
                case OptionCategorySelectionTypeEnum.FormControl:
                    if (!string.IsNullOrEmpty(OptionCategory.CategoryFormControlName))
                    {
                        FormUserControlInfo fui = FormUserControlInfoProvider.GetFormUserControlInfo(OptionCategory.CategoryFormControlName);
                        if (fui != null)
                        {
                            // Load control
                            FormEngineUserControl fc = (FormEngineUserControl)Page.LoadUserControl(FormUserControlInfoProvider.GetFormUserControlUrl(fui));
                            if (fc != null)
                            {
                                fc.ID = "FormControlField";

                                return(fc);
                            }
                        }
                    }

                    return(null);
                }
            }

            return(null);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns initialized selection control according to the specified selection type.
        /// </summary>
        private Control GetSelectionControl()
        {
            if (this.OptionCategory != null)
            {
                switch (this.OptionCategory.CategorySelectionType)
                {
                    // Dropdownlist
                    case OptionCategorySelectionTypeEnum.Dropdownlist:

                        LocalizedDropDownList dropDown = new LocalizedDropDownList();
                        dropDown.ID = "dropdown";
                        dropDown.DataTextField = "SKUName";
                        dropDown.DataValueField = "SKUID";
                        dropDown.DataBound += new EventHandler(SelectionControl_DataBound);
                        return dropDown;

                    // Checkbox list with horizontal direction
                    case OptionCategorySelectionTypeEnum.CheckBoxesHorizontal:

                        LocalizedCheckBoxList boxListHorizontal = new LocalizedCheckBoxList();
                        boxListHorizontal.ID = "chkHorizontal";
                        boxListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                        boxListHorizontal.DataTextField = "SKUName";
                        boxListHorizontal.DataValueField = "SKUID";
                        boxListHorizontal.DataBound += new EventHandler(SelectionControl_DataBound);
                        return boxListHorizontal;

                    // Checkbox list with vertical direction
                    case OptionCategorySelectionTypeEnum.CheckBoxesVertical:

                        LocalizedCheckBoxList boxListVertical = new LocalizedCheckBoxList();
                        boxListVertical.ID = "chkVertical";
                        boxListVertical.RepeatDirection = RepeatDirection.Vertical;
                        boxListVertical.DataTextField = "SKUName";
                        boxListVertical.DataValueField = "SKUID";
                        boxListVertical.DataBound += new EventHandler(SelectionControl_DataBound);
                        return boxListVertical;

                    // Radiobuton list with horizontal direction
                    case OptionCategorySelectionTypeEnum.RadioButtonsHorizontal:

                        LocalizedRadioButtonList buttonListHorizontal = new LocalizedRadioButtonList();
                        buttonListHorizontal.ID = "radHorizontal";
                        buttonListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                        buttonListHorizontal.DataTextField = "SKUName";
                        buttonListHorizontal.DataValueField = "SKUID";
                        buttonListHorizontal.DataBound += new EventHandler(SelectionControl_DataBound);
                        return buttonListHorizontal;

                    // Radiobuton list with vertical direction
                    case OptionCategorySelectionTypeEnum.RadioButtonsVertical:

                        LocalizedRadioButtonList buttonListVertical = new LocalizedRadioButtonList();
                        buttonListVertical.ID = "radVertical";
                        buttonListVertical.RepeatDirection = RepeatDirection.Vertical;
                        buttonListVertical.DataTextField = "SKUName";
                        buttonListVertical.DataValueField = "SKUID";
                        buttonListVertical.DataBound += new EventHandler(SelectionControl_DataBound);
                        return buttonListVertical;

                    // Text box
                    case OptionCategorySelectionTypeEnum.TextBox:

                        TextBox text = new TextBoxWithLabel();
                        text.ID = "txtText";
                        text.CssClass = "TextBoxField";
                        return text;

                    // Text area
                    case OptionCategorySelectionTypeEnum.TextArea:

                        TextBox textarea = new TextBoxWithLabel();
                        textarea.ID = "txtArea";
                        textarea.CssClass = "TextAreaField";
                        textarea.TextMode = TextBoxMode.MultiLine;
                        return textarea;
                }
            }

            return null;
        }
        /// <summary>
        /// Returns initialized selection control according to the specified selection type.
        /// </summary>
        private Control GetSelectionControl()
        {
            if (OptionCategory != null)
            {
                switch (OptionCategory.CategorySelectionType)
                {
                    // Dropdownlist
                    case OptionCategorySelectionTypeEnum.Dropdownlist:

                        LocalizedDropDownList dropDown = new LocalizedDropDownList();
                        dropDown.ID = "dropdown";
                        dropDown.CssClass = "DropDownField";
                        dropDown.DataTextField = "SKUName";
                        dropDown.DataValueField = "SKUID";
                        dropDown.DataBound += new EventHandler(SelectionControl_DataBound);

                        return dropDown;

                    // Checkbox list with horizontal direction
                    case OptionCategorySelectionTypeEnum.CheckBoxesHorizontal:

                        LocalizedCheckBoxList boxListHorizontal = new LocalizedCheckBoxList();
                        boxListHorizontal.ID = "chkHorizontal";
                        boxListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                        boxListHorizontal.DataTextField = "SKUName";
                        boxListHorizontal.DataValueField = "SKUID";
                        boxListHorizontal.DataBound += new EventHandler(SelectionControl_DataBound);

                        return boxListHorizontal;

                    // Checkbox list with vertical direction
                    case OptionCategorySelectionTypeEnum.CheckBoxesVertical:

                        LocalizedCheckBoxList boxListVertical = new LocalizedCheckBoxList();
                        boxListVertical.ID = "chkVertical";
                        boxListVertical.RepeatDirection = RepeatDirection.Vertical;
                        boxListVertical.DataTextField = "SKUName";
                        boxListVertical.DataValueField = "SKUID";
                        boxListVertical.DataBound += new EventHandler(SelectionControl_DataBound);

                        return boxListVertical;

                    // Radiobuton list with horizontal direction
                    case OptionCategorySelectionTypeEnum.RadioButtonsHorizontal:

                        LocalizedRadioButtonList buttonListHorizontal = new LocalizedRadioButtonList();
                        buttonListHorizontal.ID = "radHorizontal";
                        buttonListHorizontal.RepeatDirection = RepeatDirection.Horizontal;
                        buttonListHorizontal.DataTextField = "SKUName";
                        buttonListHorizontal.DataValueField = "SKUID";
                        buttonListHorizontal.DataBound += new EventHandler(SelectionControl_DataBound);

                        return buttonListHorizontal;

                    // Radiobuton list with vertical direction
                    case OptionCategorySelectionTypeEnum.RadioButtonsVertical:

                        LocalizedRadioButtonList buttonListVertical = new LocalizedRadioButtonList();
                        buttonListVertical.ID = "radVertical";
                        buttonListVertical.RepeatDirection = RepeatDirection.Vertical;
                        buttonListVertical.DataTextField = "SKUName";
                        buttonListVertical.DataValueField = "SKUID";
                        buttonListVertical.DataBound += new EventHandler(SelectionControl_DataBound);

                        return buttonListVertical;

                    // Text box
                    case OptionCategorySelectionTypeEnum.TextBox:

                        TextBox text = new TextBoxWithLabel();
                        text.ID = "txtText";
                        text.CssClass = "TextBoxField";

                        return text;

                    // Text area
                    case OptionCategorySelectionTypeEnum.TextArea:

                        TextBox textarea = new TextBoxWithLabel();
                        textarea.ID = "txtArea";
                        textarea.CssClass = "TextAreaField";
                        textarea.TextMode = TextBoxMode.MultiLine;

                        return textarea;

                    // Form control
                    case OptionCategorySelectionTypeEnum.FormControl:
                        if (!string.IsNullOrEmpty(OptionCategory.CategoryFormControlName))
                        {
                            FormUserControlInfo fui = FormUserControlInfoProvider.GetFormUserControlInfo(OptionCategory.CategoryFormControlName);
                            if (fui != null)
                            {
                                // Load control
                                FormEngineUserControl fc = (FormEngineUserControl)Page.LoadUserControl(FormUserControlInfoProvider.GetFormUserControlUrl(fui));
                                if (fc != null)
                                {
                                    fc.ID = "FormControlField";

                                    return fc;
                                }
                            }
                        }

                        return null;
                }
            }

            return null;
        }