Esempio n. 1
0
        public JobDetailsRolesModel()
        {
            if (string.IsNullOrWhiteSpace(this.SerializedJobDetailsRoles))
            {
                var roleOptions = new List <JobDetailsRolesOptions>();
                var roleNames   = SitefinityHelper.GetAllRoleNames();

                foreach (var roleName in roleNames)
                {
                    roleOptions.Add(new JobDetailsRolesOptions()
                    {
                        RoleName = roleName, IsChecked = false
                    });
                }

                if (!roleNames.Contains("Anonymous"))
                {
                    roleOptions.Add(new JobDetailsRolesOptions()
                    {
                        RoleName = "Anonymous", IsChecked = false
                    });
                }

                this.SerializedJobDetailsRoles = JsonConvert.SerializeObject(roleOptions);
            }
        }