示例#1
0
        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            DB     = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);
            DB_Ali = new DataBase(ScTool.DBName(ScTool.PayTypeAli), ScTool.UserName, ScTool.Password);
            confirmTabExist();

            TYPE = Request["TYPE"];

            if (TYPE != null)
            {
                if (TYPE.Equals("Add"))
                {
                    string result = Add(Request["author"], Request["reward"], Request["sum"]);
                    Response.Write(result);
                    return;
                }
                else if (TYPE.Equals("Update"))
                {
                    Update(Request["ID"], Request["author"], Request["reward"], Request["sum"]);
                }
                else if (TYPE.Equals("Delet"))
                {
                    Delet(Request["ID"]);
                }
                else if (TYPE.Equals("Select"))
                {
                    string result = Select(Request["ID"], Request["key"]);      // 查询ID数据项对应的key值
                    Response.Write(result);
                    return;
                }
                else if (TYPE.Equals("DeletThisTab"))
                {
                    DB.DeletTable(TAB);
                }
                else if (TYPE.Equals("Reward"))
                {
                    string result = CountReward(Request["author"]);
                    Response.Write(result);
                    return;
                }
                else if (TYPE.Equals("RewardClear"))
                {
                    RewardClear(Request["author"]);
                }
            }

            //--------------------------------------------------------

            // 显示接口使用说明
            NoteInfo();

            // 显示指定类型的订单信息
            ScTool.showTable(this.Controls, DB, TAB);
        }
示例#2
0
        string TYPE = "";                        // 自定义操作类型

        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            TYPE = Request["TYPE"];

            // 连接指定的数据库,若不存在则创建
            DB = new DataBase(ScTool.DBName(PayType), ScTool.UserName, ScTool.Password);

            //DB.DeletTable(ScTool.ORDER);
            confirmOrderTab();

            if (TYPE != null)
            {
                string result = "";
                if (TYPE.Equals("Add"))
                {
                    result = AddIteam(Request["QrUrl"], Request["HbUrl"], Request["Tittle"], Request["ext"]);
                }
                else if (TYPE.Equals("_Delet"))
                {
                    result = DeletIteam(Request["ID"]).ToString();
                }
                else if (TYPE.Equals("_Update"))
                {
                    long count = -1;
                    try
                    {
                        count = long.Parse(Request["count"]);
                    }
                    catch (Exception) { }

                    result = UpdateIteam(Request["ID"], Request["QrUrl"], Request["HbUrl"], Request["Tittle"], Request["ext"], count);
                }
                else if (TYPE.Equals("Get"))
                {
                    result = GetIteam(Request["ID"], Request["KeyName"]);
                }
                else if (TYPE.Equals("CountAdd"))
                {
                    result = CountAdd(Request["ID"]);
                }

                Response.Write(result);
            }
            else
            {
                NoteInfo();
                ScTool.showTable(this.Controls, DB, TAB);
            }
        }
示例#3
0
        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            DB = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);
            confirmOrderTab(DB);

            TYPE = Request["TYPE"];

            if (TYPE != null)
            {
                string result = "";

                if (TYPE.Equals("Add"))
                {
                    result = Add(DB, Request["softName"], Request["price"], Request["linkUrl"], Request["recomondUrl"], Request["ext"]);
                }
                else if (TYPE.Equals("Update"))
                {
                    result = Update(DB, Request["ID"], Request["softName"], Request["price"], Request["linkUrl"], Request["recomondUrl"], Request["ext"]);
                }
                else if (TYPE.Equals("Delet"))
                {
                    result = Delet(DB, Request["ID"]).ToString();
                }
                else if (TYPE.Equals("Select"))
                {
                    result = Select(DB, Request["softName"], Request["key"]);
                    if (Request["key"].Equals("price") || Request["key"].Equals("ext")) // 若查询金额信息,则进行加密
                    {
                        result = Request["key"] + "(" + result + ")" + Request["key"];
                        result = Locker.Encrypt(result, Request["softName"]);
                    }
                }
                else if (TYPE.Equals("DeletThisTab"))
                {
                    result = DB.DeletTable(TAB).ToString();
                }

                Response.Write(result);
                return;
            }
            else
            {
                // 显示接口使用说明
                NoteInfo();

                // 显示指定类型的订单信息
                ScTool.showTable(this.Controls, DB, TAB);
            }
        }
        string TYPE = "";   // 自定义操作类型

        protected void Page_Load(object sender, EventArgs e)
        {
            TYPE = Request["TYPE"];

            // 连接指定的数据库,若不存在则创建
            Init();

            //UserAgent.AddIteam(Request.Params.Get("avatar"), "");    // 记录UserAgent信息

            if (TYPE == null)
            {
                TYPE = "";
            }

            if (TYPE.Equals("S"))
            {
                NoteInfo();
                ScTool.showTable(this.Controls, DB, TAB);
            }
            else
            {
                string result = "";
                if (TYPE.Equals("Add"))
                {
                    result = AddIteam(Request["showRectangle"], Request["showIconUrl"], Request["showNoteInfo"], Request["showButtonInfo"], Request["showPicUrl"], Request["ext"]);
                }
                else if (TYPE.Equals("Delet"))
                {
                    result = DeletIteam(Request["ID"]).ToString();
                }
                else if (TYPE.Equals("Update"))
                {
                    long count = -1;
                    try
                    {
                        count = long.Parse(Request["count"]);
                    }
                    catch (Exception) { }
                    result = UpdateIteam(Request["ID"], Request["showRectangle"], Request["showIconUrl"], Request["showNoteInfo"], Request["showButtonInfo"], Request["showPicUrl"], Request["ext"]);
                }
                else
                {
                    result = getRandomResult();
                }

                Response.Write(result);
            }
        }
