public void Remove(CareerPathJobs CareerPJobs) { if (Context.Entry(CareerPJobs).State == EntityState.Detached) { context.CareerPathJobs.Attach(CareerPJobs); } context.CareerPathJobs.Remove(CareerPJobs); }
public ActionResult CreateCareerPathJobs(IEnumerable <CareerPathJobsViewModel> models, OptionsViewModel moreInfo) { var result = new List <CareerPathJobs>(); var datasource = new DataSource <CareerPathJobsViewModel>(); if (ModelState.IsValid) { foreach (CareerPathJobsViewModel c in models) { var PathJobs = new CareerPathJobs(); AutoMapper(new Models.AutoMapperParm { Destination = PathJobs, Source = c, ObjectName = "CareerPathJobs", Options = moreInfo, Transtype = TransType.Insert }); result.Add(PathJobs); _hrUnitOfWork.JobRepository.Add(PathJobs); } datasource.Errors = SaveChanges(Language); } else { datasource.Errors = Models.Utils.ParseErrors(ModelState.Values); } datasource.Data = (from model in models join r in result on model.CareerId equals r.CareerId select new CareerPathJobsViewModel { Id = r.Id, FormulaId = model.FormulaId, Performance = model.Performance, MinYears = model.MinYears, JobName = model.JobName, JobId = model.JobId, Sequence = model.Sequence }).ToList(); if (datasource.Errors.Count() > 0) { datasource.Data = models; return(Json(datasource)); } else { return(Json(datasource.Data)); } }
public DbEntityEntry <CareerPathJobs> Entry(CareerPathJobs CareerPjob) { return(Context.Entry(CareerPjob)); }
public void Attach(CareerPathJobs CareerPJobs) { context.CareerPathJobs.Attach(CareerPJobs); }
public void Add(CareerPathJobs CareerPJobs) { context.CareerPathJobs.Add(CareerPJobs); }