Esempio n. 1
0
        public void Update(RuleCate model)
        {
            var entity = Find(model.ID);
            db.Attach<RuleCate>(entity);
            entity.CateName=model.CateName;
            entity.PID=model.PID;
            entity.Code=model.Code;
            entity.Level=model.Level;
            entity.OrderIndex=model.OrderIndex;

            db.Commit();
        }
Esempio n. 2
0
        public RuleCate Create(RuleCateViewModel model)
        {
            var entity = new RuleCate();
            entity.CateName=model.CateName;
            entity.PID=model.PID;
            entity.Code=model.Code;
            entity.Level=model.Level;
            entity.OrderIndex=model.OrderIndex;

            db.Add<RuleCate>(entity);
            db.Commit();
            return entity;
        }
Esempio n. 3
0
 public void Delete(RuleCate model)
 {
     var target = Find(model.ID);
     db.Remove<RuleCate>(target);
     db.Commit();
 }
Esempio n. 4
0
 public void Create(RuleCate model)
 {
     db.Add<RuleCate>(model);
     db.Commit();
 }