示例#5
0
        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            if (UserType != 2)
            {
                Response.Redirect("../PayFor/SDK.aspx");
            }

            if (Request["DB"] != null && Request["TAB"] != null)
            {
                string DBName = Request["DB"];
                string TAB    = Request["TAB"];

                this.Controls.Clear();
                DataBase DB = new DataBase(DBName, ScTool.UserName, ScTool.Password);
                ScTool.showTable(this.Controls, DB, TAB);

                return;
            }

            if (param.Equals(""))             // 查询提示信息
            {
                //String Url = Request.Url.ToString();
                string sql = "SELECT * FROM 数据表1";

                Response.Write(P("数据库信息查询示例"));
                Response.Write(P("查询Json数据:" + url + "?" + sql));
                Response.Write(P("查询Tab数据:" + url + "?" + "TAB:" + sql));
            }
            else
            {
                if (param.StartsWith("TAB:")) // 查询数据信息,返回Tab表
                {
                    param = param.Substring(4);
                    Table table = ExecuteTable(param);
                    this.Controls.Add(table);
                }
                else
                {                                   // 查询数据信息,返回Json数据
                    String data = Execute(param);
                    Response.Write(data);
                }
            }
        }
示例#6
0
        string TYPE = "";   // 自定义操作类型

        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            TYPE = Request["TYPE"];

            // 连接指定的数据库,若不存在则创建
            Init();

            //UserAgent.AddIteam(Request.Params.Get("HTTP_USER_AGENT"), "");    // 记录UserAgent信息

            if (TYPE == null)
            {
                NoteInfo();
                ScTool.showTable(this.Controls, DB, TAB);
            }
            else
            {
                string result = "";
                if (TYPE.Equals("Add"))
                {
                    result = AddIteam(Request["UserAgent"], Request["ext"]);
                }
                else if (TYPE.Equals("Delet"))
                {
                    result = DeletIteam(Request["ID"]).ToString();
                }
                else if (TYPE.Equals("Update"))
                {
                    long count = -1;
                    try
                    {
                        count = long.Parse(Request["count"]);
                    }
                    catch (Exception) { }
                    result = UpdateIteam(Request["ID"], Request["UserAgent"], Request["ext"], count);
                }
                else if (TYPE.Equals("CountAdd"))
                {
                    result = CountAdd(Request["ID"]);
                }

                Response.Write(result);
            }
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ScTool.RecordUserAgent(Request); // 记录客户端信息
            }
            getParam();                          //获取参数记录log信息

            DB = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);
            //DB.DeletTable(TAB);
            CreatTable(DB, TAB);

            if (TYPE != null)
            {
                string reslut = "";
                if (TYPE.Equals("Check"))
                {
                    reslut = Check(DB, TAB, Request["machinCode"], Request["soft"]);
                    Response.Write(reslut);
                    return;
                }
                if (TYPE.Equals("Add"))
                {
                    int UserType = UserTool.UserType(Session);      // 获取当前登录的用户类型信息

                    reslut = "false no allowed! " + "../PayFor/UserLogin.aspx";
                    if (UserType == 2)
                    {
                        reslut = Add(DB, TAB, Request["machinCode"], Request["soft"], Request["ext"], Request["msg"]);
                    }

                    Response.Write(reslut);
                    return;
                }
                Response.Write("TYPE -> " + TYPE);
            }

            NoteInfo();
            ScTool.showTable(this.Controls, DB, TAB);
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ScTool.RecordUserAgent(Request); // 记录客户端信息
            }
            getParam();                          //获取参数记录log信息

            DB = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);
            //DB.DeletTable(TAB);
            CreatTable(DB, TAB);

            if (TYPE != null)
            {
                string reslut = "";
                if (TYPE.Equals("GetRegSerial"))
                {
                    reslut = GetRegSerial(Request["machinCode"], Request["soft"], Request["computerName"], Request["userName"], Request["ext"], Request["counter"]);
                    Response.Write(reslut);
                    return;
                }
                if (TYPE.Equals("GetValue"))
                {
                    reslut = GetValue(Request["KEY"], Request["machinCode"], Request["soft"]);
                    Response.Write(reslut);
                    return;
                }
                else if (TYPE.Equals("UpdateSerial"))
                {
                    reslut = Update(DB, Request["ID"], Request["machinCode"], Request["soft"], Request["computerName"], Request["userName"], Request["ext"], Request["startTimes"], Request["onlineSerial"], Request["msg"]);
                }

                Response.Write("UpdateSerial -> " + reslut);
            }

            NoteInfo();
            ScTool.showTable(this.Controls, DB, TAB);
        }
