예제 #1
0
파일: Check.cs 프로젝트: x360ce/x360ce
        public static void CreateDefaultSchema()
        {
            var db   = new Data.SecurityEntities();
            var item = db.SchemaVersions.FirstOrDefault(x => x.Feature == "common");

            if (item == null)
            {
                item         = new Data.SchemaVersion();
                item.Feature = "common";
                item.CompatibleSchemaVersion = "1";
                item.IsCurrentVersion        = true;
                db.SchemaVersions.AddObject(item);
                db.SaveChanges();
            }
            item = db.SchemaVersions.FirstOrDefault(x => x.Feature == "membership");
            if (item == null)
            {
                item         = new Data.SchemaVersion();
                item.Feature = "membership";
                item.CompatibleSchemaVersion = "1";
                item.IsCurrentVersion        = true;
                db.SchemaVersions.AddObject(item);
                db.SaveChanges();
            }
            item = db.SchemaVersions.FirstOrDefault(x => x.Feature == "role manager");
            if (item == null)
            {
                item         = new Data.SchemaVersion();
                item.Feature = "role manager";
                item.CompatibleSchemaVersion = "1";
                item.IsCurrentVersion        = true;
                db.SchemaVersions.AddObject(item);
                db.SaveChanges();
            }
        }
예제 #2
0
파일: Check.cs 프로젝트: cagrawal21/x360ce
		public static void CreateDefaultSchema()
		{
			var db = new Data.SecurityEntities();
			var item = db.SchemaVersions.FirstOrDefault(x => x.Feature == "common");
			if (item == null)
			{
				item = new Data.SchemaVersion();
				item.Feature = "common";
				item.CompatibleSchemaVersion = "1";
				item.IsCurrentVersion = true;
				db.SchemaVersions.AddObject(item);
				db.SaveChanges();
			}
			item = db.SchemaVersions.FirstOrDefault(x => x.Feature == "membership");
			if (item == null)
			{
				item = new Data.SchemaVersion();
				item.Feature = "membership";
				item.CompatibleSchemaVersion = "1";
				item.IsCurrentVersion = true;
				db.SchemaVersions.AddObject(item);
				db.SaveChanges();
			}
			item = db.SchemaVersions.FirstOrDefault(x => x.Feature == "role manager");
			if (item == null)
			{
				item = new Data.SchemaVersion();
				item.Feature = "role manager";
				item.CompatibleSchemaVersion = "1";
				item.IsCurrentVersion = true;
				db.SchemaVersions.AddObject(item);
				db.SaveChanges();
			}
		}
예제 #3
0
파일: Check.cs 프로젝트: cagrawal21/x360ce
		public static void UpdateRole(string roleName, string description)
		{
			var db = new Data.SecurityEntities();
			var role = db.Roles.FirstOrDefault(x => x.Application.ApplicationName == System.Web.Security.Roles.ApplicationName && x.RoleName == roleName);
			if (role != null) role.Description = description;
			db.SaveChanges();
		}
예제 #4
0
파일: Check.cs 프로젝트: x360ce/x360ce
        public static void UpdateRole(string roleName, string description)
        {
            var db   = new Data.SecurityEntities();
            var role = db.Roles.FirstOrDefault(x => x.Application.ApplicationName == System.Web.Security.Roles.ApplicationName && x.RoleName == roleName);

            if (role != null)
            {
                role.Description = description;
            }
            db.SaveChanges();
        }
예제 #5
0
		public void CreateRole(string roleName, string description, Guid roleId)
		{
			var db = new SecurityEntities();
			var role = new Role();
			role.ApplicationId = ApplicationId;
			role.RoleName = roleName;
			role.RoleId = roleId;
			role.Description = description;
			role.LoweredRoleName = roleName.ToLower();
			db.Roles.AddObject(role);
			db.SaveChanges();
		}
예제 #6
0
        public void CreateRole(string roleName, string description, Guid roleId)
        {
            var db   = new SecurityEntities();
            var role = new Role();

            role.ApplicationId   = ApplicationId;
            role.RoleName        = roleName;
            role.RoleId          = roleId;
            role.Description     = description;
            role.LoweredRoleName = roleName.ToLower();
            db.Roles.AddObject(role);
            db.SaveChanges();
        }
예제 #7
0
 public static void CreateDefaultApplication()
 {
     var db = new Data.SecurityEntities();
     var app = db.Applications.FirstOrDefault(x => x.LoweredApplicationName == "/");
     if (app == null)
     {
         app = new Data.Application();
         app.ApplicationName = "/";
         app.LoweredApplicationName = "/";
         app.ApplicationId = new Guid("5985BB89-8015-42E3-9FE1-D7F9FD914EEC");
         app.Description = "Default Application";
         db.Applications.AddObject(app);
         db.SaveChanges();
     }
 }
예제 #8
0
파일: Check.cs 프로젝트: x360ce/x360ce
        public static void CreateDefaultApplication()
        {
            var db  = new Data.SecurityEntities();
            var app = db.Applications.FirstOrDefault(x => x.LoweredApplicationName == "/");

            if (app == null)
            {
                app = new Data.Application();
                app.ApplicationName        = "/";
                app.LoweredApplicationName = "/";
                app.ApplicationId          = new Guid("5985BB89-8015-42E3-9FE1-D7F9FD914EEC");
                app.Description            = "Default Application";
                db.Applications.AddObject(app);
                db.SaveChanges();
            }
        }