public void Update(Punish model) { var target = Find(model.ID); db.Attach<Punish>(target); target.Description = model.Description; target.MemberID = model.MemberID; target.Score = model.Score; target.RuleID = model.RuleID; target.LastUser = CookieHelper.MemberID; target.LastTime = DateTime.Now; db.Commit(); }
public Punish Create(ViewModels.PunishViewModel model) { Punish entity = new Punish(); entity.AddTime = DateTime.Now; entity.AddUser = CookieHelper.MemberID; entity.LastTime = DateTime.Now; entity.LastUser = CookieHelper.MemberID; entity.Description = model.Description; entity.MemberID = model.MemberID; entity.RuleID = model.RuleID; entity.Score = model.Score; db.Add<Punish>(entity); db.Commit(); return entity; }
public void Delete(Punish model) { var target = Find(model.ID); db.Remove<Punish>(target); db.Commit(); }
public void Create(Punish model) { db.Add<Punish>(model); db.Commit(); }