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