Exemple #1
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            SiteId   = Request.QueryString["s"];
            Table    = Request.QueryString["table"];
            DetailId = Request.QueryString["id"];
            Conn Myconn = new Conn();

            if (!Page.IsPostBack)
            {
                if (IsNum(SiteId) && IsNum(DetailId) && IsStr(Table))
                {
                    conn = new OleDbConnection(Myconn.Constr());
                    conn.Open();
                    Member_Check();
                    Get_Prod();
                    conn.Close();
                }
                else
                {
                    Response.Write("<script type='text/javascript'>alert('参数错误');</script>");
                    Response.End();
                }
            }
            else
            {
                conn = new OleDbConnection(Myconn.Constr());
                conn.Open();
                Member_Check();
                if (IsUserName(UserName))
                {
                    ExChange();
                }
                conn.Close();
            }
        }
Exemple #2
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn   Myconn = new Conn();
            string constr = Myconn.Constr();//获取连接字符串

            conn     = new OleDbConnection(constr);
            PageSize = 20;
            if (IsNum(Request.QueryString["page"]))
            {
                CurrentPage = int.Parse(Request.QueryString["page"]);
            }
            else
            {
                CurrentPage = 1;
            }
            if (IsNum(Request.QueryString["tid"]))
            {
                Tid = int.Parse(Request.QueryString["tid"]);
                UID = Request.QueryString["uid"];
                conn.Open();
                Get_Table();
                Get_UserName();
                Tongji();
                List_Bind();
                conn.Close();
            }
        }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Conn   Myconn = new Conn();
        string constr = Myconn.Constr();

        conn = new OleDbConnection(constr);
        conn.Open();
        // MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥
        string key = Get_ChinaBank_Key();       // 如果您还没有设置MD5密钥请登陆我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/

        // 登陆后在上面的导航栏里可能找到“资料管理”,在资料管理的二级导航栏里有“MD5密钥设置”
        // 建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了

        v_oid       = Request["v_oid"];
        v_pstatus   = Request["v_pstatus"];
        v_pstring   = Request["v_pstring"];
        v_pmode     = Request["v_pmode"];
        v_md5str    = Request["v_md5str"];
        v_amount    = Request["v_amount"];
        v_moneytype = Request["v_moneytype"];
        remark1     = Request["remark1"];
        if (remark1 == null)
        {
            return;
        }
        remark2  = Request["remark2"];
        UserName = remark1.Split(',')[0];
        SiteId   = remark1.Split(',')[1];
        string str = v_oid + v_pstatus + v_amount + v_moneytype + key;

        str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "md5").ToUpper();
        if (str == v_md5str)
        {
            if (v_pstatus.Equals("20"))
            {
                //支付成功
                //在这里商户可以写上自己的业务逻辑
                status_msg = "支付成功,金额已经转入您的会员名下";
                double Fnc_Amount = double.Parse(v_amount);
                if (!Fnc_rk(v_oid))
                {
                    Update_member_fnc(Fnc_Amount);
                    Update_fnc_list(Fnc_Amount, "网银在线", v_oid, "订单号:" + v_oid);
                    string M_body = "支付方式:网银在线<br>订单号:" + v_oid + "<br>支付金额:" + v_amount;
                    SendMail(M_body);
                    Response.Redirect("/e/member/index.aspx?type=mem_payresult&s=" + SiteId + "&pay_no=" + v_oid + "&pay_amount=" + v_amount + "&pay_type=" + Server.UrlEncode("网银在线"));
                }
                else
                {
                    Response.Redirect("/e/member/index.aspx?type=payresult&s=" + SiteId + "&pay_no=" + v_oid + "&pay_amount=" + v_amount + "&pay_type=" + Server.UrlEncode("网银在线"));
                }
            }
        }
        else
        {
            Response.Write("校验失败,数据可疑!");
            Response.End();
        }
        conn.Close();
    }
Exemple #4
0
 void Data_Bind()
 {
     string sql="select top 1 * from onlinepay where onlinepay_type='alipay'";
        Conn Myconn=new Conn();
        OleDbConnection conn=new OleDbConnection(Myconn.Constr());
        conn.Open();
        OleDbCommand Comm=new OleDbCommand(sql,conn);
        OleDbDataReader dr=Comm.ExecuteReader();
        if(dr.Read())
     {
       T_total_fee.Attributes.Add("onkeyup","if(isNaN(value))execCommand('undo')");
       T_partner.Text=dr["onlinepay_partnerid"].ToString();
       T_seller_email.Text=dr["onlinepay_mid"].ToString();
       T_key.Text=dr["onlinepay_key"].ToString();
       T_return_url.Text="http://"+Request.ServerVariables["SERVER_NAME"]+"/member/onlinepay/alipay/Alipay_Return.aspx";
       T_notify_url.Text="http://"+Request.ServerVariables["SERVER_NAME"]+"/member/onlinepay/alipay/Alipay_Notify.aspx";
       if(T_show_url.Text=="")
        {
      T_show_url.Text=Request.ServerVariables["SERVER_NAME"];
        }
       Button1.Attributes.Add("onclick","return C_Tb()");
     }
        else
     {
       Response.End();
     }
        conn.Close();
 }
