예제 #1
0
        public void DeleteStudentTest()
        {
            // Act
            _studentsService.DeleteStudent(42);

            // Assert
            _mockIStudentRepository.Verify(rs => rs.DeleteStudent(It.Is <int>(i => i == 42)));
        }
예제 #2
0
 //删除
 public int DeleteStudent(string loginId)
 {
     try
     {
         return(ss.DeleteStudent(loginId));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
        // DELETE /api/students/
        public IHttpActionResult DeleteStudent(int id)
        {
            studentsService = new StudentsService();

            studentsService.DeleteStudent(id);

            // delete all student subjects

            List <StudentToExpose> allStudents = studentsService.GetAllEnrolledStudents();

            return(Ok(allStudents));
        }
 private void DeleteBtn_Click(object sender, EventArgs e)
 {
     if (RollNoTb.Text != "")
     {
         _studentService.DeleteStudent(int.Parse(RollNoTb.Text));
         MessageBox.Show("Record Deleted!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         NameTb.ResetText();
         FatherNameTb.ResetText();
         GenderTb.Text = "Select One";
         PhoneTb.ResetText();
         AddressTb.ResetText();
         SessionTb.ResetText();
         AdminDateValue.ResetText();
         ClassTb.Text = "Select One";
         EmailTb.ResetText();
         DOBvalue.ResetText();
     }
     else
     {
         MessageBox.Show("Please Enter a RollNo!", "RollNo. is not provided", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
예제 #5
0
 public async Task <ActionResult <Student> > DeleteStudent(long id)
 {
     return(await _studentsService.DeleteStudent(id));
 }