예제 #1
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            if (panelItem.Type == PanelItemType.Image)
            {
                var image = new Image { ID = panelItem.GetId(), Enabled = false, Width = new Unit(panelItem.Width, UnitType.Pixel), CssClass = ItemStyle };

                panelItem.Target = image;

                return new object[] { image };
            }
            if (panelItem.Type == PanelItemType.InfoIcon)
            {
                var image = new Image
                {
                    ID = panelItem.GetId(),
                    ImageUrl = @"../images/info.png",
                    ToolTip = ResourceManager.GetString(panelItem.Text.IsNullOrEmpty() ? panelItem.GetPropertyName() + "Info" : panelItem.Text),
                    Enabled = false,
                    Width = new Unit(panelItem.Width, UnitType.Pixel),
                    CssClass = ItemStyle
                };

                panelItem.Target = image;

                return new object[] { image };
            }

            return null;
        }
예제 #2
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = SmartValidator.Create(panelItem.GetPropertyName());
            var checkBox = new CheckBox { ID = panelItem.GetId(), Enabled = panelItem.Editable, CssClass = ItemStyle };

            panelItem.Target = checkBox;

            return new object[] { checkBox, validator };
        }
예제 #3
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = SmartValidator.Create(panelItem.GetPropertyName());
            var dropDownList = new DropDownList { ID = panelItem.GetId(), Enabled = panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), CssClass = ItemStyle };

            panelItem.Target = dropDownList;

            return new object[] { dropDownList, validator };
        }
예제 #4
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = SmartValidator.Create(panelItem.GetPropertyName());

            var box = new SmartDateTextBox { ID = panelItem.GetId(), TextMode = TextBoxMode.SingleLine, Wrap = true, Enabled = panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), FormatDisplay = DateFormat, CssClass = ItemStyle };
            var calendar = new CalendarExtender { TargetControlID = box.UniqueID, Format = DateFormat, EnabledOnClient = panelItem.Editable };
            var description = new Label { Width = new Unit(panelItem.Width, UnitType.Ex), Text = DateFormat, CssClass = ItemStyle };

            panelItem.Target = calendar;

            return new object[] { box, validator, calendar, description };
        }
예제 #5
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = SmartValidator.Create(panelItem.GetPropertyName());

            if (panelItem.Type == PanelItemType.EditableText)
            {
                string css = ItemStyle + ((!panelItem.Editable) ? " ReadOnly" : "");
                var text = new TextBox { ID = panelItem.GetId(), Wrap = true, ReadOnly = !panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), CssClass = css };

                panelItem.Target = text;

                return new object[] { text, validator };
            }
            if (panelItem.Type == PanelItemType.Password)
            {
                string css = ItemStyle + ((!panelItem.Editable) ? " ReadOnly" : "");
                var text = new TextBox { ID = panelItem.GetId(), Wrap = true, TextMode = TextBoxMode.Password, ReadOnly = !panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), CssClass = css };

                panelItem.Target = text;

                return new object[] { text, validator };
            }
            if (panelItem.Type == PanelItemType.MultiLineText)
            {
                string css = ItemStyle + ((!panelItem.Editable) ? " ReadOnly" : "");
                var text = new TextBox { ID = panelItem.GetId(), TextMode = TextBoxMode.MultiLine, Wrap = true, ReadOnly = !panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), Height = new Unit((panelItem.Height > 0) ? panelItem.Height : 20, UnitType.Ex), CssClass = css };

                panelItem.Target = text;

                return new object[] { text, validator };
            }
            if (panelItem.Type == PanelItemType.NonEditableText)
            {
                string css = ItemStyle + ((!panelItem.Editable) ? " ReadOnly" : "");
                var text = new TextBox { ID = panelItem.GetId(), Wrap = true, ReadOnly = !panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), CssClass = css };

                panelItem.Target = text;

                return new object[] { text };
            }
            if (panelItem.Type == PanelItemType.Label)
            {
                var text = new Label { ID = panelItem.GetId(), Enabled = panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), CssClass = ItemStyle, Text = (!panelItem.Text.IsNullOrEmpty() ? panelItem.Text : string.Empty)};

                panelItem.Target = text;

                return new object[] { text };
            }

            return null;
        }
예제 #6
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = PanelValidator.Create(panelItem.GetPropertyName());
            var dropDownList = new DropDownList
            {
                ID = panelItem.GetId(),
                Enabled = panelItem.Editable,
                CssClass = "adfj-record-item adfj-record-item-dropdown adfj-record-item-" + panelItem.GetClassName()
            };

            panelItem.Target = dropDownList;

            return new object[] { dropDownList, validator };
        }
예제 #7
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = PanelValidator.Create(panelItem.GetPropertyName());
            CheckBox toggleButton = new CheckBox
            {
                ID = panelItem.GetId(),
                Enabled = panelItem.Editable,
                CssClass = "adfj-record-item adfj-record-item-checkbox adfj-record-item-" + panelItem.GetClassName()
            };

            panelItem.Target = toggleButton;

            return new object[] { toggleButton, validator };
        }
