示例#1
0
 void BalanceObjChangeQuota(object sender, EventChangeBalance e)
 {
     using (var oc = unityContainer.Resolve <OrderDataContext>())
     {
         oc.DataBaseContext.sp_upd_GoodsQuota(e.GoodsObj.Code, e.GoodsObj.Quota);
     }
 }
示例#2
0
 void MinOrderObjChangeMinOrder(object sender, EventChangeBalance e)
 {
     using (var oc = unityContainer.Resolve <OrderDataContext>())
     {
         oc.DataBaseContext.sp_upd_GoodsBalance(e.GoodsObj.id, e.GoodsObj.Quantity, WindowsIdentity.GetCurrent().Name);
         var gb = oc.DataBaseContext.sp_sel_GoodsBalanceQuotaById(e.GoodsObj.id).Single();
         e.GoodsObj.MinQuantity = gb.MinQuantity.GetValueOrDefault(0);
     }
 }
示例#3
0
 void BalanceObjBeforeChangeBalance(object sender, ref bool allow, double quant, EventChangeBalance e)
 {
     using (var oc = unityContainer.Resolve <OrderDataContext>())
     {
         allow = oc.DataBaseContext.IsAllowCangeQuantity(e.GoodsObj.id, quant).GetValueOrDefault(false);
         if (!allow)
         {
             OnChangeQuantityDenied(e.GoodsObj.Quantity, e.GoodsObj.MinQuantity);
         }
     }
 }