protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         PaymentLogInfo paymentLogById = PaymentLog.GetPaymentLogById(BasePage.RequestInt32("PaymentLogID"));
         if (!paymentLogById.IsNull)
         {
             this.LblPaymentNum.Text = paymentLogById.PaymentNum;
             this.LblUserName.Text   = paymentLogById.UserName;
             PayPlatformInfo payPlatformById = PayPlatform.GetPayPlatformById(paymentLogById.PlatformId);
             if (!paymentLogById.IsNull)
             {
                 this.LblPlatform.Text = payPlatformById.PayPlatformName;
             }
             this.LblPayTime.Text      = paymentLogById.PayTime.ToString();
             this.LblMoneyPay.Text     = paymentLogById.MoneyPay.ToString("0.00");
             this.LblMoneyTrue.Text    = paymentLogById.MoneyTrue.ToString("0.00");
             this.LblStatus.Text       = PaymentLog.GetStatusDepict(paymentLogById.PlatformId, paymentLogById.Status);
             this.LblPlatformInfo.Text = paymentLogById.PlatformInfo;
             this.LblRemark.Text       = paymentLogById.Remark;
         }
         else
         {
             AdminPage.WriteErrMsg("<li>找不到对应的支付记录</li>");
         }
     }
 }
 protected void GdvPaymentLogList_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         PaymentLogInfo dataItem = e.Row.DataItem as PaymentLogInfo;
         object         obj1     = e.Row.DataItem;
         if (dataItem != null)
         {
             Label     label  = (Label)e.Row.FindControl("LblStatus");
             Label     label2 = (Label)e.Row.FindControl("LblPlatform");
             HyperLink link   = (HyperLink)e.Row.FindControl("LnkPaymentNum");
             if (this.ShowOptions == 1)
             {
                 link.Text = dataItem.PaymentNum;
             }
             else
             {
                 link.Text        = dataItem.PaymentNum;
                 link.NavigateUrl = string.Concat(new object[] { "../User/PaymentLogDetail.aspx?ReturnUrl=../Shop/OrderManage.aspx?OrderID=", dataItem.OrderId, "&PaymentLogID=", dataItem.PaymentLogId.ToString() });
             }
             label.Text = PaymentLog.GetStatusDepict(dataItem.PlatformId, dataItem.Status);
             if (dataItem.Status != 1)
             {
                 e.Row.Cells[0].Enabled = false;
             }
             label2.Text = PayPlatform.GetPayPlatformById(dataItem.PlatformId).PayPlatformName;
         }
     }
 }
Beispiel #3
0
        private PayOnlineState UpdatePaymentLog(string paymentNum, decimal amount, string eBankInfo, int status, string remark)
        {
            PaymentLogInfo infoByPaymentNum = PaymentLog.GetInfoByPaymentNum(paymentNum);
            PayOnlineState ok = PayOnlineState.Ok;

            if (infoByPaymentNum.IsNull)
            {
                return(PayOnlineState.PaymentLogNotFound);
            }
            if (infoByPaymentNum.MoneyTrue != amount)
            {
                return(PayOnlineState.RemittanceWrong);
            }
            this.m_OrderInfo              = Order.GetOrderById(infoByPaymentNum.OrderId);
            this.m_Point                  = infoByPaymentNum.Point;
            this.m_PlatformId             = infoByPaymentNum.PlatformId;
            this.m_PaymentLogId           = infoByPaymentNum.PaymentLogId;
            this.m_UserName               = infoByPaymentNum.UserName;
            this.m_MoneyReceipt           = infoByPaymentNum.MoneyPay;
            infoByPaymentNum.PlatformInfo = eBankInfo;
            infoByPaymentNum.Remark       = remark;
            infoByPaymentNum.Status       = status;
            PaymentLog.Update(infoByPaymentNum);
            UserInfo usersByUserName = Users.GetUsersByUserName(this.m_UserName);

            if (!usersByUserName.IsNull)
            {
                this.m_UserId   = usersByUserName.UserId;
                this.m_ClientID = usersByUserName.ClientId;
            }
            return(ok);
        }
