コード例 #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            uname = txtUsername.Text;
            //pwd = txtPassword.Text;
            pwd = Encryptor.EncryptText(txtPassword.Text.Trim());
            var row  = adpBuy.GetUser(uname, pwd);
            var row2 = adpSell.CheckSeller(uname, pwd);
            var row3 = adpAdmin.CheckAdmin(uname, pwd);

            if (row.Count > 0)
            {
                Response.Redirect("~/Buyer/mainPage.aspx?bID=" + (int)adpBuy.ScalarBID(uname, pwd));
            }
            else if (row2.Count > 0)
            {
                //Re-route to SellerLandingPage
                // Response.Redirect("~/Seller/manageProduct.aspx?sID=" + (int)adpSell.ScalarSellerID(uname,pwd));
                Response.Redirect("AdminMainPage.aspx?sID=" + (int)adpSell.ScalarSellerID(uname, pwd));
            }
            else
            {
                lblMsg.Text = "Incorrect username or password.";
            }
        }