private void emptyTable() { UsersTableModel usersTableModel = new UsersTableModel(); List <UsersTableModel> utms = usersTableModel.getUserList(); foreach (UsersTableModel utm in utms) { usersTableModel.deleteUser(utm); } }
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"); }
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")); }