Ejemplo n.º 1
0
        protected void submit_register(object sender, EventArgs e)
        {
            string email = Request.Form.Get("email");
            string password = Request.Form.Get("pwd");
            string judge = null;
            if (Request.Form["check"]!=null)
            {
                if (Request.Form["li-person"] != null)

                {

                    PersonService personService = new PersonService();
                    judge = personService.Register(email, password);

                    if (judge == "注册成功")
                    {
                        Response.Redirect("signinA.aspx", false);
                    }
                    else
                    {
                        Response.Write(judge);
                    }

                }
                else
                {
                    EnterpriseService enterpriseService = new EnterpriseService();
                    judge = enterpriseService.Register(email, password);
                    if (judge == "注册成功")
                    {
                        Response.Redirect("signinA.aspx", false);
                    }
                    else
                    {
                        Response.Write(judge);
                    }
                }

            }
            else
            {
                Response.Write("请您先同意用户协议");
            }
        }
Ejemplo n.º 2
0
        protected void submit_login(object sender, EventArgs e)
        {
            string email = Request.Form.Get("email");
            string password = Request.Form.Get("pwd");
            string judge = null;
            int countForNotUser = 0;

            PersonService personService = new PersonService();
            judge = personService.Login(email, password);

            if (judge != "登录成功")//在个人用户中没有找到账号
            {
                if (judge == "用户不存在")//账号不在个人用户中存在
                {
                    countForNotUser++;
                }
                EnterpriseService enterpriseService = new EnterpriseService();
                judge = enterpriseService.Login(email, password);
            }

            if (judge == "用户不存在")//账号不在企业用户中存在
            {
                countForNotUser++;
            }

            if (countForNotUser == 2)//没有账号
            {
                judge = "用户不存在";
            }

            if (judge == "登录成功")
            {
                Response.Redirect("indexA.aspx", false);
            }
            else
            {
                Response.Write(judge);
            }
        }