Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public void Delete(Punish model)
 {
     var target = Find(model.ID);
     db.Remove<Punish>(target);
     db.Commit();
 }
Exemplo n.º 4
0
 public void Create(Punish model)
 {
     db.Add<Punish>(model);
     db.Commit();
 }