using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using xabaraCOM;

public partial class WebXabara_money_Default : System.Web.UI.Page
{
    admin a = new admin();
    sqlServer sql = new sqlServer();
    javasrcipt js = new javasrcipt();
    fileDocument f = new fileDocument();

    public long passID = xabara.isNum(HttpContext.Current.Request["pass"]);

    protected void Page_Load(object sender, EventArgs e)
    {
        a.check("|money|");

        if (!IsPostBack)
        {
            string searchWordTemp = Server.UrlDecode(xabara.safeSql(Request["keyWords"]));
            string strSql = string.Empty;
            string ifStr = string.Empty;
            if (passID < 1)
            {
                ifStr = @" adminPass=0";
            }
            else
            {
                ifStr = @" adminPass>0";
            }

            if (!string.IsNullOrEmpty(searchWordTemp as string))
            {
                ifStr += " and (uID='" + searchWordTemp + "' or remitName='" + searchWordTemp + "')";
            }

            strSql += "select * from moneyBankRemit where" + ifStr + " order by rID desc";
            //Response.Write(strSql);
            //Response.End();
            lblCurrentPage.Text = sql.RepeaterDB(RepeaterList, strSql, "&keyWords=" + Server.UrlEncode(searchWordTemp) + "&pass=" + passID.ToString(), 10, "page", "center", true);
        }
    }

    protected void SearchButton_Click(object sender, EventArgs e)
    {
        Response.Redirect("?keyWords=" + Server.UrlEncode(searchWord.Text.Trim()) + "&pass=" + passID.ToString(), true);
    }

    public string getImg(string str)
    {
        string strReturn = f.picDisplay(str);

        return strReturn;
    }

    public string getM(string str)
    {
        return rmb.format(str);
    }

    public string getP(string str)
    {
        string returnStr = string.Empty;
        switch (str)
        {
            case "0":
                returnStr = "正在审核";
                break;
            case "1":
                returnStr = "已处理";
                break;
            case "11":  //在线充值
                returnStr = "<font color=blue>充值失败</font>";
                break;
            case "12":  //在线充值
                returnStr = "充值成功";
                break;
            default:
                returnStr = "<font color=red>无法核实</font>";
                break;
        }
        return returnStr;
    }
}
