Ejemplo n.º 1
0
        //Return User Account that matched the inputted Email Address
        public object ReturnMatchedStudentAccount(string EmailAddress)
        {
            RetrieveUser RInfo = new RetrieveUser();
            int x = 0;
            StudentAccountList.ForEach(SAList =>
            {
                if (SAList.EmailAddress.ToLower() == EmailAddress.ToLower())
                {
                    x = 1;
                    RInfo.Firstname = Validator.Finalize(SAList.Firstname);
                    RInfo.Lastname = Validator.Finalize(SAList.Lastname);
                    RInfo.EmailAddress = Validator.Finalize(EmailAddress);
                    RInfo.Username = Validator.Finalize(SAList.StudentNumber);
                    RInfo.Password = Validator.Finalize(SAList.Password);
                    return;
                }

            });
            if (x == 0)
            {
                ParentList.ForEach(pl =>
                {
                    if (pl.EmailAddress.ToLower() == EmailAddress.ToLower())
                    {
                        RInfo.Firstname = Validator.Finalize(pl.Firstname);
                        RInfo.Lastname = Validator.Finalize(pl.Lastname);
                        RInfo.EmailAddress = Validator.Finalize(EmailAddress);
                        RInfo.Username = Validator.Finalize(pl.Username);
                        RInfo.Password = Validator.Finalize(pl.Password);
                        return;
                    }
                });

            }
            return RInfo;
        }
Ejemplo n.º 2
0
        //Login Button
        protected void lnkLogin_Click(object sender, EventArgs e)
        {
            //Check Fields for NULL Values
            if (ValidateFields())
            {
                if (CheckIfEmailIsRegistered(txtEmailAddress.Text))
                {
                    RInfo = (RetrieveUser)ReturnMatchedStudentAccount(txtEmailAddress.Text);
                    sys.SendLoginRequestEmail(RInfo);
                    Response.Write("<script>alert('You User Login Information has been sent to your Email.\\r\\nKindly check your Email.'); window.location='"+ResolveUrl(DefaultForms.frm_login)+"';</script>");
                }
                else
                {
                    Response.Write("<script>alert('Email Address is not Registered in the System.\\r\\nPlease Try Again.')</script>");
                    vlEmailAddress.Text = "* Email Address is not Registered in the System.";
                }

            }
        }