예제 #1
0
 public CityCate Create(CityCateViewModel model)
 {
     var entity = new CityCate();
     entity.CateName = model.CateName;
     entity.PID = model.PID;
     entity.Code = model.Code;
     entity.Level = model.Level;
     entity.OrderIndex = model.OrderIndex;
     db.Add<CityCate>(entity);
     db.Commit();
     return entity;
 }
예제 #2
0
 public void Update(CityCate model)
 {
     var entity = Find(model.ID);
     db.Attach<CityCate>(entity);
     entity.CateName = model.CateName;
     entity.PID = model.PID;
     entity.Code = model.Code;
     entity.Level = model.Level;
     entity.OrderIndex = model.OrderIndex;
     db.Commit();
 }
예제 #3
0
 public void Delete(CityCate model)
 {
     var target = Find(model.ID);
     db.Remove<CityCate>(target);
     db.Commit();
 }
예제 #4
0
 public void Create(CityCate model)
 {
     db.Add<CityCate>(model);
     db.Commit();
 }