예제 #8
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = PanelValidator.Create(panelItem.GetPropertyName());

            string cssClass = (panelItem.Editable) ? string.Empty : "ui-state-disabled ";
            DatePicker datePicker = new DatePicker
                                        {
                                            ID = panelItem.GetId(),
                                            Enabled = panelItem.Editable,
                                            Width = new Unit(panelItem.Width, UnitType.Ex),
                                            DateFormatString = DateFormat,
                                            AppendText = ResourceManager.GetString(DateFormat),
                                            LocID = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
                                            CssClass = cssClass + "adfj-record-item adfj-record-item-calender adfj-record-item-" + panelItem.GetClassName()
                                        };

            panelItem.Target = datePicker;
            return new object[] { validator, datePicker };
        }
예제 #9
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            var validator = PanelValidator.Create(panelItem.GetPropertyName());
            WebControl text;

            if (panelItem.Type == PanelItemType.Label)
            {
                Label lbl = new Label { Text = panelItem.Text, CssClass = "selectable adfj-record-item adfj-record-item-label adf-record-item-" + panelItem.GetClassName() };
                text = lbl;
            }
            else
            {
                string cssClass = (panelItem.Editable) ? string.Empty : "ui-state-disabled ";
                TextBox txt = new TextBox
                                  {
                                      Text = panelItem.Text,
                                      CssClass = cssClass + "adfj-record-item adfj-record-item-textbox adfj-record-item-" + panelItem.GetClassName(),
                                      Wrap = true,
                                      Visible = panelItem.Visible,
                                      TextMode =
                                          panelItem.Type == PanelItemType.MultiLineText
                                              ? TextBoxMode.MultiLine
                                              : TextBoxMode.SingleLine
                                  };
                if (panelItem.Type == PanelItemType.Password) txt.TextMode = TextBoxMode.Password;
                if (!panelItem.Editable) txt.CssClass += " adfj-record-item-textbox-readonly";
                txt.ReadOnly = !panelItem.Editable;

                text = txt;
            }
            text.ID = panelItem.GetId();

            panelItem.Target = text;

            if (panelItem.Type == PanelItemType.NonEditableText || panelItem.Type == PanelItemType.Label)
                return new object[] { text };

            return new object[] {text, validator};
        }
예제 #10
0
파일: ImageRenderer.cs 프로젝트: NLADP/ADF
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            if (panelItem.Type == PanelItemType.Image)
            {
                var image = new Image { ID = panelItem.GetId(), Enabled = false, Width = new Unit(panelItem.Width, UnitType.Pixel), Visible = panelItem.Visible };

                image
                    .AddStyle(CssClass.Item)
                    .AttachToolTip(panelItem);

                panelItem.Target = image;

                return new List<Control> { image, PanelValidator.Create(panelItem) };
            }
            if (panelItem.Type == PanelItemType.InfoIcon)
            {
                var image = new Image
                {
                    ID = panelItem.GetId(),
                    ImageUrl = @"../images/help.png",
                    ToolTip = ResourceManager.GetString(panelItem.Text.IsNullOrEmpty() ? panelItem.GetPropertyName() + "Info" : panelItem.Text),
                    Enabled = false,
                    Width = new Unit(panelItem.Width, UnitType.Pixel),
                    Visible = panelItem.Visible
                };

                image
                    .AddStyle(CssClass.Item)
                    .AttachToolTip(panelItem);

                panelItem.Target = image;

                return new List<Control> { image };
            }

            return null;
        }
예제 #11
0
파일: PanelValidator.cs 프로젝트: NLADP/ADF
 public static PanelValidator Create(PanelItem item)
 {
     return Create(string.Format("{0}{1}", item.GetPropertyName(), item.Alias), item.Label, item.IDs);
 }
예제 #12
0
        private static Control RenderLabel(PanelItem panelItem, Control item)
        {
            if (item != null && !panelItem.Label.IsNullOrEmpty())
            {
                Label label = new Label
                                  {
                                      AssociatedControlID = item.ID,
                                      CssClass = "selectable adfj-record-label",
                                      ID = "itemLabel_" + panelItem.GetPropertyName(),
                                      Text = ResourceManager.GetString(panelItem.Label)
                                  };

                if (!panelItem.Optional) label.CssClass += " adfj-record-label-mandatory";
                return label;
            }

            return null;
        }
예제 #13
0
        private IEnumerable<Control> RenderLabel(PanelItem panelItem)
        {
            var controls = new List<Control>();

            if (!panelItem.Label.IsNullOrEmpty())
            {
                controls.Add(new Label { ID = "itemLabel_" + panelItem.GetPropertyName(), Text = ResourceManager.GetString(panelItem.Label), CssClass = LabelStyle });

                if (!panelItem.Optional) controls.Add(new Label { Text = @" *", CssClass = "Mandatory"});
            }

            return controls;
        }