private void BindOrderItems(OrderInfo order)
 {
     if (order.OrderStatus == OrderStatus.Returned && this.handleStatus.Text == "已完成")
     {
         decimal num;
         TradeHelper.GetRefundMoney(order, out num);
         this.litRefundTotal.Money = num;
     }
     this.litTotalPrice.Money      = returnsInfo.GetAmount();
     this.litOrderTotal.Money      = order.GetTotal();
     this.litWeight.Text           = order.Weight.ToString("F2");
     this.txtOrderId.Text          = order.OrderId;
     this.litLogisticsCompany.Text = returnsInfo.LogisticsCompany;
     this.litLogisticsId.Text      = returnsInfo.LogisticsId;
 }
Пример #2
0
        public int AddReturnInfo(ReturnsInfo ReturnsInfo, DbTransaction dbTran)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(" insert into Ecshop_OrderReturns(OrderId,ApplyForTime,Comments,HandleStatus,RefundType,RefundMoney,LogisticsCompany,LogisticsId) values(@OrderId,@ApplyForTime,@Comments,0,@RefundType,0,@LogisticsCompany,@LogisticsId);SELECT @@identity ");
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand(stringBuilder.ToString());

            this.database.AddInParameter(sqlStringCommand, "OrderId", DbType.String, ReturnsInfo.OrderId);
            this.database.AddInParameter(sqlStringCommand, "ApplyForTime", DbType.DateTime, DateTime.Now);
            this.database.AddInParameter(sqlStringCommand, "Comments", DbType.String, ReturnsInfo.Comments);
            this.database.AddInParameter(sqlStringCommand, "RefundType", DbType.Int32, ReturnsInfo.RefundType);
            this.database.AddInParameter(sqlStringCommand, "HandleStatus", DbType.Int32, 0);
            this.database.AddInParameter(sqlStringCommand, "RefundMoney", DbType.Decimal, ReturnsInfo.GetAmount());
            this.database.AddInParameter(sqlStringCommand, "LogisticsCompany", DbType.String, ReturnsInfo.LogisticsCompany);
            this.database.AddInParameter(sqlStringCommand, "LogisticsId", DbType.String, ReturnsInfo.LogisticsId);
            int    returnsId;
            object obj;

            if (dbTran != null)
            {
                obj = this.database.ExecuteScalar(sqlStringCommand, dbTran);
            }
            else
            {
                obj = this.database.ExecuteScalar(sqlStringCommand);
            }
            if (obj != DBNull.Value)
            {
                returnsId = Convert.ToInt32(obj);
            }
            else
            {
                returnsId = 0;
            }
            return(returnsId);
        }