Exemple #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();
        }
Exemple #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;
        }
Exemple #3
0
 public void Delete(JobCate model)
 {
     var target = Find(model.ID);
     db.Remove<JobCate>(target);
     db.Commit();
 }
Exemple #4
0
 public void Create(JobCate model)
 {
     db.Add<JobCate>(model);
     db.Commit();
 }