Exemple #1
0
        //private List<OrganizationPriceFloat> _priceFloatCache = new List<OrganizationPriceFloat>();

        ///// <summary>
        ///// [根据发货价]获取下一机构的上浮价
        ///// </summary>
        ///// <param name="toOrganizationID">收货机构</param>
        ///// <param name="price">发货价</param>
        ///// <returns>上浮价</returns>
        //private decimal GetToOrganizationFloatPrice(int toOrganizationID, int byqID, decimal price)
        //{
        //    var pf = _priceFloatCache.FirstOrDefault(o => o.OrganizationID == toOrganizationID && o.BYQID == byqID);
        //    if (pf == null)
        //    {
        //        var temp = VMGlobal.SysProcessQuery.LinqOP.Search<OrganizationPriceFloat>(o => o.OrganizationID == toOrganizationID && o.BYQID == byqID).ToList();
        //        if (temp != null && temp.Count > 0)
        //            pf = temp[0];
        //        else
        //            pf = new OrganizationPriceFloat { BYQID = byqID, OrganizationID = toOrganizationID, FloatRate = 0, LastNumber = -1 };
        //        _priceFloatCache.Add(pf);
        //    }
        //    if (pf.LastNumber != -1)
        //    {
        //        price += pf.FloatRate * price * 0.01M;//上浮
        //        price *= 0.1M;
        //        price = decimal.Truncate(price) * 10 + pf.LastNumber;//尾数
        //    }
        //    return price;
        //}

        private void ActDatasWhenBinding(IEnumerable items)
        {
            var bill = _dataContext.Master;

            foreach (var item in items)
            {
                ProductForDelivery p = (ProductForDelivery)item;
                //p.Discount = _helper.GetDiscount(p.BYQID, bill.ToOrganizationID);
                //p.FloatPrice = this.GetToOrganizationFloatPrice(bill.ToOrganizationID, p.BYQID, p.Price);
                if (ckWriteDownOrder.IsChecked.Value)
                {
                    p.OrderQuantity = BillLogic.GetRemainOrderQuantity(bill.ToOrganizationID, p.ProductID);
                }
            }
        }
Exemple #2
0
        private void ckWriteDownOrder_Checked(object sender, RoutedEventArgs e)
        {
            if (gvDatas.RowStyleSelector == null)
            {
                DeliveryRowStyleSelector deliveryRowStyleSelector = (DeliveryRowStyleSelector)gridLayout.Resources["deliveryRowStyleSelector"];
                gvDatas.RowStyleSelector = deliveryRowStyleSelector;
            }
            var context = (BillDeliveryPackageVM)this.DataContext;
            var bill    = context.Master;

            foreach (var item in gvDatas.Items)
            {
                ProductForDelivery p = (ProductForDelivery)item;
                p.OrderQuantity = BillLogic.GetRemainOrderQuantity(bill.ToOrganizationID, p.ProductID);
            }
        }