Ejemplo n.º 1
0
 public int 货品类别_Update(货品类别EditModel model)
 {
     using (var context = new BDKRContext())
     {
         var r = new Repository<货品类别>(context);
         var e = r.GetSingle(t => t.编码 == model.编码);
         if (null == e)
             throw new Exception("该类别信息并不存在");
         return r.Edit(e, t => t.编码 == model.编码);
     }
 }
Ejemplo n.º 2
0
 public int 货品类别_AddNew(货品类别EditModel model)
 {
     using (var context = new BDKRContext())
     {
         var r = new Repository<货品类别>(context);
         var n = new 货品类别
         {
             编码 = model.编码,
             名称 = model.类别名称,
             备注 = model.备注信息
         };
         return r.AddNew(n, t => t.编码 == model.编码);
     }
 }