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

            db.Commit();
        }
Beispiel #2
0
        public SourceCate Create(SourceCateViewModel model)
        {
            var entity = new SourceCate();
            entity.CateName=model.CateName;
            entity.PID=model.PID;
            entity.Code=model.Code;
            entity.Level=model.Level;
            entity.OrderIndex=model.OrderIndex;

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