Example #1
0
 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()));
 }
Example #2
0
 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"))
                              )
                          )
 {
 }
Example #3
0
        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));
        }
Example #4
0
        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());
        }