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

Race to Linux - Race 2: Time Tracker Starter Kit

Rate me:
Please Sign up or sign in to vote.
4.25/5 (5 votes)
26 Sep 20051 min read 40.4K   274   16  
Time Tracker Starter Kit port to Linux using Mono and FireBird
<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> TTWebCSVS
<font color= "blue"></font>{
<font color= "blue">    using</font> System.Web.Security;
<font color= "blue">    using</font> System;
<font color= "blue">    using</font> ASPNET.StarterKit.TimeTracker.BusinessLogicLayer;
<font color= "blue"></font>
<font color= "green">    /// <summary></font>
<font color= "green">    ///        Summary description for SignIn.</font>
<font color= "green">    /// </summary></font>
<font color= "blue">    public </font>abstract class SignIn : System.Web.UI.UserControl
<font color= "blue">    </font>{
<font color= "blue">        protected </font>System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
<font color= "blue">        protected </font>System.Web.UI.WebControls.TextBox email;
<font color= "blue">        protected </font>System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
<font color= "blue">        protected </font>System.Web.UI.WebControls.TextBox password;
<font color= "blue">        protected </font>System.Web.UI.WebControls.CheckBox RememberCheckbox;
<font color= "blue">        protected </font>System.Web.UI.WebControls.Button Btnsignin;
<font color= "blue">        protected </font>System.Web.UI.WebControls.Button register;
<font color= "blue">        protected </font>System.Web.UI.WebControls.Label Message;
<font color= "blue"></font>
<font color= "blue">        private void</font> Page_Load(object sender, System.EventArgs e)
<font color= "blue">        </font>{
<font color= "green">            // Put user code to initialize the page here</font>
<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.Btnsignin.Click += new System.EventHandler(this.Btnsignin_Click);
<font color= "blue">            </font>this.register.Click += new System.EventHandler(this.register_Click);
<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">        private void</font> register_Click(object sender, System.EventArgs e)
<font color= "blue">        </font>{
<font color= "blue">            </font>Response.Redirect("Register.aspx", false);
<font color= "blue">        </font>}
<font color= "blue">        </font>
<font color= "blue">        private void</font> Btnsignin_Click(object sender, System.EventArgs e)
<font color= "blue">        </font>{
<font color= "green">            // Attempt to Validate User Credentials using UsersDB</font>
<font color= "blue">            </font>TTUser accountSystem = new TTUser();
<font color= "blue">            </font>string userId = accountSystem.Login(email.Text, TTSecurity.Encrypt(password.Text));
<font color= "blue"></font>
<font color= "blue"></font><font color= "blue">            if </font>(userId != "" && userId != string.Empty)<font color= "blue"></font>
<font color= "blue">            </font>{
<font color= "green">                // Use security system to set the UserID within a client-side Cookie</font>
<font color= "blue">                </font>FormsAuthentication.SetAuthCookie(email.Text, RememberCheckbox.Checked);
<font color= "green">                // Redirect browser back to originating page</font>
<font color= "blue">                </font>FormsAuthentication.RedirectFromLoginPage(email.Text, false);
<font color= "blue">            </font>}
<font color= "blue"></font><font color= "blue">            else</font><font color= "blue"></font>
<font color= "blue">                </font>Message.Text = "<" + "br" + ">Login Failed!" + "<" + "br" + ">";
<font color= "blue">        </font>}
<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.

License

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


Written By
Web Developer
Uruguay Uruguay
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions