public void Update(JobCate model) { var entity = Find(model.ID); db.Attach<JobCate>(entity); entity.CateName=model.CateName; entity.PID=model.PID; entity.Code=model.Code; entity.Level=model.Level; entity.OrderIndex=model.OrderIndex; db.Commit(); }
public JobCate Create(JobCateViewModel model) { var entity = new JobCate(); entity.CateName=model.CateName; entity.PID=model.PID; entity.Code=model.Code; entity.Level=model.Level; entity.OrderIndex=model.OrderIndex; db.Add<JobCate>(entity); db.Commit(); return entity; }
public void Delete(JobCate model) { var target = Find(model.ID); db.Remove<JobCate>(target); db.Commit(); }
public void Create(JobCate model) { db.Add<JobCate>(model); db.Commit(); }