public void UpdateFormSalePaymentFreeGoods(int FormSalePaymentFreeGoodsID, int SKUID, decimal DeliveryPrice, decimal Quantity, string Remark) { FormDS.FormSalePaymentFreeGoodsRow rowDetail = this.FormDataSet.FormSalePaymentFreeGoods.FindByFormSalePaymentFreeGoodsID(FormSalePaymentFreeGoodsID); rowDetail.SKUID = SKUID; MasterData.SKURow sku = new MasterDataBLL().GetSKUById(SKUID)[0]; if (!sku.IsPackPerCaseNull()) { rowDetail.PackPerCase = sku.PackPerCase; } rowDetail.DeliveryPrice = DeliveryPrice; rowDetail.Quantity = Quantity; rowDetail.AmountRMB = decimal.Round(Quantity * DeliveryPrice, 2); rowDetail.Remark = Remark; }
public void AddFormSalePaymentFreeGoods(int? FormSalePaymentID, int SKUID, decimal DeliveryPrice, decimal Quantity, string Remark) { FormDS.FormSalePaymentFreeGoodsRow rowDetail = this.FormDataSet.FormSalePaymentFreeGoods.NewFormSalePaymentFreeGoodsRow(); rowDetail.FormSalePaymentID = FormSalePaymentID.GetValueOrDefault(); rowDetail.SKUID = SKUID; MasterData.SKURow sku = new MasterDataBLL().GetSKUById(SKUID)[0]; if (!sku.IsPackPerCaseNull()) { rowDetail.PackPerCase = sku.PackPerCase; } rowDetail.DeliveryPrice = DeliveryPrice; rowDetail.Quantity = Quantity; rowDetail.AmountRMB = decimal.Round(Quantity * DeliveryPrice, 2); rowDetail.Remark = Remark; this.FormDataSet.FormSalePaymentFreeGoods.AddFormSalePaymentFreeGoodsRow(rowDetail); }
protected void UCSKU_SelectedIndexChanged(object sender, EventArgs e) { UserControls_SKUControl UCSKU = (UserControls_SKUControl)this.gvFreeGoods.Rows[gvFreeGoods.EditIndex].FindControl("UCSKU"); TextBox PackPerCaseCtl = (TextBox)this.gvFreeGoods.Rows[gvFreeGoods.EditIndex].FindControl("PackPerCaseCtl"); TextBox DeliveryPriceCtl = (TextBox)this.gvFreeGoods.Rows[gvFreeGoods.EditIndex].FindControl("DeliveryPriceCtl"); TextBox QuantityCtl = (TextBox)this.gvFreeGoods.Rows[gvFreeGoods.EditIndex].FindControl("QuantityCtl"); TextBox AmountRMBCtl = (TextBox)this.gvFreeGoods.Rows[gvFreeGoods.EditIndex].FindControl("AmountRMBCtl"); if (UCSKU.SKUID != string.Empty) { MasterData.SKURow sku = new MasterDataBLL().GetSKUById(int.Parse(UCSKU.SKUID))[0]; if (!sku.IsPackPerCaseNull()) { PackPerCaseCtl.Text = sku.PackPerCase; } MasterData.CustomerRow customer = new MasterDataBLL().GetCustomerById((int)this.ViewState["CustomerID"])[0]; decimal MAAPrice = new MasterDataBLL().GetSKUPriceByParameter(int.Parse(UCSKU.SKUID), customer.CustomerTypeID, customer.CustomerChannelID); DeliveryPriceCtl.Text = MAAPrice.ToString("N"); if (QuantityCtl.Text != string.Empty) { decimal quantity = decimal.Parse(QuantityCtl.Text); AmountRMBCtl.Text = decimal.Round(MAAPrice * quantity, 2).ToString(); } } else { PackPerCaseCtl.Text = ""; DeliveryPriceCtl.Text = ""; AmountRMBCtl.Text = ""; } }