Exemple #5
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn   Myconn = new Conn();
            string constr = Myconn.Constr();

            conn = new OleDbConnection(constr);
            if (IsNum(Request.QueryString["uid"]))
            {
                conn.Open();
                Get_Member();
                Get_Permissions();
                Table_Bind();
                Get_Login();
                conn.Close();
                Load_Control();
            }
            else if (IsUserName(Request.QueryString["username"]))
            {
                Go_Uid();
            }
            else
            {
                Response.Write("<script type='text/javascript'>alert('Invalid username!');</script>");
                Response.End();
            }
        }
Exemple #6
0
 protected void Page_Load(Object sender, EventArgs e)
 {
     SiteId = Request.QueryString["s"];
     Table  = Request.QueryString["table"];
     if (!Page.IsPostBack)
     {
         Conn Myconn = new Conn();
         conn = new OleDbConnection(Myconn.Constr());
         Member_Check();
         if (Request.Form["post"] == "add")
         {
             conn.Open();
             if (IsNum(SiteId))
             {
                 Order_Add();
             }
             conn.Close();
         }
         else
         {
             if (IsNum(SiteId))
             {
                 conn.Open();
                 Get_Total();
                 Data_Bind();
                 conn.Close();
             }
         }
     }
 }
Exemple #7
0
 void Page_Load(Object sender,EventArgs e)
 {
     //公共部分==============================================
      Member_Valicate MCheck=new Member_Valicate();
      MCheck.Member_Check("cn");
      Conn Myconn=new Conn();
      Constr=Myconn.Constr();//获取连接字符串
     //公共部分==============================================
      Data_Bind();
 }
Exemple #8
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn   Myconn = new Conn();
            string constr = Myconn.Constr();//获取连接字符串

            conn = new OleDbConnection(constr);
            conn.Open();
            List_Bind();
            conn.Close();
        }
Exemple #9
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn   Myconn = new Conn();
            string constr = Myconn.Constr();//获取连接字符串

            conn     = new OleDbConnection(constr);
            UserName = Request.QueryString["username"];
            SiteId   = int.Parse(Request.QueryString["s"]);
            conn.Open();
            Table_Bind();
            conn.Close();
        }
Exemple #10
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn   Myconn = new Conn();
            string constr = Myconn.Constr();//获取连接字符串

            conn     = new OleDbConnection(constr);
            UID      = Request.QueryString["uid"];
            PageSize = int.Parse(Lb_PageSize.Text);
            if (IsNum(Request.QueryString["page"]))
            {
                CurrentPage = int.Parse(Request.QueryString["page"]);
            }
            else
            {
                CurrentPage = 1;
            }
            if (!Page.IsPostBack)
            {
                conn.Open();
                if (IsNum(Request.QueryString["uid"]))
                {
                    UID = Request.QueryString["uid"];
                    Get_UserName();
                    switch (Request.Form["post"])
                    {
                    case null:
                        Check_IsMember();
                        Tongji();
                        List_Bind();
                        break;

                    case "feedback":
                        Check_Post();
                        Post_Fbk();
                        break;

                    case "login":
                        Check_Post();
                        MLogin();
                        break;

                    case "delete":
                        Check_Post();
                        Del_Fbk();
                        break;
                    }
                    conn.Close();
                }
            }
        }
Exemple #11
0
        protected void Update_Sql(Object src, EventArgs e)
        {
            if (!check_Installlock())
            {
                return;
            }
            string Run_Result = "";
            int    ErrorNum   = 1;

            if (Tb_sql.Text.Trim() == "")
            {
                Lbl_error.Text = "提示:请输入sql运行语句!";
                return;
            }
            else
            {
                string[]        Asql       = Tb_sql.Text.Split(';');
                Conn            conn1      = new Conn();
                string          Str_Constr = conn1.Constr();
                OleDbConnection conn       = new OleDbConnection(Str_Constr);
                conn.Open();
                OleDbCommand comm;
                for (int i = 0; i < Asql.Length; i++)
                {
                    if (Asql[i].Trim() != "")
                    {
                        try
                        {
                            comm = new OleDbCommand(Asql[i].Trim(), conn);
                            comm.ExecuteNonQuery();
                        }
                        catch (Exception ee)
                        {
                            Run_Result += ErrorNum.ToString() + ":" + ee.Message + "<br>";
                            ErrorNum++;
                        }
                    }
                }
                conn.Close();
                if (Run_Result != "")
                {
                    Lbl_error.Text = "出现以下错误(字段已经存在的错误可以忽略):<br>" + Run_Result + "<br>";
                }
                else
                {
                    Lbl_error.Text = "您好,sql运行成功!<br>";
                }
                Build_Installlock();
            }
        }