示例#9
0
        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            DB = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);
            confirmOrderTab();

            TYPE = Request["TYPE"];

            if (TYPE != null)
            {
                if (TYPE.Equals("Add"))
                {
                    string result = Add(Request["name"], Request["price"], Request["author"], Request["data"], Request["ext"]);
                    Response.Write(result);
                    return;
                }
                else if (TYPE.Equals("Update"))
                {
                    Update(Request["ID"], Request["name"], Request["price"], Request["author"], Request["data"], Request["ext"]);
                }
                else if (TYPE.Equals("Delet"))
                {
                    Delet(Request["ID"]);
                }
                else if (TYPE.Equals("Select"))
                {
                    string result = Select(Request["ID"], Request["key"]);      // 查询ID数据项对应的key值
                    //if (Request["key"].Equals("price") || Request["key"].Equals("ext")) // 若查询金额信息,则进行加密
                    //{
                    //    result = Request["key"] + "(" + result + ")" + Request["key"];
                    //    result = Locker.Encrypt(result, Request["name"]);
                    //}
                    Response.Write(result);
                    return;
                }
                else if (TYPE.Equals("DeletThisTab"))
                {
                    DB.DeletTable(TAB);
                }
                else if (TYPE.Equals("StaticIp"))
                {
                    Product.UseStaticIpMode = !Product.UseStaticIpMode;
                    Response.Write("设置付费资源,网址模式 StaticIp=" + Product.UseStaticIpMode);
                }
            }

            //--------------------------------------------------------

            string resId = Request["ID"];   // 数据项对应的资源ID

            // 1、查询当前用户对应的对于该资源是否已创建订单号,若未创建则创建
            // 2、查询该订单是否已支付,未支付则跳转支付,已支付则显示资源对应密码
            if (TYPE == null && resId != null)
            {
                if (Session.Timeout != 60 * 24)
                {
                    Session.Timeout = 60 * 24;                              // 设置Session有效时间为24小时
                }
                string key = "ProductInfo" + resId + "_payId";              // 按资源ID记录,对应的支付预下单号
                // string date = DateTime.Now.ToString("yyyyMMdd");        // 每天可领取一次,首次跳转
                // (Session[key] as string).Equals("");                     // 获取之前的session值

                // 1、
                string value = "";
                if (Session[key] == null)                                                                   // 若key对应的订单号不存在
                {
                    Dictionary <String, String> iteam = DB.SelectValue(TAB, resId, "ID").RowDic();          // 查询资源ID对应的数据
                    string preOrderId = CreateOrder(resId, iteam["name"], iteam["price"], iteam["author"]); // 生成预下单号
                    Session[key] = preOrderId;                                                              // 记录至session中
                }
                value = Session[key] as string;

                // 2、
                bool OrderIsPayed = OrderSuccess(value);
                //OrderIsPayed = true;
                if (!OrderIsPayed)
                {   // 跳转支付
                    //GotoPay(value);

                    // 展示资源支付页
                    TipPay(resId, value);
                }
                else
                {                                                                                  // 显示资源信息
                    Dictionary <String, String> iteam = DB.SelectValue(TAB, resId, "ID").RowDic(); // 查询资源ID对应的数据
                    ShowInfo(iteam["data"]);
                }
            }

            //--------------------------------------------------------

            // 显示接口使用说明
            NoteInfo();

            // 显示指定类型的订单信息
            ScTool.showTable(this.Controls, DB, TAB);
        }
