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

            db.Commit();
        }
Exemplo n.º 2
0
        public JobCate Create(JobCateViewModel model)
        {
            var entity = new JobCate();
            entity.CateName=model.CateName;
            entity.PID=model.PID;
            entity.Code=model.Code;
            entity.Level=model.Level;
            entity.OrderIndex=model.OrderIndex;

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