public void TestQueryHaveAnsweredQuestionNumber() { userId = Convert.ToInt32(userAdapter.InsertUser("test", "123", "ceshiyuan", "male", "158", "*****@*****.**", null)); int answerId = questionManager.InsertUserAnswer(userId, examId, questionId, "A"); int count = questionManager.QueryHaveAnsweredQuestionNumber(userId, examId); Assert.AreEqual(1, count); userAdapter.DeleteUserById(userId); answerAdapter.DeleteUserAnswer(answerId); }
protected void rep_userlist_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.Equals("delete")) { UserTableAdapter ta_user = new UserTableAdapter(); ta_user.DeleteUserById(Convert.ToInt32(e.CommandArgument)); ValueInit(); } if (e.CommandName.Equals("update")) { Response.Redirect("user_alterpassword.aspx?id=" + e.CommandArgument); } }
public void TearDown() { adapter.DeleteUserById(id); }
public void TearDown() { userAdapter.DeleteUserById(userId); examAdapter.DeleteExamById(examId); UEAdapter.DeleteExamResult(ueId); }