Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

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

, 22 Jun 2003 CPOL
An account of my experience in learning to develop in the .NET environment.
swatpart3_source.zip
Toolbar_Bugs_hover.gif
Toolbar_Help.gif
Toolbar_Help_hover.gif
Toolbar_Home.gif
Toolbar_Home_hover.gif
Toolbar_Logout.gif
Toolbar_Logout_hover.gif
Toolbar_Report.gif
Toolbar_Report_hover.gif
Toolbar_System.gif
Toolbar_System_hover.gif
Global.asax
swat.gif
Swat.csproj.webinfo
Swat.vsdisco
Swat_Bugs.gif
Swat_Modules.gif
Swat_Projects.gif
Swat_Users.gif
SwatLogon.gif
Toolbar_Admin.gif
Toolbar_Admin_hover.gif
Toolbar_Analyze.gif
Toolbar_Analyze_hover.gif
Toolbar_Background.gif
Toolbar_Bugs.gif
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)

Share

About the Author

Al Alberto
Software Developer (Senior)
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 23 Jun 2003
Article Copyright 2003 by Al Alberto
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid