public HttpResponse AcceptProposal(int id) { if (!User.IsInRole(Role.Administrator.ToString())) { return(new HttpResponse(HttpStatusCode.Forbidden)); } ProposalService.AcceptProposal(id); return(new HttpResponse(HttpStatusCode.Found).WithHeader("Location", ResolveUri.ForProposals())); }
public HomeView() : base("Home", H1(Text("Home")), Ul( Li(A(ResolveUri.ForUsers(), "Users")) , Li(A(ResolveUri.ForShows(), "TV Shows")) , Li(A(ResolveUri.ForProposals(), "Proposals List")) ) ) { }
public HttpResponse RejectProposal(int id) { Proposal proposal = ProposalService.GetProposalById(id); if (proposal.User.Identity.Name.Equals(proposal.User.Identity.Name) || User.IsInRole(Role.Administrator.ToString())) { ProposalService.RejectProposal(id); return(new HttpResponse(HttpStatusCode.Found).WithHeader("Location", ResolveUri.ForProposals())); } return(new HttpResponse(HttpStatusCode.Forbidden)); }
private static IWritable[] InitContent(params IWritable[] c) { List <IWritable> content = new List <IWritable> { Div("nav", "sidebar", Ul(Li(A(ResolveUri.ForUsers(), "Home")) , Li(A(ResolveUri.ForShows(), "TV Shows")) , Li(A(ResolveUri.ForProposals(), "Proposals List")) ) ) }; content.AddRange(c); return(content.ToArray()); }