/// <summary>加载赠品商品 /// </summary> private void LoadGiftGoods() { var goodsGiftList = _goodsCenterSao.GetAllGiftList(); var result = WMSSao.BindGift(goodsGiftList.Select(ent => ent.Key)); foreach (var item in goodsGiftList) { var goodsStock = result.ContainsKey(item.Key) ? result[item.Key] : 0; GoodsGiftList.Items.Add(new RadListBoxItem(item.Value + " [" + goodsStock + "]", item.Key.ToString())); } }
/// <summary>RCB_GoodsGift下拉选择事件 /// </summary> protected void RCB_GoodsGiftOnSelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { var rlbGoodsGift = new RadListBoxItem(e.Text, e.Value); if (!string.IsNullOrEmpty(e.Value) && RCB_GoodsGift.FindItemByValue(e.Value) == null) { var item = GoodsGiftList.Items.FirstOrDefault(ent => ent.Value == rlbGoodsGift.Value); if (item == null) { var goodsId = new List <Guid> { new Guid(e.Value) }; var result = WMSSao.BindGift(goodsId); var quantity = result.ContainsKey(new Guid(rlbGoodsGift.Value)) ? result[new Guid(rlbGoodsGift.Value)] : 0; GoodsGiftList.Items.Add(new RadListBoxItem(rlbGoodsGift.Text + " [" + quantity + "]", rlbGoodsGift.Value)); } RCB_GoodsGift.Text = string.Empty; } }
protected void ShowGoodsGiftList(Guid goodsId) { try { if (goodsId != Guid.Empty) { var result = _goodsCenterSao.GetGoodsGiftList(goodsId); GoodsGiftList.Items.Clear(); if (result != null && result.Count > 0) { var goodsStockDic = WMSSao.BindGift(result.Select(ent => ent.Key)); foreach (var item in result) { var quantity = goodsStockDic.ContainsKey(item.Key) ? goodsStockDic[item.Key] : 0; GoodsGiftList.Items.Add(new RadListBoxItem(item.Value + " [" + quantity + "]", item.Key.ToString())); } } } } catch (Exception) { RAM.Alert("温馨提示:操作失败!"); } }