Inheritance: INotifyPropertyChanging, INotifyPropertyChanged
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            using (GlymaConfiguration configuration = new GlymaConfiguration(Identity, this))
            {
                if (string.IsNullOrEmpty(configuration.SecurityDbName) || string.IsNullOrEmpty(configuration.SecurityDbServer))
                {
                    WriteWarning("The provided site doesn't have a valid Security database server or Security database name declared. Aborting securable context creation.");
                    return;
                }

                string connectionString = "Data Source=" + configuration.SecurityDbServer + ";Initial Catalog=" + configuration.SecurityDbName + ";Integrated Security=True";

                using (SecurityDatabaseDataContext dataContext = new SecurityDatabaseDataContext(connectionString))
                {
                    SecurableContext securableContext = new SecurableContext();
                    securableContext.SecurableContextName = SecurableContextName;
                    securableContext.SecurableContextUid  = Guid.NewGuid();
                    securableContext.SiteSPID             = configuration.Site.ID;

                    dataContext.SecurableContexts.InsertOnSubmit(securableContext);
                    dataContext.SubmitChanges();

                    SPPropertyBag properties = configuration.SecurityWeb.Properties;

                    properties["Glyma.SecurableContextId"] = securableContext.SecurableContextId.ToString();
                    properties.Update();
                    configuration.SecurityWeb.Update();
                }
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            using (GlymaConfiguration configuration = new GlymaConfiguration(Identity, this))
            {
                if (string.IsNullOrEmpty(configuration.SecurityDbName) || string.IsNullOrEmpty(configuration.SecurityDbServer))
                {
                    WriteWarning("The provided site doesn't have a valid Security database server or Security database name declared. Aborting securable context creation.");
                    return;
                }

                string connectionString = "Data Source=" + configuration.SecurityDbServer + ";Initial Catalog=" + configuration.SecurityDbName + ";Integrated Security=True";

                using (SecurityDatabaseDataContext dataContext = new SecurityDatabaseDataContext(connectionString))
                {
                    SecurableContext securableContext = new SecurableContext();
                    securableContext.SecurableContextName = SecurableContextName;
                    securableContext.SecurableContextUid = Guid.NewGuid();
                    securableContext.SiteSPID = configuration.Site.ID;

                    dataContext.SecurableContexts.InsertOnSubmit(securableContext);
                    dataContext.SubmitChanges();

                    SPPropertyBag properties = configuration.SecurityWeb.Properties;

                    properties["Glyma.SecurableContextId"] = securableContext.SecurableContextId.ToString();
                    properties.Update();
                    configuration.SecurityWeb.Update();
                }
            }
        }
Example #3
0
 partial void DeleteSecurableContext(SecurableContext instance);
Example #4
0
 partial void UpdateSecurableContext(SecurableContext instance);
Example #5
0
 partial void InsertSecurableContext(SecurableContext instance);
 partial void DeleteSecurableContext(SecurableContext instance);
 partial void UpdateSecurableContext(SecurableContext instance);
 partial void InsertSecurableContext(SecurableContext instance);