Exemple #12
0
 void Page_Load(Object sender, EventArgs e)
 {
     if (IsNum(Request.QueryString["s"]))
     {
         SiteId = Request.QueryString["s"];
         Member_Valicate MCheck = new Member_Valicate();
         MCheck.Member_Check(true, SiteId);
         Conn Myconn = new Conn();
         Constr = Myconn.Constr();//获取连接字符串
         conn   = new OleDbConnection(Constr);
         conn.Open();
         Check_SiteId();
         Data_Bind();
         conn.Close();
     }
     else
     {
     }
 }
Exemple #13
0
 protected void Page_Load(Object sender, EventArgs e)
 {
     SiteId   = Request.QueryString["s"];
     Table    = Request.QueryString["table"];
     DetailId = Request.QueryString["id"];
     if (!IsNum(Request.QueryString["id"]))
     {
         DetailId = "0";
     }
     if (!Page.IsPostBack)
     {
         Conn Myconn = new Conn();
         conn = new OleDbConnection(Myconn.Constr());
         Member_Check();
         if (Request.Form["post"] != null)
         {
             conn.Open();
             Set_Car();
             conn.Close();
         }
         else
         {
             if (IsNum(SiteId))
             {
                 if (IsUserName(UserName) || IsStr(Anonymous))
                 {
                     conn.Open();
                     if (IsNum(DetailId) && IsStr(Table))
                     {
                         Add_Prod();
                     }
                     Get_Total();
                     Data_Bind();
                     conn.Close();
                 }
             }
         }
     }
 }
Exemple #14
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn Myconn = new Conn();

            conn = new OleDbConnection(Myconn.Constr());
            if (!Page.IsPostBack)
            {
                if (IsNum(Request.QueryString["orderid"]))
                {
                    conn.Open();
                    Get_Total();
                    Data_Bind();
                    Info_Bind();
                    conn.Close();
                    Lblorderid.Text = Request.QueryString["orderid"];
                }
                else
                {
                    P1.Visible       = false;
                    Lbl_info.Visible = true;
                }
            }
        }
Exemple #15
0
        private bool Update_DataBase()
        {
            if (Login_Pass.Text != Login_Pass1.Text)
            {
                Lbl_error.Text = "两次输入的密码不一致,请重新输入!";
                return(false);
            }
            Conn            conn1      = new Conn();
            string          Str_Constr = conn1.Constr();
            Md5             jm1        = new Md5();
            string          Pass       = jm1.Get_Md5(Login_Pass.Text.Trim());
            OleDbConnection Myconn     = new OleDbConnection(Str_Constr);

            Myconn.Open();
            Check_DefaultType(Myconn);
            string          sql  = "select top 1 * from pa_member where username='******'";
            OleDbCommand    Comm = new OleDbCommand(sql, Myconn);
            OleDbDataReader dr   = Comm.ExecuteReader();

            if (dr.Read())
            {
                sql  = "update pa_member set userpassword='******',m_group='admin',checked=1,mtype_id=" + Mtype_Id + " where username='******'";
                Comm = new OleDbCommand(sql, Myconn);
                Comm.ExecuteNonQuery();
            }
            else
            {
                sql  = "insert into pa_member(username,userpassword,m_group,checked,mtype_id,space_clicks,department_id) values('admin','" + Pass + "','admin',1," + Mtype_Id + ",0,0)";
                Comm = new OleDbCommand(sql, Myconn);
                Comm.ExecuteNonQuery();
            }

            dr.Close();
            Myconn.Close();
            return(true);
        }
Exemple #16
0
        protected void Page_Load(Object sender, EventArgs e)
        {
            Conn   Myconn = new Conn();
            string constr = Myconn.Constr();//获取连接字符串

            conn = new OleDbConnection(constr);
            conn.Open();
            if (Request.Form["vote"] == "1")
            {
                Check_Post();
                Get_Vote();
                Get_Site(int.Parse(SiteId));
                Get_QIds(int.Parse(Request.QueryString["id"]));
                Get_Post();
            }
            else
            {
                I = 1;
                Get_Vote();
                Get_QIds(int.Parse(Request.QueryString["id"]));
                Data_Bind();
            }
            conn.Close();
        }
