Exemple #1
0
 public void DeleteComplaint(int id)
 {
     //unitOfWork.StartTransaction();
     ComplaintRepository repo = new ComplaintRepository(unitOfWork);
     ComplaintModel complaintModel = new ComplaintModel();
     Complaint complaint = new Complaint();
     complaint = repo.GetAll().Where(x => x.ComplaintId == id).SingleOrDefault();
     repo.Delete(x => x.ComplaintId == complaint.ComplaintId);
     //unitOfWork.Commit();
 }
Exemple #2
0
 public void DeleteComplaintbyEmployeeId(string id)
 {
     //unitOfWork.StartTransaction();
     ComplaintRepository repo = new ComplaintRepository(unitOfWork);
     ComplaintModel complaintModel = new ComplaintModel();
        List<Complaint> complaints = new List<Complaint>();
     complaints = repo.GetAll().Where(x => x.EmployeeId == id).ToList();
     complaints.ForEach(x =>
     {
         repo.Delete(y => y.ComplaintId == x.ComplaintId);
     });
     //unitOfWork.Commit();
 }