Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created October 15, 2010 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagda1/627988 to your computer and use it in GitHub Desktop.
Save dagda1/627988 to your computer and use it in GitHub Desktop.
[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