public void Delete(int id) { var entity = _studentDal.Get(p => p.Id == id); _studentDal.Delete(entity); _studentDal.Save(); }
public IResult Delete(int studentId) { var result = _studentDal.Get(f => f.Id == studentId); if (result != null) { _studentDal.Delete(result); return(new SuccessResult(Messages.StudentDeleted)); } return(new ErrorResult(Messages.DoesntExist)); }
public IResult Delete(Student student) { try { _IStudentDal.Delete(student); return(new SuccessResult(message: Contants.Messages.DeleteMessage)); } catch (Exception ex) { return(new ErrorResult(message: ex.Message)); } }
public IResult DeleteStudent(Student student) { try { _studentDal.Delete(student); } catch (Exception) { return(new ErrorResult("Student cannot be deleted")); } return(new SuccessResult("Student deleted")); }
public void Delete(Student entity) { var record = _departmentRecordService.GetAll().SingleOrDefault(p => p.StudentTc.Equals(entity.Tc) && p.Major == Major.CiftAnaDal); if (record != null) { var result = Message.Warning("Öğrenci hem Ana Bilim Dalı hemde Çift Anadal programına kayıtlı.\n" + "Öğrenciyi sadece Çift Anadal Programından silmek ister misin?"); if (result == System.Windows.Forms.DialogResult.Yes) { _departmentRecordService.Delete(record); Message.Info("Öğrenci Çift Anadal Programından silindi!"); return; } } var studentNo = _departmentRecordService.GetAll().SingleOrDefault(p => p.StudentTc.Equals(entity.Tc)).StudentNo; try { _lessonRecordService.DeleteByStudentNo(studentNo); } catch (Exception) { Message.Error("Hata Oluştu!"); return; } try { _studentDal.Delete(entity); Message.Info("Öğrenci Silindi!"); } catch { Message.Error("Öğrenci Silinemedi!"); } }
public void Delete(Student entity) { _studentDal.Delete(entity); }
public void Delete(Student student) { _studentDal.Delete(student); }
public async Task Delete(int id) { await _studentDal.Delete(id); }
public IResult Delete(Student student) { _studentDal.Delete(student); return(new SuccessResult(Messages.StudentDeleted)); }
public void Delete(IStudentDal iStudentDal) { iStudentDal.Delete(); }
public void Delete(Guid id) { _studentdal.Delete(id); }
public bool Delete(int id) { return(studentDal.Delete(id)); }
public Student Delete(Student entity) { return(_studentDal.Delete(entity)); }