public int AddForeignAgencyJob(ForeignAgencyJob agencyjob) { agencyjob.IsActive = true; _context.ForeignAgencyJobs.Add(agencyjob); _context.SaveChanges(); return(agencyjob.Id); }
public bool RemoveForeignAgencyJob(int Id) { ForeignAgencyJob agencyjob = GetForeignAgencyJobById(Id); if (agencyjob == null) { return(false); } _context.Remove(agencyjob); _context.SaveChanges(); return(true); }
public bool UpdateForeignAgencyJob(int Id, ForeignAgencyJob agencyjob) { ForeignAgencyJob existagencyjob = GetForeignAgencyJobById(Id); if (existagencyjob == null) { return(false); } existagencyjob.NationalityId = agencyjob.NationalityId; existagencyjob.IsActive = agencyjob.IsActive; existagencyjob.JobTypeId = agencyjob.JobTypeId; existagencyjob.Price = agencyjob.Price; _context.Update(existagencyjob); _context.SaveChanges(); return(true); }