- Manage Roles Index action,view,model for Roles

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4039480
This commit is contained in:
suhacan
2009-11-10 20:36:20 +00:00
parent 1a839b1ae1
commit 94e415b064
6 changed files with 86 additions and 10 deletions

View File

@@ -1,18 +1,31 @@
using System.Web.Mvc;
using System.Linq;
using System.Web.Mvc;
using Orchard.Data;
using Orchard.Notify;
using Orchard.Roles.Models;
using Orchard.Roles.ViewModels;
namespace Orchard.Roles.Controllers {
[ValidateInput(false)]
public class AdminController : Controller {
private readonly IRepository<RoleRecord> _roleRepository;
private readonly INotifier _notifier;
public AdminController(INotifier notifier) {
public AdminController(IRepository<RoleRecord> roleRepository, INotifier notifier) {
_roleRepository = roleRepository;
_notifier = notifier;
}
public ActionResult Index() {
return View();
var model = new RolesIndexViewModel {
Rows = _roleRepository.Fetch(x => x.Name != null)
.Select(x => new RolesIndexViewModel.Row {
Role = x
})
.ToList()
};
return View(model);
}
}
}