PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/Extensions/SetStatus.cshtml

#
Razor | 34 lines | 30 code | 4 blank | 0 comment | 8 complexity | e2786f94551226a102b8db7d3cbc2059 MD5 | raw file
 1@{
 2   if(Request.QueryString["ext"] != null && Request.QueryString["act"] != null)
 3   {
 4       var ext = Request.QueryString["ext"];
 5       var act = bool.Parse(Request.QueryString["act"]);
 6
 7       var rfr = Request.UrlReferrer.ToString();
 8       var rdr = "default.cshtml";
 9       
10       if(!string.IsNullOrEmpty(rfr))
11       {
12           if (rfr.Contains("enb=True")) 
13           { 
14               rfr = rfr.Replace("enb=True", "enb=False");
15               rdr = rfr;
16           }
17           else
18           {
19               if (rfr.Contains("enb=False")) 
20               { 
21                   rfr = rfr.Replace("enb=False", "enb=True");
22                   rdr = rfr;
23               }
24           }
25       }
26       
27       if(!string.IsNullOrEmpty(ext))
28       {
29           BlogEngine.Core.Web.Extensions.ExtensionManager.ChangeStatus(ext, act);
30
31           Response.Redirect(rdr);    
32       }    
33   } 
34}