示例#10
0
        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            if (UserType == 0 && param.Equals(""))
            {
                Response.Redirect("../PayFor/UserLogin.aspx");
            }

            DB = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);

            if (Page.IsPostBack)
            {
                //Timer1.Enabled = true;
                return;
            }

            body1.Visible = false;

            TYPE = Request["TYPE"];
            if (TYPE == null)
            {
                TYPE = "";
            }

            if (param.Contains("TYPE"))
            {
                int index = param.IndexOf("TYPE");
                int start = param.IndexOf("&", index + 4);
                param = param.Substring(start + 1);
            }

            //DB.DeletTable(ScTool.ORDER);
            confirmOrderTab();

            //DB = new DataBase("master", ScTool.UserName, ScTool.Password);
            //DB.DeletDataBase(ScTool.DBName("pre"));
            //DB.DeletDataBase(ScTool.DBName(ScTool.PayTypeAli));
            //DB.DeletDataBase(ScTool.DBName(ScTool.PayTypeWechat));

            if (TYPE.Equals("PreOrder"))            // 生成新的pre订单
            {
                //if (!ContainsAuthorInfo()) return;
                this.Controls.Clear();

                string id = createOrder(param);
                Response.Write(ScTool.Reslut(id));
                return;
            }
            else if (TYPE.Equals("ShowPreOrder"))   // 显示预备下单订单号,对应的二维码待支付页面
            {
                string preOrderId = Request["preOrderId"];

                LabelPreOrderId.Text    = "当前订单号:" + preOrderId;
                LabelPreOrderPrice.Text = getNeedPayMoney(preOrderId);

                if (preOrderId != null && !preOrderId.Equals(""))
                {
                    string data = url + "?" + "TYPE=" + "CreateOrder" + "&" + "preOrderId=" + preOrderId;
                    showQR(data);
                }
                else
                {
                    Response.Write("支付失败!Pay.aspx创建订单失败");
                }
            }
            else if (TYPE.Equals("OrderResult"))    // 查询指定订单支付结果http://60.205.185.168:8002/pages/pay.aspx?TYPE=OrderResult&machinCode=J78Z-A906-E9ST-RING
            {
                this.Controls.Clear();

                string order_param = Request["P"];
                if (order_param == null || order_param.Equals(""))
                {
                    string result = OrderResult(Request["preOrderId"]); // 通过订单号查询支付结果
                    Response.Write(ScTool.Reslut(result));
                }
                else
                {
                    string result = OrderResult_param(order_param);     // 通过订单参数查询支付结果
                    Response.Write(ScTool.Reslut(result));
                }
                return;
            }
            else if (TYPE.Equals("OrderResultX"))
            {
                this.Controls.Clear();

                if (Request["preOrderId"] != null)
                {
                    string result = OrderResult(Request["preOrderId"], false); // 通过订单号查询支付结果
                    Response.Write(ScTool.Reslut(result));
                }
                else
                {
                    string machinCode = Request["machinCode"];
                    string soft       = Request["soft"];

                    string result = OnlineCode.Check(DB, OnlineCode.TAB, machinCode, soft);     // 查询指定的机器码对应订单是否已支付
                    Response.Write(ScTool.Reslut(result));
                }
                return;
            }
            else if (TYPE.Equals("CreateOrder"))    // 使用预下单信息,创建正式订单
            {
                string preOrderId = Request["preOrderId"];
                if (preOrderId != null && !preOrderId.Equals(""))
                {
                    Dictionary <string, string> row = DB.SelectValue(ScTool.ORDER, preOrderId, "ID").RowDic();
                    if (row.Count > 0 && row.ContainsKey("param"))
                    {
                        string oparam    = row["param"];
                        string isSuccess = row["isSuccess"].ToLower();

                        if (isSuccess.Equals("true"))
                        {
                            Response.Write(ScTool.Alert("订单" + preOrderId + "已支付成功!"));
                        }
                        else
                        {
                            // 获取客户端类型
                            string agent   = Request.Params.Get("HTTP_USER_AGENT");
                            string payType = ScTool.payType(agent);

                            // 创建订单时,指定类型
                            if (payType.Equals(""))
                            {
                                string payTypeParam = Request["PayType"];
                                if (payTypeParam != null && (payTypeParam.Equals("Ali") || payTypeParam.Equals("Wechat")))
                                {
                                    payType = payTypeParam;
                                }
                            }

                            //param = HttpUtility.UrlDecode(param);
                            //Response.Redirect("Order.aspx?" + "PayType=" + payType + "&" + param);

                            Order.StaticParam = "PayType=" + payType + "&" + oparam + "&preOrderId=" + preOrderId;
                            Server.Transfer("Order.aspx");
                        }
                    }
                    else
                    {
                        Response.Write(ScTool.Alert("订单" + preOrderId + "不存在!请重新下单"));
                    }
                }
            }
            else
            {
                if (!param.Equals(""))
                {
                    //if (!ContainsAuthorInfo()) return;

                    //param = HttpUtility.UrlEncode(param);
                    string preOrderId = createOrder(param);
                    LabelPreOrderId.Text = "当前订单号:" + preOrderId;

                    string needMoney = Request["money"];
                    if (needMoney != null)
                    {
                        LabelPreOrderPrice.Text = "待支付金额:" + needMoney + " 元";
                    }

                    if (!preOrderId.Equals(""))
                    {
                        string data = url + "?" + "TYPE=" + "CreateOrder" + "&" + "preOrderId=" + preOrderId;
                        //Response.Redirect("QRTool.aspx?" + data);

                        //QRTool.StaticParam = data;
                        //Server.Transfer("QRTool.aspx");

                        showQR(data);
                    }
                    else
                    {
                        Response.Write("支付失败!Pay.aspx创建订单失败");
                    }
                }
                else
                {
                    if (UserType == 2)
                    {
                        ScTool.showTable(this.Controls, DB, ScTool.ORDER);
                    }
                    else if (UserType == 1)
                    {
                        ScTool.showTable(this.Controls, DB, ScTool.ORDER, "where param like '%" + "author(" + UserAccount + ")" + "%' ");
                    }
                    NoteInfo();
                }
            }
        }
