コード例 #1
0
        protected void signUpSubmitButton_Click(object sender, EventArgs e)
        {
            UserManager userManager=new UserManager();
            User aUser=new User();
            aUser.UserFullName = signUpFullName.Text;
            aUser.UserEmail = signUpEmailTextBox.Text;
            aUser.UserName = userName.Text;
            aUser.UserPassword = signUpPassword.Text;

            if (userManager.GetUser(aUser.UserName)!=null)
            {

                userName.BackColor = Color.Red;
            }

            else
            {
                if (userManager.InsertUser(aUser) > 0)
                {

                    Response.Redirect("LoginPage.aspx");

                }

            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string userId = Request.QueryString["id"];
            if (userId!=null)
            {
                UserManager anUserManager=new UserManager();
                User anUser= anUserManager.GetUserById(userId);

                name.InnerText = anUser.UserFullName;
                email.InnerText = anUser.UserEmail;
            }
        }
コード例 #3
0
        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            string userName=Login1.UserName;
            string password = Login1.Password;
            UserManager userManager=new UserManager();
            User anUser = userManager.GetUser(userName);
            if (anUser != null && anUser.UserPassword == password)
            {
                Session["aUser"] = userManager.GetUser(userName);
                Login1.Visible = false;

                login.InnerText = "Hi " + anUser.UserFullName;
            }
        }
コード例 #4
0
        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            string userName=Login1.UserName;
            string password = Login1.Password;
            UserManager userManager=new UserManager();
               User anUser= userManager.GetUser(userName);
               if (anUser != null && anUser.UserPassword == password)
            {

                Session["aUser"] = userManager.GetUser(userName);

                Session["aUser"] = anUser;
                Model.User na = (User) Session["aUser"];

                Response.Redirect("UserControlPanel.aspx");

            }
        }