Esempio n. 1
0
 private void BindUserPayData()
 {
     if (base._User != null)
     {
         string    key = "Room_UserPayDetail_" + base._User.ID.ToString();
         DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
         if (cacheAsDataTable == null)
         {
             cacheAsDataTable = new Views.V_UserPayDetails().Open("ID,[DateTime],PayType,[Money],FormalitiesFees", "[UserID] = " + base._User.ID.ToString() + " and Result = 1", "[DateTime] desc, [ID]");
             if (cacheAsDataTable == null)
             {
                 PF.GoError(4, "数据库繁忙,请重试(732)", base.GetType().FullName);
                 return;
             }
             Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60);
         }
         this.gUserPay.DataSource = cacheAsDataTable;
         this.gUserPay.DataBind();
         this.lblUserPayCount.Text = cacheAsDataTable.Rows.Count.ToString();
         this.lblUserPayMoney.Text = PF.GetSumByColumn(cacheAsDataTable, 3, false, this.gUserPay.PageSize, 0).ToString("N");
     }
 }
Esempio n. 2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        this.Label1.Text = "";
        this.Label2.Text = "";
        string    alipayPaymentNumber = "";
        string    returnDescription   = "";
        OnlinePay pay   = new OnlinePay();
        DataTable table = new Views.V_UserPayDetails().Open("ID, Name, DateTime, Money, PayType, FormalitiesFees, UserID", "Result = 1", "");
        double    num2  = 0.0;

        foreach (DataRow row in table.Rows)
        {
            alipayPaymentNumber = "";
            if ((pay.Query(row["PayType"].ToString().Trim(), row["ID"].ToString(), ref alipayPaymentNumber, ref returnDescription) != 0) && (returnDescription == "等待买家付款"))
            {
                num2 += _Convert.StrToDouble(row["Money"].ToString(), 0.0);
                string text = this.Label1.Text;
                this.Label1.Text = text + "用户名:" + row["Name"].ToString() + ", 用户ID:" + row["UserID"].ToString() + ", 系统交易号:" + row["ID"].ToString() + ", 金额:" + row["Money"].ToString() + "<br />";
            }
        }
        this.Label2.Text = "合计总金额:" + num2.ToString();
    }