PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/pigeoncms/Modules/PigeonCms.HelloWord/views/Default.ascx.cs

http://pigeoncms.googlecode.com/
C# | 57 lines | 52 code | 5 blank | 0 comment | 1 complexity | f16fe0733a4b648d908f936a8f4b4174 MD5 | raw file
 1using System;
 2using System.Data;
 3using System.Configuration;
 4using System.Collections;
 5using System.Web;
 6using System.Web.Security;
 7using System.Web.UI;
 8using System.Web.UI.WebControls;
 9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11using System.Web.Caching;
12using PigeonCms;
13using PigeonCms.Core.Helpers;
14
15public partial class Controls_HelloWord: PigeonCms.BaseModuleControl
16{
17    protected string LitOutput = "";
18
19    private string yourName = "";
20    public string YourName
21    {
22        get { return GetStringParam("YourName", yourName); }
23        set { yourName = value; }
24    }
25
26    private string gender = "";
27    public string Gender
28    {
29        get { return GetStringParam("Gender", gender); }
30        set { gender = value; }
31    }
32
33    private int age = 0;
34    public int Age
35    {
36        get { return GetIntParam("Age", age); }
37        set { age = value; }
38    }
39
40    protected void Page_Load(object sender, EventArgs e)
41    {
42        var cache = new CacheManager<string>("PigeonCms.HelloWord");
43        if (cache.IsEmpty(this.BaseModule.Id.ToString()))
44        {
45            LitOutput = "This is an HelloWord module.<br />"
46            + "Theese are the params you set for the module; <br />"
47            + "your name: " + this.YourName + "<br />"
48            + "gender: " + this.Gender + "<br />"
49            + "age: " + this.Age.ToString() + "<br />";
50            cache.Insert(this.BaseModule.Id.ToString(), LitOutput);
51        }
52        else
53        {
54            LitOutput = cache.GetValue(this.BaseModule.Id.ToString());
55        }
56    }
57}