Exemple #1
0
        public void Update(FileCate model)
        {
            var entity = Find(model.ID);
            db.Attach<FileCate>(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 FileCate Create(FileCateViewModel model)
        {
            var entity = new FileCate();
            entity.CateName=model.CateName;
            entity.PID=model.PID;
            entity.Code=model.Code;
            entity.Level=model.Level;
            entity.OrderIndex=model.OrderIndex;

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