Created
October 15, 2010 10:43
-
-
Save dagda1/627988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[BaseSecurityFilter(role: "Admin")] | |
public class AuditController : BaseController | |
{ | |
private readonly dynamic _structureService; | |
[HttpGet] | |
[CatchException(false)] | |
public ViewResult All() | |
{ | |
var audits = _commonDao.GetAll<Audit>(new[] { "CreatedOn" }); | |
var auditDtos = Mapper.Map<IList<Audit>, List<AuditDto>>(audits); | |
var indexContainer = new AuditIndexContainer(auditDtos); | |
return View("All", indexContainer); | |
} | |
[HttpPost] | |
[CatchException(false)] | |
public virtual ViewResult Delete(Guid deleteAuditUid) | |
{ | |
var audit = _commonDao.GetObjectById<Audit, Guid>(deleteAuditUid); | |
_commonService.DeleteObject(audit); | |
return All(); | |
} | |
[HttpGet] | |
public virtual ViewResult Index() | |
{ | |
List<NameValueDTO> businessUnits = _structureService.BusinessUnitsForLookUpsWithDefault(GetCurrentUser, "All"); | |
var indexContainer = new AuditIndexContainer(businessUnits); | |
return View(indexContainer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment