Пример #1
0
        protected void btn_SignUp_Click(object sender, EventArgs e)
        {
            if (ModelState.IsValid)
            {
                UserService.UserServiceClient client = new UserService.UserServiceClient("BasicHttpBinding_IUserService");


                string email    = txt_email.Text;
                string Password = password.Text;


                if (client.Signup(email, Password))
                {
                    txt_error.Text    = "Registered Successfully";
                    txt_error.Visible = true;
                }
                else
                {
                    txt_error.Text    = "Unable to Register";
                    txt_error.Visible = true;
                }

                client.Close();
            }
        }
Пример #2
0
        protected void btn_Login_Click(object sender, EventArgs e)
        {
            if (ModelState.IsValid)
            {
                UserService.UserServiceClient client = new UserService.UserServiceClient("BasicHttpBinding_IUserService");

                string email    = txt_Username.Text;
                string Password = txt_password.Text;

                if (client.Signin(email, Password))
                {
                    Session.Add("email", email);
                    Response.Redirect("Home.aspx");
                }
                else
                {
                    txt_error.Text    = "Invalid Credentials";
                    txt_error.Visible = true;
                }

                client.Close();
            }
        }
        protected void btn_Login_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                UserService.UserServiceClient client = new UserService.UserServiceClient("BasicHttpBinding_IUserService");

                string email    = txt_Username.Text;
                string Password = txt_password.Text;

                if (email.Equals("*****@*****.**") && Password.Equals("admin@123"))
                {
                    Session.Add("email", email);
                    Response.Redirect("AdminHome.aspx");
                }
                else
                {
                    txt_error.Text    = "Invalid Credentials";
                    txt_error.Visible = true;
                }

                client.Close();
            }
        }