Exemplo n.º 1
0
        public DefaultcontrolProperties()
        {
            Width = BsSelectList <ColumnWidth> .FromEnum(typeof(ColumnWidth));

            GlyphiconAddon = new BsSelectList <Glyphicon?>();

            var glyphiconList = new BsSelectList <Glyphicon>();

            glyphiconList.Items = Enum.GetValues(typeof(Glyphicon)).Cast <Glyphicon>()
                                  .Where(x => x != Glyphicon.Custom)
                                  .Select(x => new BsSelectListItem
            {
                Text  = x.ToString(),
                Value = x.GetDescription()
            }).ToList();

            GlyphiconAddon.Items = glyphiconList.Items;

            GlyphiconAddon.Items.Insert(0, new BsSelectListItem
            {
                Text  = "None",
                Value = String.Empty
            });

            Required = BsSelectList <YesNoValues> .FromEnum(typeof(YesNoValues));

            Width.SelectedValues    = ColumnWidth.Large;
            Required.SelectedValues = YesNoValues.No;
        }
Exemplo n.º 2
0
        private RegisterModel InitRegisterModel()
        {
            var listWithSelected = Lists.AllAsp <List <int> >();

            listWithSelected.SelectedValues = new List <int> {
                1, 2
            };

            var enumWithSelected = BsSelectList <NotificationType?> .FromEnum(typeof(NotificationType));

            enumWithSelected.SelectedValues = NotificationType.Monthly;

            var ddlWithSelected = Lists.AllCounties <string>();

            ddlWithSelected.SelectedValues = "ROU";

            var ideListWithSelected = Lists.AllIde <string>();

            ideListWithSelected.SelectedValues = "Visual Studio";

            var langListWithSelected = Lists.AllLanguages <List <string> >();

            langListWithSelected.SelectedValues = new List <string> {
                "C#"
            };

            var from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 10, 30, 0);
            var to   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(12).Day, 20, 00, 0);

            return(new RegisterModel()
            {
                CountriesList = ddlWithSelected,
                NotificationList = enumWithSelected,
                TechnologiesList = Lists.AllTech <List <int> >(),
                TechnologiesCheckboxList = listWithSelected,
                LanguagesList = langListWithSelected,
                IdeList = ideListWithSelected,
                GenderList = Lists.AllGenders <int>().ToSelectList().ToList(),
                Birthday = new BsDateTime(),
                Interval = new BsRange <DateTime>
                {
                    From = new BsRangeItem <DateTime>
                    {
                        ItemValue = DateTime.Now
                    },
                    To = new BsRangeItem <DateTime>
                    {
                        ItemValue = DateTime.Now.AddDays(12)
                    }
                }
            });
        }
Exemplo n.º 3
0
        public InputControlModel() :
            base(FormBuilderControlType.Textbox)
        {
            Properties = new InputControlProperties
            {
                Type = BsSelectList <FormBuilderInputType> .FromEnum(typeof(FormBuilderInputType))
            };

            DefaultProperties = new DefaultcontrolProperties
            {
                Width = BsSelectList <ColumnWidth> .FromEnum(typeof(ColumnWidth))
            };
        }
Exemplo n.º 4
0
        private RegisterModel InitRegisterModel()
        {
            var listWithSelected = Lists.AllAsp <List <int> >();

            listWithSelected.SelectedValues = new List <int> {
                1, 2
            };

            var enumWithSelected = BsSelectList <NotificationType?> .FromEnum(typeof(NotificationType));

            enumWithSelected.SelectedValues = NotificationType.Monthly;

            var countries       = Lists.AllCountries <string>();
            var ddlInitialValue = countries.Items.Where(x => x.Value == "RO").FirstOrDefault();

            ddlInitialValue.Selected = true;

            var ddlWithSelected = new BsSelectList <string>()
            {
                Items = new List <BsSelectListItem>
                {
                    ddlInitialValue
                },
                SelectedValues = "ROU"
            };

            var ideListWithSelected = Lists.AllIde <string>();

            ideListWithSelected.SelectedValues = "Visual Studio";

            var langListWithSelected = Lists.AllLanguages <List <string> >();

            langListWithSelected.SelectedValues = new List <string> {
                "C#"
            };

            var from = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 10, 30, 0);
            var to   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(12).Day, 20, 00, 0);

            var javascriptMvcFrameworkWithSelected = Lists.AllJavascriptFrameworks <int>();

            javascriptMvcFrameworkWithSelected.SelectedValues = 2;

            var webBrowsers = Lists.AllWebBrowsers <int>();

            return(new RegisterModel()
            {
                CountriesList = ddlWithSelected,
                NotificationList = enumWithSelected,
                TechnologiesList = Lists.AllTech <List <int> >(),
                TechnologiesCheckboxList = listWithSelected,
                LanguagesList = langListWithSelected,
                IdeList = ideListWithSelected,
                GenderList = Lists.AllGenders <int>().ToSelectList().ToList(),
                Birthday = new BsDateTime(),
                Interval = new BsRange <DateTime>
                {
                    From = new BsRangeItem <DateTime>
                    {
                        ItemValue = DateTime.Now
                    },
                    To = new BsRangeItem <DateTime>
                    {
                        ItemValue = DateTime.Now.AddDays(12)
                    }
                },
                JavascriptMvcFramework = javascriptMvcFrameworkWithSelected,
                WebBrowsers = webBrowsers
            });
        }
Exemplo n.º 5
0
 public InputControlProperties()
 {
     Type = BsSelectList <FormBuilderInputType> .FromEnum(typeof(FormBuilderInputType));
 }