コード例 #1
0
        public void OnLogin (object sender, EventArgs e)
        {
            for (int i = 0; i < listOfStaff.Count; i++)
            {
                Staff staffMember = (Staff)listOfStaff[i];
                bool isAuth = staffMember.IsAuth(NameInput.Text, PasswordInput.Text);

                if (isAuth)
                {
                    Response.Redirect("Profile.aspx");
                    return;
                } else
                {
                    ErrMessage.Text = "Incorrect login";
                }
            }

            for (int i = 0; i < listOfMagic.Count; i++)
            {
                Magician magicMember = (Magician)listOfMagic[i];
                bool isAuth = magicMember.IsAuth(NameInput.Text, PasswordInput.Text);

                if (isAuth)
                {
                    Response.Redirect("Profile.aspx");
                    return;
                } else
                {
                    ErrMessage.Text = "Incorrect login";
                }
            }
        }
コード例 #2
0
        protected void OnRegisterStaff(object sender, EventArgs e)
        {
            Magician staff = new Magician(SalaryInput.Text, NameInput.Text, PasswordInput.Text);

            ArrayList listOfStaff = (ArrayList)Application["listOfStaff"];

            listOfStaff.Add(staff);

            Application["listOfMagic"] = listOfStaff;
            Response.Redirect("Sessions.aspx");
        }
コード例 #3
0
        protected void OnRegisterMagic(object sender, EventArgs e)
        {
            Magician magician = new Magician(TrickInput.Text, NameInput.Text, PasswordInput.Text);

            ArrayList listOfMagicians = (ArrayList)Application["listOfMagic"];

            listOfMagicians.Add(magician);

            Application["listOfMagic"] = listOfMagicians;
            Response.Redirect("Sessions.aspx");
        }