files tree made better.

This commit is contained in:
2019-01-01 16:28:47 +00:00
parent cb96933a25
commit 5b8e9b3975
1633 changed files with 18220 additions and 41869 deletions

View File

@ -0,0 +1,47 @@
using System.Linq;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
namespace Yavsc.ViewComponents
{
using Models;
using ViewModels.Controls;
using ViewModels.Relationship;
using Yavsc.Abstract.Identity.Security;
public class CirclesControlViewComponent : ViewComponent
{
ApplicationDbContext dbContext;
public CirclesControlViewComponent(ApplicationDbContext dbContext)
{
this.dbContext = dbContext;
}
public IViewComponentResult Invoke (ICircleAuthorized target)
{
var oid = target.GetOwnerId();
ViewBag.ACL = dbContext.Circle.Where(
c=>c.OwnerId == oid)
.Select(
c => new SelectListItem
{
Text = c.Name,
Value = c.Id.ToString(),
Selected = target.AuthorizeCircle(c.Id)
} 
);
ViewBag.Access = dbContext.Circle.Where(
c=>c.OwnerId == oid)
.Select( c=>
new AjaxCheckBoxInfo
{
Text = c.Name,
Checked = target.AuthorizeCircle(c.Id),
Value = c.Id.ToString()
});
return View(new CirclesViewModel(target));
}
}
}