public void Update(PlanLog model) { var entity = Find(model.ID); db.Attach<PlanLog>(entity); entity.CompanyID = model.CompanyID; entity.AddTime = model.AddTime; entity.PlanTime = model.PlanTime; entity.Content = model.Content; entity.Comment = model.Comment; entity.CommentTitme = model.CommentTitme; entity.AddUser = model.AddUser; db.Commit(); }
public PlanLog Create(PlanLogViewModel model) { PlanLog entity = new PlanLog(); entity.AddTime = DateTime.Now; entity.AddUser = 227; entity.CompanyID = model.CompanyID; entity.Content = model.Content; entity.PlanTime = model.PlanTime; entity.CommentTitme = DateTime.Now.AddMonths(1); db.Add<PlanLog>(entity); db.Commit(); return entity; }
public void Delete(PlanLog model) { var target = Find(model.ID); db.Remove<PlanLog>(target); db.Commit(); }
public void Create(PlanLog model) { db.Add<PlanLog>(model); db.Commit(); }