Beispiel #1
0
        protected void btnLogin_Click1(object sender, EventArgs e)
        {
            int    storeNumber;
            string login, password;

            storeNumber = Convert.ToInt32(txtStoreNumber.Text);
            login       = txtAdminLogin.Text;
            password    = txtPassword.Text;

            List <Employee> allAdmins = EmployeeDA.GetAllManagers();

            foreach (Employee admin in allAdmins)
            {
                if ((storeNumber == Convert.ToInt16(admin.StoreNum)) &&
                    login == Convert.ToString(admin.Login) &&
                    EmployeeDA.VerifyLogin(login, password))
                {
                    Session["employee"] = admin;
                    Session["role"]     = admin.EmployeeRole;
                    Session["storeNum"] = admin.StoreNum;
                    Response.Redirect("Default.aspx");
                }
            }
        }