示例#11
0
        public override void Load(object sender, EventArgs e)
        {
            if (UserType == 0)
            {
                Response.Redirect("../PayFor/UserLogin.aspx");
            }
            else if (UserType == 1)
            {
                Response.Redirect("../PayFor/SDK.aspx");
            }

            if (!Page.IsPostBack)
            {
                ScTool.RecordUserAgent(Request);                      // 记录客户端信息
            }
            string type = Request["PayType"];

            if (type != null && !type.Equals(""))
            {
                PayType = type;
            }

            DB = new DataBase(ScTool.DBName(PayType), ScTool.UserName, ScTool.Password);

            //getParam();     //获取参数记录log信息
            TYPE = Request["TYPE"];
            if (TYPE != null)
            {
                if (TYPE.Equals("SetQrTable"))
                {
                    SetQrTable(Request["ID"], Request["TabName"]);
                }
                else if (TYPE.Equals("AddToQrTable"))
                {
                    AddToQrTable(DB, Request["TabName"], Request["price"], Request["qrLink"]);
                }
                else if (TYPE.Equals("UpdateQrTable"))
                {
                    UpdateQrTable(Request["TabName"], Request["ID"], Request["price"], Request["qrLink"], Request["orderId"], Request["isUsing"]);
                }
                else if (TYPE.Equals("DeletInTable"))
                {
                    DeletInTable(Request["TabName"], Request["KeyValue"], Request["KeyName"]);
                }
                else if (TYPE.Equals("DeletTable"))
                {
                    DeletTable(Request["TabName"]);
                }

                else if (TYPE.Equals("GetQrLink"))
                {
                    string link = GetQrLink(DB, Request["price"], Request["orderId"]);
                    Response.Write(link);
                    return;
                }
                else if (TYPE.Equals("PriceFinish"))
                {
                    string orderId = PriceFinish(DB, Request["phoneId"], Request["price"]);
                    Response.Write(orderId);
                    return;
                }
            }

            NoteInfo();


            if (!DB.ExistTab(CASHER))
            {
                Response.Write(ScTool.Pre("数据表" + CASHER + "不存在!请使用NotificationSender创建"));
            }
            else
            {
                ScTool.showTable(this.Controls, DB, CASHER);

                List <string> qrTableList = DB.ColumnList(CASHER, "qrTabName");
                foreach (string table in qrTableList)
                {
                    if (!table.Equals(""))
                    {
                        ScTool.showTable(this.Controls, DB, table, "", false);
                    }
                }

                //Table table = DB.ExecuteTable("select * from Cahsier");
                //this.Controls.Add(table);
                //PlaceHolder_Tab.Controls.Add(table);
            }
        }
