Пример #1
0
        private void ActDatasWhenBinding(IEnumerable items)
        {
            var bill = _dataContext.Master;

            foreach (var item in items)
            {
                DistributionProductShow p = (DistributionProductShow)item;
                p.Discount = _helper.GetDiscount(p.BYQID, bill.OrganizationID);
            }
        }
Пример #2
0
 void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (e.NewItems != null)
     {
         foreach (var newItem in e.NewItems)
         {
             DistributionProductShow item = (DistributionProductShow)newItem;
             item.Discount = _helper.GetDiscount(item.BYQID, VMGlobal.CurrentUser.OrganizationID);
         }
     }
     else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset && gvDatas.Items.Count > 0)//微软的Reset害死人,参看 http://msdn.microsoft.com/zh-cn/library/system.collections.specialized.notifycollectionchangedaction.aspx
     {
         foreach (var newItem in gvDatas.Items)
         {
             DistributionProductShow item = (DistributionProductShow)newItem;
             item.Discount = _helper.GetDiscount(item.BYQID, VMGlobal.CurrentUser.OrganizationID);
         }
     }
 }