Ejemplo n.º 1
0
 public Cat_JobTitle GetByIdCatJobTitles(int id)
 {
     using (var context = new VnrHrmHrDataContext())
     {
         IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         Cat_JobTitleRepository repo = new Cat_JobTitleRepository(unitOfWork);
         Cat_JobTitle CatJobTitle = new Cat_JobTitle();
         CatJobTitle = repo.GetById(id);
         if (CatJobTitle.IsDelete == true) CatJobTitle = null;
         return CatJobTitle;
     }
 }
Ejemplo n.º 2
0
 public Cat_JobTitle GetByIdCatJobTitles(int id)
 {
     using (var context = new VnrHrmHrDataContext())
     {
         IUnitOfWork            unitOfWork  = (IUnitOfWork)(new UnitOfWork(context));
         Cat_JobTitleRepository repo        = new Cat_JobTitleRepository(unitOfWork);
         Cat_JobTitle           CatJobTitle = new Cat_JobTitle();
         CatJobTitle = repo.GetById(id);
         if (CatJobTitle.IsDelete == true)
         {
             CatJobTitle = null;
         }
         return(CatJobTitle);
     }
 }
Ejemplo n.º 3
0
 public bool DeleteEternity(int CatJobTitleId)
 {
     using (var context = new VnrHrmHrDataContext())
     {
         IUnitOfWork            unitOfWork  = (IUnitOfWork)(new UnitOfWork(context));
         Cat_JobTitleRepository repo        = new Cat_JobTitleRepository(unitOfWork);
         Cat_JobTitle           CatJobTitle = new Cat_JobTitle();
         CatJobTitle = repo.GetById(CatJobTitleId);
         try
         {
             repo.Delete(CatJobTitle);
             repo.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
Ejemplo n.º 4
0
        public bool DeleteCatJobTitle(int CatJobTitleId)
        {
            using (var context = new VnrHrmHrDataContext())
            {
                IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                Cat_JobTitleRepository repo = new Cat_JobTitleRepository(unitOfWork);
                Cat_JobTitle CatJobTitle = new Cat_JobTitle();
                CatJobTitle = repo.GetById(CatJobTitleId);
                try
                {
                    repo.Remove(CatJobTitle);
                    repo.SaveChanges();
                    return true;
                }
                catch
                {
                    return false;
                }

            }
        }