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; } }
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); } }
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); } } }
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; } } }