コード例 #1
0
        //修改加盟价
        protected void txt_ChangeJoinPrice_OnTextChanged(object sender, EventArgs e)
        {
            var textBox  = (TextBox)sender;
            var dataItem = ((GridDataItem)textBox.Parent.Parent);

            if (dataItem != null)
            {
                var goodsId      = new Guid(dataItem.GetDataKeyValue("GoodsID").ToString());
                var joinPriceNew = Convert.ToDecimal(textBox.Text);
                try
                {
                    string errorMsg;
                    bool   result = _goodsCenterSao.UpdateJoinPrice(goodsId, joinPriceNew, out errorMsg);
                    if (result)
                    {
                        var goodsCode    = dataItem.GetDataKeyValue("GoodsCode").ToString();
                        var goodsName    = dataItem.GetDataKeyValue("GoodsName").ToString();
                        var joinPriceOld = Convert.ToDecimal(dataItem.GetDataKeyValue("JoinPrice").ToString());
                        if (!joinPriceOld.Equals(joinPriceNew))
                        {
                            var goodsPriceChange = new Model.GoodsPriceChange
                            {
                                Id               = Guid.NewGuid(),
                                Name             = CurrentSession.Personnel.Get().RealName,
                                Datetime         = DateTime.Now,
                                GoodsId          = goodsId,
                                GoodsName        = goodsName,
                                GoodsCode        = goodsCode,
                                SaleFilialeId    = Guid.Empty,
                                SaleFilialeName  = string.Empty,
                                SalePlatformId   = Guid.Empty,
                                SalePlatformName = string.Empty,
                                OldPrice         = joinPriceOld,
                                NewPrice         = joinPriceNew,
                                Quota            = joinPriceOld - joinPriceNew,
                                Type             = 1
                            };
                            _goodsPriceChange.AddGoodsPriceChange(goodsPriceChange);
                        }
                        RG_GoodsPriceList.Rebind();
                    }
                }
                catch (Exception ex)
                {
                    RAM.Alert("无效的操作。" + ex.Message);
                }
            }
        }
コード例 #2
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     RG_GoodsPriceList.Rebind();
 }