public void Fill(PlotFolder folder, int?currentUserId, IUriService uriService)
 {
     PlotFolderMasterTitle = folder.MasterTitle;
     Status          = folder.GetStatus();
     Elements        = folder.Elements.Select(e => new PlotElementListItemViewModel(e, currentUserId, uriService)).OrderBy(e => e.Status);
     TagNames        = folder.PlotTags.Select(tag => tag.TagName).OrderBy(tag => tag).ToList();
     HasEditAccess   = folder.HasMasterAccess(currentUserId, acl => acl.CanManagePlots) && folder.Project.Active;
     HasMasterAccess = folder.HasMasterAccess(currentUserId);
 }
Ejemplo n.º 2
0
 public PlotFolderListItemViewModel(PlotFolder folder, int?currentUserId)
 {
     PlotFolderId          = folder.PlotFolderId;
     PlotFolderMasterTitle = folder.MasterTitle;
     ProjectId             = folder.ProjectId;
     Status        = folder.GetStatus();
     ElementsCount = folder.Elements.Count;
     TodoField     = folder.TodoField;
     HasEditAccess = folder.HasMasterAccess(currentUserId, acl => acl.CanManagePlots) && folder.Project.Active;
 }
Ejemplo n.º 3
0
 public EditPlotFolderViewModel(PlotFolder folder, int?currentUserId)
 {
     PlotFolderMasterTitle = folder.MasterTitle;
     PlotFolderId          = folder.PlotFolderId;
     TodoField             = folder.TodoField;
     ProjectId             = folder.ProjectId;
     Elements        = folder.Elements.Select(e => new PlotElementListItemViewModel(e, currentUserId)).OrderBy(e => e.Status);
     Status          = folder.GetStatus();
     HasEditAccess   = folder.HasMasterAccess(currentUserId, acl => acl.CanManagePlots) && folder.Project.Active;
     HasMasterAccess = folder.HasMasterAccess(currentUserId);
 }