コード例 #1
0
        public void CountPropertyOk()
        {
            clsUserCollection AllUsers = new clsUserCollection();
            Int32             count    = 12;

            AllUsers.Count = count;
            Assert.AreEqual(AllUsers.Count, count);
        }
        protected void LoadUserData()
        {
            try
            {
                clsUserCollection AllUsers = new clsUserCollection();
                grdAllUsers.DataSource = AllUsers.AllUsers;
                grdAllUsers.DataBind();

                pnlAllUsers.Visible = true;
            }
            catch
            {
                pnlError.Visible = true;
            }
        }
コード例 #3
0
        public void CountMatchesList()
        {
            clsUserCollection Users    = new clsUserCollection();
            List <clsUser>    TestList = new List <clsUser>();
            clsUser           TestItem = new clsUser();

            TestItem.UserId         = 1;
            TestItem.Email          = "*****@*****.**";
            TestItem.EmailConfirmed = "true";
            TestItem.UserName       = "******";
            TestItem.LockoutEnabled = "False";
            TestList.Add(TestItem);
            Users.AllUsers = TestList;
            Assert.AreEqual(Users.Count, TestList.Count);
        }
        protected void LoadStaffMemberData()
        {
            clsStaffMemberCollection AllStaffMembers = new clsStaffMemberCollection();

            grdAllStaffMembers.DataSource = AllStaffMembers.AllStaffMembers;
            grdAllStaffMembers.DataBind();

            clsUserCollection AllUsers = new clsUserCollection();

            ddlUserId.DataSource     = AllUsers.AllUsers;
            ddlUserId.DataValueField = "UserId";
            ddlUserId.DataTextField  = "UserId";
            ddlUserId.DataBind();

            pnlAllStaffMembers.Visible = true;
        }
コード例 #5
0
        protected void btnDeleteAccount_Click(object sender, EventArgs e)
        {
            try
            {
                var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
                var signinManager = Context.GetOwinContext().GetUserManager<ApplicationSignInManager>();

                //Int32 userId = 50; //note that this UserId is hard-coded and temporary - the real one will be the one that you retrieve when you sign in 
                var user = manager.FindById(userId);
                manager.Delete(user);
                clsEmail AnEmail = new clsEmail(user.Email);
                AnEmail.SendAccountClosedEmail();

                clsUserCollection AllUsers = new clsUserCollection();
                AllUsers.RemoveUserFromSystem(userId);

                Response.Redirect("Homepage.aspx");
            }
            catch
            {
                pnlError.Visible = true;
            }
        }
コード例 #6
0
        public void InstanceOk()
        {
            clsUserCollection AllUsers = new clsUserCollection();

            Assert.IsNotNull(AllUsers);
        }