public bool UpdateCatJobTitle(Cat_JobTitle CatJobTitle) { using (var context = new VnrHrmHrDataContext()) { IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); Cat_JobTitleRepository repo = new Cat_JobTitleRepository(unitOfWork); try { repo.Edit(CatJobTitle); repo.SaveChanges(); return(true); } catch { return(false); } } }
public bool AddCatJobTitles(Cat_JobTitle CatJobTitle) { using (var context = new VnrHrmHrDataContext()) { IUnitOfWork unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); Cat_JobTitleRepository repo = new Cat_JobTitleRepository(unitOfWork); try { repo.Add(CatJobTitle); repo.SaveChanges(); return true; } catch { return false; } } }
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; } } }