コード例 #1
0
 protected void ButtonConfirm_Click(object sender, EventArgs e)
 {
     try
     {
         DataProcessingClass objDBPC = new DataProcessingClass();
         objDBPC.RegisterForClass((int)Session["StudentID"], int.Parse(Request.QueryString["ClassId"]));
         Response.Redirect("MyClasses.aspx");
     }
     catch
     {
         LabelMessage.Text = "It looks like you have already registered for this class <br/>Please Verify that you are not already in the class. <br/> If problem continues, contact support.";
         ButtonVerifyYourClasses.BackColor = System.Drawing.Color.Cornsilk;
     }
 }
コード例 #2
0
        protected void ButtonLogin_Click(object sender, EventArgs e)
        {
            DataProcessingClass objDBPC = new DataProcessingClass();

            int StudentID = objDBPC.WebsiteLogin(TextBoxStudentLogin.Text, TextBoxStudentPassword.Text);

            if (StudentID == -1)
            {
                LabelMessage.Text    = "Login Failed!";
                ButtonLogOut.Visible = false;
                ButtonReturn.Visible = false;
            }
            else
            {
                Session["StudentId"]   = StudentID;
                LabelMessage.Text      = "Thank you!  You can now register for new classes or view your current classes.";
                ButtonReturn.Visible   = true;
                ButtonReturn.BackColor = System.Drawing.Color.Cornsilk;
            }
        }