Click here to Skip to main content
15,893,663 members
Articles / Web Development / ASP.NET

SWAT - A simple Web-based Anomalies Tracker - Part 3

Rate me:
Please Sign up or sign in to vote.
4.76/5 (16 votes)
22 Jun 2003CPOL16 min read 119.4K   2.4K   47  
An account of my experience in learning to develop in the .NET environment.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Swat
{
	public enum ScrollMode
	{
		UpdateInPlace,
		UpdateNextPage,
		UpdatePrevPage
	}
	/// <summary>
	/// Summary description for SwatMain.
	/// </summary>
	public class SwatMain : System.Web.UI.Page
	{
		public string MainFramePage;
		private void Page_Load(object sender, System.EventArgs e)
		{
			//This is only necessary the first time through when the DB is empty
			//otherwise everybody goes to the bug editing page, for now.
			int nRole = System.Convert.ToInt16(Request.Cookies["Roles"].Value);
			if (nRole == (int)AccessPrivilege.Administrator)
				MainFramePage = "SwatAdmin.aspx";
			else
			{
				if (nRole == (int)AccessPrivilege.Manager)
					MainFramePage = "SwatAnalyze.aspx";
				else
				{
					if (nRole == 0)
						Response.Redirect("SwatLogon.aspx",true);
					else
					{
						//At some point we'll probably allow the user to
						//define his/her start page and go directly there.
						//For now everybody goes to bugs
						MainFramePage = "SwatBugs.aspx";
					}
				}
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);
		}
		#endregion
	}
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions