public void Update(JobTitleCate model) { var entity = Find(model.ID); db.Attach<JobTitleCate>(entity); entity.CateName = model.CateName; entity.PID = model.PID; entity.Code = model.Code; entity.Level = model.Level; entity.OrderIndex = model.OrderIndex; db.Commit(); }
public JobTitleCate Create(JobTitleCateViewModel model) { var entity = new JobTitleCate(); entity.CateName = model.CateName; entity.PID = model.PID; entity.Code = model.Code; entity.Level = model.Level; entity.OrderIndex = model.OrderIndex; var departArray = model.DepartmentID.Split(',').Select(x => Convert.ToInt32(x)).ToList(); var DepartmentList = DepartmentService.GetALL().Where(x => departArray.Contains(x.ID)); entity.Department.AddRange(DepartmentList); db.Add<JobTitleCate>(entity); db.Commit(); return entity; }
public void Delete(JobTitleCate model) { var target = Find(model.ID); db.Remove<JobTitleCate>(target); db.Commit(); }
public void Create(JobTitleCate model) { db.Add<JobTitleCate>(model); db.Commit(); }