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

            db.Commit();
        }
Exemple #2
0
        public CoopCate Create(CoopCateViewModel model)
        {
            var entity = new CoopCate();
            entity.CateName=model.CateName;
            entity.PID=model.PID;
            entity.Code=model.Code;
            entity.Level=model.Level;
            entity.OrderIndex=model.OrderIndex;

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