Beispiel #4
0
        public static PayOnlineState AddPayment(int orderId, int payPlatformId, decimal money, string userName, string paymentNum)
        {
            if (orderId > 0)
            {
                OrderInfo orderById = Order.GetOrderById(orderId);
                if (orderById.IsNull)
                {
                    return(PayOnlineState.OrderNotFound);
                }
                if (orderById.MoneyTotal <= orderById.MoneyReceipt)
                {
                    return(PayOnlineState.AccountPaid);
                }
            }
            PayPlatformInfo payPlatformById = PayPlatform.GetPayPlatformById(payPlatformId);

            if (payPlatformById.IsNull)
            {
                return(PayOnlineState.PayPlatFormNotFound);
            }
            if (payPlatformById.IsDisabled)
            {
                return(PayOnlineState.PayPlatFormDisabled);
            }
            money = Math.Abs(money);
            if (money <= 0.01M)
            {
                return(PayOnlineState.TooLittleMoney);
            }
            if (string.IsNullOrEmpty(paymentNum))
            {
                return(PayOnlineState.NoPaymentNumber);
            }
            decimal        num            = money + ((money * DataConverter.CDecimal(payPlatformById.Rate)) / 100M);
            PaymentLogInfo paymentLogInfo = new PaymentLogInfo();

            paymentLogInfo.UserName     = userName;
            paymentLogInfo.OrderId      = orderId;
            paymentLogInfo.PaymentNum   = paymentNum;
            paymentLogInfo.PlatformId   = payPlatformById.PayPlatformId;
            paymentLogInfo.MoneyPay     = money;
            paymentLogInfo.MoneyTrue    = num;
            paymentLogInfo.PayTime      = new DateTime?(DateTime.Now);
            paymentLogInfo.Status       = 1;
            paymentLogInfo.PlatformInfo = "";
            paymentLogInfo.Remark       = "";
            paymentLogInfo.SuccessTime  = null;
            if (PaymentLog.Add(paymentLogInfo))
            {
                return(PayOnlineState.Ok);
            }
            return(PayOnlineState.Fail);
        }
 protected void GdvPaymentLogList_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         PaymentLogInfo dataItem = e.Row.DataItem as PaymentLogInfo;
         if (dataItem != null)
         {
             Label label  = (Label)e.Row.FindControl("LblStatus");
             Label label2 = (Label)e.Row.FindControl("LblPlatform");
             label.Text = PaymentLog.GetStatusDepict(dataItem.PlatformId, dataItem.Status);
             if (dataItem.Status != 1)
             {
                 e.Row.Cells[0].Enabled = false;
             }
             label2.Text = PayPlatform.GetPayPlatformById(dataItem.PlatformId).PayPlatformName;
         }
     }
 }
Beispiel #6
0
        private static PaymentLogInfo PaymentLogFromrdr(NullableDataReader rdr)
        {
            PaymentLogInfo info = new PaymentLogInfo();

            info.PaymentLogId = rdr.GetInt32("PaymentLogId");
            info.UserName     = rdr.GetString("UserName");
            info.OrderId      = rdr.GetInt32("OrderId");
            info.PaymentNum   = rdr.GetString("PaymentNum");
            info.PlatformId   = rdr.GetInt32("PlatformId");
            info.MoneyPay     = rdr.GetDecimal("MoneyPay");
            info.MoneyTrue    = rdr.GetDecimal("MoneyTrue");
            info.PayTime      = rdr.GetNullableDateTime("PayTime");
            info.SuccessTime  = rdr.GetNullableDateTime("SuccessTime");
            info.Status       = rdr.GetInt32("Status");
            info.PlatformInfo = rdr.GetString("PlatformInfo");
            info.Remark       = rdr.GetString("Remark");
            info.Point        = rdr.GetInt32("Point");
            return(info);
        }
