Skip to content

Instantly share code, notes, and snippets.

@dagda1

dagda1/aspnetmvc.cs

Created Oct 15, 2010
Embed
What would you like to do?
[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
You can’t perform that action at this time.