Exemple #17
0
 protected void Page_Load(Object sender, EventArgs e)
 {
     if (IsNum(Request.QueryString["s"]) && IsStr(Request.QueryString["username"]))
     {
         Conn   Myconn = new Conn();
         string constr = Myconn.Constr();//获取连接字符串
         conn     = new OleDbConnection(constr);
         UserName = Request.QueryString["username"];
         SiteId   = int.Parse(Request.QueryString["s"]);
         conn.Open();
         Get_WebSet();
         Table_Bind();
         Load_Control();
         Get_Member();
         Get_MemberSet();
         Get_Login();
         conn.Close();
     }
     else
     {
         Response.Write("<script type='text/javascript'>alert('参数错误!')</script>");
         Response.End();
     }
 }
Exemple #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary <string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify    = new Notify();
            bool   verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表
                string trade_no     = Request.Form["trade_no"];           //支付宝交易号
                string order_no     = Request.Form["out_trade_no"];       //获取订单号
                string total_fee    = Request.Form["total_fee"];          //获取总金额
                string subject      = Request.Form["subject"];            //商品名称、订单名称
                string body         = Request.Form["body"];               //商品描述、订单备注、描述
                string buyer_email  = Request.Form["buyer_email"];        //买家支付宝账号
                string trade_status = Request.Form["trade_status"];       //交易状态
                string zdy_info     = Request.Form["extra_common_param"]; //会员和site组合
                UserName = zdy_info.Split(',')[0];
                SiteId   = zdy_info.Split(',')[1];
                if (Request.Form["trade_status"] == "TRADE_FINISHED" || Request.Form["trade_status"] == "TRADE_SUCCESS")
                {
                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序
                    //更新自己数据库的订单语句,请自己填写一下
                    double Fnc_Amount = double.Parse(total_fee);
                    Conn   Myconn     = new Conn();
                    string constr     = Myconn.Constr();
                    conn = new OleDbConnection(constr);
                    conn.Open();
                    if (!Fnc_rk(trade_no))
                    {
                        Update_member_fnc(Fnc_Amount);
                        Update_fnc_list(Fnc_Amount, "支付宝即时充值", trade_no, "交易号:" + trade_no);
                        string M_body = "支付方式:支付宝即时充值<br>支付宝交易号:" + trade_no + "<br>支付金额:" + Fnc_Amount;
                        SendMail(M_body);
                    }
                    else
                    {
                        //
                    }
                    conn.Close();

                    Response.Write("success"); //请不要修改或删除
                }
                else
                {
                    Response.Write("success");  //其他状态判断。普通即时到帐中,其他状态不用判断,直接打印success。
                }

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Exemple #19
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Conn   Myconn = new  Conn();
            string constr = Myconn.Constr();

            conn = new OleDbConnection(constr);
            conn.Open();

            string key = Get_Key();         //密钥

            //创建PayResponseHandler实例
            PayResponseHandler resHandler = new PayResponseHandler(Context);

            resHandler.setKey(key);

            //判断签名
            if (resHandler.isTenpaySign())
            {
                //交易单号
                string transaction_id = resHandler.getParameter("transaction_id");

                //金额金额,以分为单位
                string total_fee = resHandler.getParameter("total_fee");

                //支付结果
                string pay_result = resHandler.getParameter("pay_result");

                string zdy_info = resHandler.getParameter("attach");              //会员和site组合
                UserName = zdy_info.Split(',')[0];
                SiteId   = zdy_info.Split(',')[1];
                if ("0".Equals(pay_result))
                {
                    //------------------------------
                    //处理业务开始
                    //------------------------------
                    //注意交易单不要重复处理
                    //注意判断返回金额
                    string sp_billno  = resHandler.getParameter("sp_billno");             //订单号
                    double Fnc_Amount = (double.Parse(total_fee) / 100);
                    if (!Fnc_rk(sp_billno))
                    {
                        Update_member_fnc(Fnc_Amount);
                        Update_fnc_list(Fnc_Amount, "财付通即时充值", sp_billno, "订单号:" + sp_billno);
                        string M_body = "支付方式:财付通即时充值<br>财付通订单号:" + sp_billno + "<br>支付金额:" + Fnc_Amount;
                        SendMail(M_body);
                    }
                    else
                    {
                        //
                    }
                    conn.Close();
                    //------------------------------
                    //处理业务完毕
                    //------------------------------
                    //调用doShow, 打印meta值跟js代码,告诉财付通处理成功,并在用户浏览器显示$show页面.
                    resHandler.doShow("http://" + url + "/e/member/onlinepay/tenpay/show.aspx?s=" + SiteId + "&total_fee=" + Fnc_Amount + "&sp_billno=" + sp_billno);
                }
                else
                {
                    //当做不成功处理
                    conn.Close();
                    Response.Write("支付失败");
                }
            }
            else
            {
                conn.Close();
                Response.Write("认证签名失败");
                //string debugInfo = resHandler.getDebugInfo();
                //Response.Write("<br/>debugInfo:" + debugInfo);
            }
        }