Beispiel #7
0
        private static Parameters GetParameters(PaymentLogInfo paymentLogInfo)
        {
            Parameters parameters = new Parameters();

            parameters.AddInParameter("@PaymentLogID", DbType.Int32, paymentLogInfo.PaymentLogId);
            parameters.AddInParameter("@UserName", DbType.String, paymentLogInfo.UserName);
            parameters.AddInParameter("@OrderID", DbType.Int32, paymentLogInfo.OrderId);
            parameters.AddInParameter("@PaymentNum", DbType.String, paymentLogInfo.PaymentNum);
            parameters.AddInParameter("@PlatformID", DbType.Int32, paymentLogInfo.PlatformId);
            parameters.AddInParameter("@MoneyPay", DbType.Currency, paymentLogInfo.MoneyPay);
            parameters.AddInParameter("@MoneyTrue", DbType.Currency, paymentLogInfo.MoneyTrue);
            parameters.AddInParameter("@PayTime", DbType.DateTime, paymentLogInfo.PayTime);
            parameters.AddInParameter("@SuccessTime", DbType.DateTime, paymentLogInfo.SuccessTime);
            parameters.AddInParameter("@Status", DbType.Int32, paymentLogInfo.Status);
            parameters.AddInParameter("@PlatformInfo", DbType.String, paymentLogInfo.PlatformInfo);
            parameters.AddInParameter("@Remark", DbType.String, paymentLogInfo.Remark);
            parameters.AddInParameter("@Point", DbType.Int32, paymentLogInfo.Point);
            return(parameters);
        }
Beispiel #8
0
 protected void EgvPayment_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         Label          label    = e.Row.FindControl("LblPlatform") as Label;
         Label          label2   = e.Row.FindControl("LblStatus") as Label;
         PaymentLogInfo dataItem = e.Row.DataItem as PaymentLogInfo;
         if (dataItem != null)
         {
             if (label != null)
             {
                 label.Text = PayPlatform.GetPayPlatformById(dataItem.PlatformId).PayPlatformName;
             }
             if (label2 != null)
             {
                 label2.Text = EasyOne.Accessories.PaymentLog.GetStatusDepict(dataItem.PlatformId, dataItem.Status);
             }
         }
     }
 }
Beispiel #9
0
 public static bool Add(PaymentLogInfo paymentLogInfo)
 {
     return(dal.Add(paymentLogInfo));
 }
Beispiel #10
0
 public static bool Update(PaymentLogInfo info)
 {
     return(dal.Update(info));
 }
Beispiel #11
0
        public bool Update(PaymentLogInfo info)
        {
            Parameters cmdParams = GetParameters(info);

            return(DBHelper.ExecuteProc("PR_Accessories_PaymentLog_Update2", cmdParams));
        }
