Ejemplo n.º 1
0
 public Cat_Position GetByIdCatPositions(int id)
 {
     using (var context = new VnrHrmHrDataContext())
     {
         IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         Cat_PositionRepository repo = new Cat_PositionRepository(unitOfWork);
         Cat_Position CatPosition = new Cat_Position();
         CatPosition = repo.GetById(id);
         if (CatPosition.IsDelete == true) CatPosition = null;
         return CatPosition;
     }
 }
Ejemplo n.º 2
0
 public Cat_Position GetByIdCatPositions(int id)
 {
     using (var context = new VnrHrmHrDataContext())
     {
         IUnitOfWork            unitOfWork  = (IUnitOfWork)(new UnitOfWork(context));
         Cat_PositionRepository repo        = new Cat_PositionRepository(unitOfWork);
         Cat_Position           CatPosition = new Cat_Position();
         CatPosition = repo.GetById(id);
         if (CatPosition.IsDelete == true)
         {
             CatPosition = null;
         }
         return(CatPosition);
     }
 }
Ejemplo n.º 3
0
 public bool DeleteEternity(int CatPositionId)
 {
     using (var context = new VnrHrmHrDataContext())
     {
         IUnitOfWork            unitOfWork  = (IUnitOfWork)(new UnitOfWork(context));
         Cat_PositionRepository repo        = new Cat_PositionRepository(unitOfWork);
         Cat_Position           CatPosition = new Cat_Position();
         CatPosition = repo.GetById(CatPositionId);
         try
         {
             repo.Delete(CatPosition);
             repo.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
Ejemplo n.º 4
0
        public bool DeleteCatPosition(int CatPositionId)
        {
            using (var context = new VnrHrmHrDataContext())
            {
                IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                Cat_PositionRepository repo = new Cat_PositionRepository(unitOfWork);
                Cat_Position CatPosition = new Cat_Position();
                CatPosition = repo.GetById(CatPositionId);
                try
                {
                    repo.Remove(CatPosition);
                    repo.SaveChanges();
                    return true;
                }
                catch
                {
                    return false;
                }

            }
        }