예제 #1
0
        private void emptyTable()
        {
            UsersTableModel        usersTableModel = new UsersTableModel();
            List <UsersTableModel> utms            = usersTableModel.getUserList();

            foreach (UsersTableModel utm in utms)
            {
                usersTableModel.deleteUser(utm);
            }
        }
예제 #2
0
        private void deleteEntry()
        {
            UsersTableModel        usersTableModel = new UsersTableModel();
            List <UsersTableModel> utms            = usersTableModel.getUserList();

            rip.deleteUser();
            utms = usersTableModel.getUserList();
            Assert.IsTrue(utms.Count == 3, "Der skulle være 3 personer i Users. Der er " + utms.Count);
            Assert.IsFalse(utms.Contains(rip), "Rip er ikke smuttet ud");
        }
예제 #3
0
        public ActionResult DeleteConfirmed(string id)
        {
            if (sessiondUserId() == null || sessiondUserId() == "")
            {
                return(RedirectToAction("logIn"));
            }

            /*
             * UsersTableModel usersTableModel = db.UsersTableModel.Find(id);
             * db.UsersTableModel.Remove(usersTableModel);
             * db.SaveChanges();
             */
            UsersTableModel usersTableModel = new UsersTableModel();

            usersTableModel.deleteUser(id);
            return(RedirectToAction("Index"));
        }