Example #1
0
 public static void Create(PayAbsenceDTO payAbsence)
 {
     using (Entities db = new Entities())
     {
         db.PayAbsences.Add(_CastDTO.DTOToPayAbsence(payAbsence));
         db.SaveChanges();
     }
 }
Example #2
0
 public static void Delete(PayAbsenceDTO payAbsence)
 {
     using (Entities db = new Entities())
     {
         var pAbs = db.PayAbsences.FirstOrDefault(pa => pa.Id == payAbsence.Id);
         db.PayAbsences.Remove(pAbs);
         db.SaveChanges();
     }
 }
Example #3
0
 public static void Update(PayAbsenceDTO payAbsence)
 {
     using (Entities db = new Entities())
     {
         var pAbs = db.PayAbsences.FirstOrDefault(pa => pa.Id == payAbsence.Id);
         pAbs.Id         = payAbsence.Id;
         pAbs.Name       = payAbsence.Name;
         pAbs.IsStandart = payAbsence.IsStandart;
         db.SaveChanges();
     }
 }