Beispiel #12
0
 public bool Add(PaymentLogInfo paymentLogInfo)
 {
     paymentLogInfo.PaymentLogId = GetMaxId() + 1;
     return(DBHelper.ExecuteProc("PR_Shop_PaymentLog_Add", GetParameters(paymentLogInfo)));
 }
 private void AddBankroll(int paymentLogId)
 {
     if (!BankrollItem.ExistsPaymentLog(paymentLogId))
     {
         PaymentLogInfo paymentLogById = PaymentLog.GetPaymentLogById(paymentLogId);
         if (!paymentLogById.IsNull)
         {
             IEncourageStrategy <decimal> strategy = new UserMoney();
             int      userId          = 0;
             UserInfo usersByUserName = new UserInfo(true);
             if (!string.IsNullOrEmpty(paymentLogById.UserName))
             {
                 usersByUserName = Users.GetUsersByUserName(paymentLogById.UserName);
                 userId          = usersByUserName.UserId;
                 if (userId > 0)
                 {
                     strategy.IncreaseForUsers(userId.ToString(), paymentLogById.MoneyPay, "", false, "");
                     BankrollItemInfo bankrollItemInfo = new BankrollItemInfo();
                     bankrollItemInfo.UserName     = paymentLogById.UserName;
                     bankrollItemInfo.Money        = paymentLogById.MoneyPay;
                     bankrollItemInfo.MoneyType    = 3;
                     bankrollItemInfo.EBankId      = paymentLogById.PlatformId;
                     bankrollItemInfo.OrderId      = paymentLogById.OrderId;
                     bankrollItemInfo.PaymentId    = paymentLogId;
                     bankrollItemInfo.Remark       = "在线支付单号:" + paymentLogById.PaymentNum;
                     bankrollItemInfo.DateAndTime  = DateTime.Now;
                     bankrollItemInfo.CurrencyType = 1;
                     bankrollItemInfo.ClientId     = usersByUserName.ClientId;
                     BankrollItem.Add(bankrollItemInfo);
                 }
             }
             if (paymentLogById.OrderId > 0)
             {
                 OrderInfo orderById = Order.GetOrderById(paymentLogById.OrderId);
                 if (!orderById.IsNull)
                 {
                     decimal d = 0M;
                     if (orderById.MoneyTotal > orderById.MoneyReceipt)
                     {
                         if ((orderById.MoneyTotal - orderById.MoneyReceipt) > paymentLogById.MoneyPay)
                         {
                             if (SiteConfig.ShopConfig.EnablePartPay)
                             {
                                 d = paymentLogById.MoneyPay;
                                 orderById.MoneyReceipt += paymentLogById.MoneyPay;
                             }
                         }
                         else
                         {
                             d = orderById.MoneyTotal - orderById.MoneyReceipt;
                             orderById.MoneyReceipt = orderById.MoneyTotal;
                         }
                         orderById.Status = OrderStatus.Confirmed;
                         Order.Update(orderById);
                     }
                     if (d > 0M)
                     {
                         strategy.IncreaseForUsers(userId.ToString(), -d, "", false, "");
                         BankrollItemInfo info5 = new BankrollItemInfo();
                         info5.UserName     = usersByUserName.UserName;
                         info5.ClientId     = usersByUserName.ClientId;
                         info5.Money        = -d;
                         info5.MoneyType    = 4;
                         info5.EBankId      = 0;
                         info5.OrderId      = orderById.OrderId;
                         info5.PaymentId    = 0;
                         info5.Remark       = "支付订单费用,订单号:" + orderById.OrderNum;
                         info5.DateAndTime  = DateTime.Now;
                         info5.CurrencyType = 1;
                         BankrollItem.Add(info5);
                     }
                 }
             }
             else if (paymentLogById.Point > 0)
             {
                 IEncourageStrategy <int> strategy2 = new UserPoint();
                 strategy2.IncreaseForUsers(userId.ToString(), paymentLogById.Point, "购买" + SiteConfig.UserConfig.PointName, true, "");
                 BankrollItemInfo info6 = new BankrollItemInfo();
                 info6.UserName     = usersByUserName.UserName;
                 info6.ClientId     = usersByUserName.ClientId;
                 info6.Money        = (paymentLogById.MoneyPay > 0M) ? (-1M * paymentLogById.MoneyPay) : paymentLogById.MoneyPay;
                 info6.MoneyType    = 4;
                 info6.EBankId      = 0;
                 info6.OrderId      = 0;
                 info6.PaymentId    = 0;
                 info6.Remark       = "购买" + SiteConfig.UserConfig.PointName + ",购买数:" + paymentLogById.Point.ToString() + SiteConfig.UserConfig.PointUnit;
                 info6.DateAndTime  = new DateTime?(DateTime.Now);
                 info6.CurrencyType = 1;
                 BankrollItem.Add(info6);
                 if (usersByUserName.UserId > 0)
                 {
                     strategy.IncreaseForUsers(usersByUserName.UserId.ToString(), -(paymentLogById.MoneyPay), "", false, "");
                 }
             }
         }
     }
 }