public void Update(TraceLog model) { var entity = Find(model.ID); db.Attach<TraceLog>(entity); entity.CompanyID=model.CompanyID; entity.AddTime=model.AddTime; entity.Content=model.Content; entity.Comment=model.Comment; entity.CommentTitme=model.CommentTitme; entity.AddUser=model.AddUser; entity.RelationID=model.RelationID; db.Commit(); }
public TraceLog Create(TraceLogViewModel model) { var entity = new TraceLog(); entity.CompanyID=model.CompanyID; entity.AddTime=model.AddTime; entity.Content=model.Content; entity.Comment=model.Comment; entity.CommentTitme=model.CommentTitme; entity.AddUser=model.AddUser; entity.RelationID=model.RelationID; db.Add<TraceLog>(entity); db.Commit(); return entity; }
public void Delete(TraceLog model) { var target = Find(model.ID); db.Remove<TraceLog>(target); db.Commit(); }
public void Create(TraceLog model) { db.Add<TraceLog>(model); db.Commit(); }