示例#12
0
        string TAB  = ScTool.ORDER;            // 订单表名称

        ///// <summary>
        ///// 判断ext中是否含有开发者帐号信息
        ///// </summary>
        ///// <returns></returns>
        //private bool ContainsAuthorInfo()
        //{
        //    String orderExt = Request["ext"];
        //    bool ContainsAuthor = (orderExt != null && orderExt.Contains("author(" + UserAccount + ")"));

        //    if (!ContainsAuthor) Response.Write("创建订单时需包含开发者信息" + "ext=author(" + UserAccount + ")author");
        //    return ContainsAuthor;
        //}

        /// <summary>
        /// 载入后执行参数对应的sql请求
        /// </summary>
        public override void Load(object sender, EventArgs e)
        {
            if (UserType == 0 && (param.Equals("") || (param.Contains("ShowOrder") && !param.Contains("OrderSuccess"))))
            {
                Response.Redirect("../PayFor/UserLogin.aspx");
            }

            Dictionary <string, string> staticPramsDic = null;   // 静态参数字典

            // 若存在静态参数,则使用静态参数
            if (!StaticParam.Equals(""))
            {
                staticPramsDic = ScTool.ToParamsDic(StaticParam);
                StaticParam    = "";
            }

            //PayType = ScTool.PayTypeAli;

            string type = Request["PayType"];

            if (staticPramsDic != null && staticPramsDic.ContainsKey("PayType"))
            {
                type = staticPramsDic["PayType"];
            }
            if (type != null && !type.Equals(""))
            {
                PayType = type;
            }


            if (PayType.Equals(""))
            {
                if (staticPramsDic == null)
                {
                    NoteInfo();                         // 从Pay.aspx Transfer过来,不显示接口说明信息
                }
                else
                {
                    Response.Write("扫码客户端类型未知,创建订单失败!<br/>请使用支付宝或微信扫码支付");
                }

                // 显示订单信息
                string showOrder = Request["ShowOrder"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("ShowOrder"))
                {
                    showOrder = staticPramsDic["ShowOrder"];
                }
                if (showOrder != null && !showOrder.Equals(""))
                {
                    if (showOrder.Equals(ScTool.PayTypeAli) || showOrder.Equals(ScTool.PayTypeWechat))
                    {
                        DB = new DataBase(ScTool.DBName(showOrder), ScTool.UserName, ScTool.Password);

                        // 修改指定的订单为支付成功
                        string orderId = Request["OrderSuccess"];
                        if (staticPramsDic != null && staticPramsDic.ContainsKey("OrderSuccess"))
                        {
                            orderId = staticPramsDic["OrderSuccess"];
                        }
                        if (orderId != null && !orderId.Equals(""))
                        {
                            string result = "fail";
                            if (UserType == 2)
                            {
                                result = OrderSuccess(DB, orderId);
                            }
                            //else if (UserType == 1) result = OrderSuccess(DB, orderId, UserAccount);
                            else if (UserType == 1)
                            {
                                result = "false no allowed!";
                            }

                            Response.Write(ScTool.Pre("OrderSuccess->" + orderId + ": " + result));
                        }

                        // 显示指定类型的订单信息
                        if (UserType == 2)
                        {
                            ScTool.showTable(this.Controls, DB, ScTool.ORDER);
                        }
                        else if (UserType == 1)
                        {
                            ScTool.showTable(this.Controls, DB, ScTool.ORDER, "where ext like '%" + "author(" + UserAccount + ")" + "%' ");
                        }
                    }
                }
            }
            else
            {
                //if (!ContainsAuthorInfo()) return;

                // 连接指定的数据库,若不存在则创建
                DB = new DataBase(ScTool.DBName(PayType), ScTool.UserName, ScTool.Password);
                //DB.DeletTable(ScTool.ORDER);
                confirmOrderTab();

                //统计金额总数,指定是否清空
                string ParamClear = Request["MoneyAllClear"];
                if (ParamClear != null)
                {
                    bool clear = ParamClear.Trim().ToLower().Equals("true");
                    if (clear)
                    {
                        string result = MoneyAllClear(DB, UserAccount);
                        Response.Write(result);
                    }
                    else
                    {
                        String SuccessValue = ParamClear.Equals("TrueFinish") ? ParamClear : "";
                        string MoneyCount   = MoneyAll(DB, UserAccount, SuccessValue);
                        Response.Write(MoneyCount);
                    }

                    return;
                }


                // 解析创建订单参数信息
                string machinCode = Request["machinCode"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("machinCode"))
                {
                    machinCode = staticPramsDic["machinCode"];
                }
                if (machinCode == null)
                {
                    machinCode = "";
                }

                string soft = Request["soft"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("soft"))
                {
                    soft = staticPramsDic["soft"];
                }
                if (soft == null)
                {
                    soft = "";
                }

                string product = Request["product"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("product"))
                {
                    product = staticPramsDic["product"];
                }
                if (product == null)
                {
                    product = "";
                }

                string money = Request["money"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("money"))
                {
                    money = staticPramsDic["money"];
                }

                string ext = Request["ext"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("ext"))
                {
                    ext = staticPramsDic["ext"];
                }
                if (ext == null)
                {
                    ext = "";
                }

                string preOrderId = Request["preOrderId"];
                if (staticPramsDic != null && staticPramsDic.ContainsKey("preOrderId"))
                {
                    preOrderId = staticPramsDic["preOrderId"];
                }
                if (preOrderId == null)
                {
                    preOrderId = "";
                }


                #region  一预下单号不再多次创建订单

                String keyOrderId = "O_Id";
                String keyLink    = "O_Link";

                // 若订单号不存在,或不相同则重新记录; 并清空链接地址信息
                if (Session[keyOrderId] == null || !(Session[keyOrderId] as string).Equals(preOrderId))
                {
                    Session[keyOrderId] = preOrderId;
                    Session[keyLink]    = null;
                }

                if (Session[keyLink] != null && !(Session[keyLink] as string).Equals(""))
                {
                    string link = (Session[keyLink] as string);
                    Response.Redirect(link);       // 直接重定向到二维码对应链接
                    return;
                }
                #endregion


                // 支付金额不可为空,根据给定的参数创建订单
                if (money != null && !money.Equals(""))
                {
                    string id = createOrder(machinCode, soft, product, money, ext, preOrderId);
                    if (!id.Equals(""))
                    {
                        string link = Cashier.GetQrLink(DB, money, id);
                        if (!link.Equals(""))
                        {
                            if (!preOrderId.Equals("")) // 设置预下单为扫码成功
                            {
                                DataBase preDB = new DataBase(ScTool.DBName("pre"), ScTool.UserName, ScTool.Password);
                                Pay.SetScanSuccess(preDB, preOrderId, PayType);
                            }

                            // 若若链接信息不存在,或不相同则重新记录
                            if (Session[keyLink] == null || !(Session[keyLink] as string).Equals(link))
                            {
                                Session[keyLink] = link;
                            }

                            Response.Redirect(link);   // 重定向到二维码对应链接
                        }
                        else
                        {
                            deletOrder(id);
                            Response.Write(ScTool.Alert("服务器忙或不支持该金额,请稍候再试! Order.aspx"));
                        }
                    }
                    else
                    {
                        Response.Write("创建订单失败! Order.aspx");
                    }
                }
                else
                {
                    Response.Write("创建订单金额为空! Order.aspx");
                }

                //List<String> names = DB.DataBaseNames();    // 服务器中所有数据库名称
                //List<String> names2 = DB.TableNames();      // 当前数据库中所有表名称

                //DB.DeletDataBase("PayDataBase");
                //List<String> names3 = DB.DataBaseNames();    // 服务器中所有数据库名称
            }
        }