Example #1
0
 public void DeleteSpecialPosition(SpecialPosition selectedPosition)
 {
     using (var scope = Db.BeginWork())
     {
         var baseEntity = _specialPositionRepository.Get(u => u.Id == selectedPosition.Id);
         if (baseEntity != null)
         {
             _specialPositionRepository.Delete(baseEntity);
             scope.SaveChanges();
         }
     }
 }
Example #2
0
 public void AddOrUpdateSpecialPosition(SpecialPosition sp)
 {
     using (var scope = Db.BeginWork())
     {
         var emp = sp.Executor;
         if (emp != null)
         {
             sp.ExecutorId = emp.Id;
         }
         sp.Executor = null;
         _specialPositionRepository.AddOrUpdate(sp);
         scope.SaveChanges();
         sp.Executor = emp;
     }
 }