Пример #1
0
 protected Grid AGrid(Guid id, ApplicationSetting application, bool authorize =false)
 {
     var grid = new Grid
     {
         Id = id,
         ApplicationSettings = application,
         Authorize = authorize
     };
     return grid;
 }
Пример #2
0
 public void Remove(Grid item)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 public Grid Add(Grid item)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public static GridElement IsPropertyOf(this GridElement source, Grid owner)
 {
     source.Grid = owner;
     return source;
 }
Пример #5
0
 public static ApplicationSetting WithGrid(this ApplicationSetting item, Grid grid, IRepository repository)
 {
     item.WithGrid(grid);
     repository.Add(grid);
     return item;
 }
Пример #6
0
 public static ApplicationSetting WithGrid(this ApplicationSetting item, Grid grid )
 {
     grid.ApplicationSettings = item;
     item.Grids.Add(grid);
     return item;
 }
Пример #7
0
 public override ApplicationSetting Add(ApplicationSetting newitem, int userId)
 {
     var user = Repository.UserProfile.Single(x => x.Id == userId);
     newitem.Users.Add(user);
     Repository.Add(newitem);
     if (newitem.Grids == null)
     {
         var a = new Grid
             {
                 ApplicationSettings = newitem,
                 Home = true
             };
         a.WithResource("name", "homepage", CurrentCulture);
         newitem.Grids = new List<Grid>{a};
     }
     Repository.SaveChanges();
     return newitem;
 }