|
<html><head><link rel=stylesheet href=style.css></head><body><div class=SourcePanel style='font-size:12'><pre style='background-color:white'>
<font color= "blue">namespace</font> ASPNET.StarterKit.TimeTracker.Web
<font color= "blue"></font>{
<font color= "blue"> using</font> System;
<font color= "blue"> using</font> System.Collections;
<font color= "blue"> using</font> ASPNET.StarterKit.TimeTracker.BusinessLogicLayer;
<font color= "blue"></font>
<font color= "green"> // Usercontrol for the Project and User subtabs on the Administration tab.</font>
<font color= "blue"> public </font>abstract class AdminTabs : System.Web.UI.UserControl
<font color= "blue"> </font>{
<font color= "blue"> protected </font>System.Web.UI.WebControls.DataList tabs;
<font color= "blue"></font>
<font color= "blue"> private void</font> Page_Load(object sender, System.EventArgs e)
<font color= "blue"> </font>{
<font color= "blue"> </font>ArrayList tabItems = new ArrayList();
<font color= "blue"> </font>int mainIndex = (Request["index"]==null) ? 0 : Convert.ToInt32(Request["index"]);
<font color= "blue"></font>
<font color= "green"> // Always add the project list tab. If the user was able to see the Administration tab, they'll</font>
<font color= "green"> // always be able to view this tab.</font>
<font color= "blue"> </font>tabItems.Add(new TabItem("Projects", "ProjectList.aspx?index=" + mainIndex + "&adminIndex=" + tabItems.Count));
<font color= "blue"> </font>
<font color= "blue"></font><font color= "blue"> if </font>(TTSecurity.IsInRole(TTUser.UserRoleAdministrator))<font color= "blue"></font>
<font color= "blue"> </font>{
<font color= "blue"> </font>tabItems.Add(new TabItem("Users", "UserList.aspx?index=" + mainIndex + "&adminIndex=" + tabItems.Count));
<font color= "blue"> </font>}
<font color= "blue"> </font>
<font color= "blue"> </font>tabs.DataSource = tabItems;
<font color= "blue"> </font>tabs.SelectedIndex = (Request["adminIndex"]==null) ? 0 : Convert.ToInt32(Request["adminIndex"]);
<font color= "blue"> </font>tabs.DataBind();
<font color= "blue"> </font>}
<font color= "blue"></font>
<font color= "blue"> </font>#region Web Form Designer generated code
<font color= "blue"> </font>override protected void OnInit(EventArgs e)
<font color= "blue"> </font>{
<font color= "green"> //</font>
<font color= "green"> // CODEGEN: This call is required by the ASP.NET Web Form Designer.</font>
<font color= "green"> //</font>
<font color= "blue"> </font>InitializeComponent();
<font color= "blue"> </font>base.OnInit(e);
<font color= "blue"> </font>}
<font color= "blue"> </font>
<font color= "green"> /// Required method for Designer support - do not modify</font>
<font color= "green"> /// the contents of this method with the code editor.</font>
<font color= "green"> /// </summary></font>
<font color= "blue"> private void</font> InitializeComponent()
<font color= "blue"> </font>{
<font color= "blue"> </font>this.Load += new System.EventHandler(this.Page_Load);
<font color= "blue"></font>
<font color= "blue"> </font>}
<font color= "blue"> </font>#endregion
<font color= "blue"> </font>}
<font color= "blue"></font>}
</pre>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.