Ejemplo n.º 1
0
        private void btnReturn_Click(object sender, System.EventArgs e)
        {
            if (!TradeHelper.CanReturn(this.hdorderId.Value))
            {
                this.ShowMessage("已有待确认的申请!", false);
                return;
            }
            if (!this.CanReturnBalance())
            {
                this.ShowMessage("请先开通预付款账户", false);
                return;
            }
            string dropLogisticsCompanyVal = LogisticsCompany.Value; //dropLogisticsCompany.SelectedItem.Text;
            string txtLogisticsIdVal       = LogisticsId.Value;
            string skuids       = skuIds.Value;
            string quantitylist = quantityList.Value;
            //if (TradeHelper.ApplyForReturn(this.hdorderId.Value, this.txtReturnRemark.Text, int.Parse(this.dropReturnRefundType.SelectedValue), dropLogisticsCompanyVal,txtLogisticsIdVal))
            //{
            //    this.BindOrders();
            //    this.ShowMessage("成功的申请了退货", true);
            //    return;
            //}
            string reason = string.Empty;

            if (this.dropReturnReason.SelectedIndex == this.dropReturnReason.Items.Count - 1)
            {
                reason = this.txtReturnRemark.Text;
            }
            else
            {
                reason = this.dropReturnReason.Text + Environment.NewLine + this.txtReturnRemark.Text;
            }
            if (TradeHelper.CreateReturnsEntityAndAdd(this.hdorderId.Value, reason, int.Parse(this.dropReturnRefundType.SelectedValue), skuids, quantitylist, dropLogisticsCompanyVal, txtLogisticsIdVal))
            {
                this.BindOrders();
                this.ShowMessage("成功的申请了退货", true);
                return;
            }
            this.ShowMessage("申请退货失败", false);
        }