public void Student_DeleteTest() { StudentDAO dao = new StudentDAO(); int studentsDeleted = dao.Delete(dao.GetByLastName("Desjardins").Id); Assert.True(studentsDeleted != -1); }
// Brisanje studenta public static void BrisanjePodatakaOStudentu() { Student st = PronadjiStudenta(); if (st != null) { StudentDAO.Delete(Program.conn, st.Id); } }
public ActionResult Delete(int Id) { StudentDAO studentDAO = new StudentDAO(); studentDAO.Delete(Id); List <StudentModel> students = studentDAO.FetchAll(); return(View("Index", students)); }
public void DeleteStudent(int id) { if (studentDAO.Delete(id)) { //do not thing } else { throw new Exception("Delete Fail!"); } }
public object Delete(Student info) { try { var model = info.Map(); using (var dao = new StudentDAO()) { return(dao.Delete(model)); } } catch (Exception) { throw; } }
private void btnDelete_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Sure u wanna delete this student?", "Confirm!", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { Student s = (Student)dataGridViewStudent.CurrentRow.DataBoundItem; Account a = AccountDAO.GetAccountByUsername(s.Username); Room r = new Room(s.RoomName, s.Gender, s.BedNo, 0, RoomDAO.getRoomPrice(s.RoomName)); RoomDAO.Update(r); StudentDAO.Delete(s.StuID); AccountDAO.Delete(a); } else { return; } LoadData(); }
public JsonResult Delete(string[] id) { try { int[] status = new int[id.Length]; for (int i = 0; i < id.Length; i++) { status[i] = dao.Delete(id[i]); } return(Json(new { status = status })); } catch (Exception) { return(Json(new { status = 0 })); } }
public JsonResult Delete(int id) { var lst = dao.Delete(id); return(Json(lst, JsonRequestBehavior.AllowGet)); }
public void StudentDelete(string no) { StudentDAO sDAO = new StudentDAO(); sDAO.Delete(no); }
public void DeleteStudent(int id) { StudentDAO st = new StudentDAO(); st.Delete(id); }
public static bool Delete(Guid id) { return(StudentDAO.Delete(id)); }