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, int.Parse(SiteId));
         UserName = MCheck._UserName;
         R_Url    = Request.QueryString["r_url"];
         if (string.IsNullOrEmpty(R_Url))
         {
             R_Url = "";
         }
         OleDbConnection conn;
         Conn            Myconn = new Conn();
         conn = Myconn.OleDbConn();//获取OleDbConnection
         conn.Open();
         Check_SiteId();
         Data_Bind();
         conn.Close();
     }
     else
     {
     }
 }
示例#2
0
        private void Post_Fbk()
        {
            string Fbk_Content = Request.Form["fb_content"];

            if (Fbk_Content.Trim() == "")
            {
                conn.Close();
                Response.Write("<script type='text/javascript'>alert('留言内容不能为空!');location.href=location.href</script>");
                Response.End();
            }
            else
            {
                Member_Valicate Member = new Member_Valicate();
                Member.Member_Check();
                Fbk_Content       = ResplayJs(Fbk_Content);
                Current_LoginName = Request.Form["Current_LoginName"];
                if (IsUserName(Current_LoginName))
                {
                    sql = "insert into pa_spcfbk(space_owner,fbk_username,feedback,reply) values('" + UserName + "','" + Sql_Format(Current_LoginName) + "','" + Sql_Format(Fbk_Content) + "','')";
                    OleDbCommand Comm = new  OleDbCommand(sql, conn);
                    Comm.ExecuteNonQuery();
                }
                conn.Close();
                Response.Write("<script type='text/javascript'>alert('提交成功!');location.href=location.href</script>");
                Response.End();
            }
        }
示例#3
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();
 }
示例#4
0
 private void Check_IsMember()
 {
     if (Request.Cookies["Member"] == null)
     {
         P2.Visible = true;
     }
     else
     {
         Member_Valicate Member = new Member_Valicate();
         Member.Member_Check(true);
         Lb_CurrentLoginName.Text = Request.Cookies["Member"].Values["UserName"].ToString();
         P1.Visible = true;
     }
 }
示例#5
0
 private void Check_IsMember()
 {
     if (Request.Cookies["Member"] == null)
     {
         P2.Visible = true;
     }
     else
     {
         Member_Valicate Member = new Member_Valicate();
         Member.Member_Check();
         Current_LoginName        = Member._UserName;
         Lb_CurrentLoginName.Text = Current_LoginName;
         P1.Visible = true;
     }
 }
示例#6
0
 private void Get_Login()
 {
     if (Request.Cookies["Member"] != null)
     {
         Member_Valicate MCheck = new Member_Valicate();
         MCheck.Member_Check();
         P2.Visible = true;
         LoginName  = MCheck._UserName;
         Get_LoginMember(LoginName, MCheck._MemberTypeId);
     }
     else
     {
         P1.Visible = true;
     }
 }
示例#7
0
        private void  Del_Fbk()
        {
            string Did = Request.Form["did"];

            if (IsNum(Did))
            {
                Member_Valicate Member = new Member_Valicate();
                Member.Member_Check();
                sql = "delete from pa_spcfbk where space_owner='" + UserName + "' and id=" + int.Parse(Did);
                OleDbCommand Comm = new  OleDbCommand(sql, conn);
                Comm.ExecuteNonQuery();
                conn.Close();
            }
            conn.Close();
            Response.Write("<script type='text/javascript'>location.href=location.href</script>");
            Response.End();
        }
示例#8
0
 protected 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);
         UserName          = Request.Cookies["Member"].Values["UserName"].ToString();
         TxtTotal_fee.Text = Request.QueryString["amount"];
     }
     else
     {
         UserName = "";
         SiteId   = "";
         Response.Write("<script type='text/javascript'>alert('invalid siteid!');</script>");
         Response.End();
     }
 }
示例#9
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
     {
     }
 }
示例#10
0
        private void Member_Check()
        {
            if (Request.Cookies["Member"] == null)
            {
                UserName = "";
                Type_Id  = "0";

                //注释掉下面这段则可进行匿名订购
                string fun = "quick_login(\"" + SiteId + "\",\"ordercart('" + SiteId + "','" + Table + "'," + DetailId + ")\")";
                fun = fun.Replace("\"", "\\\"");
                Response.Write("<script type='text/javascript'>parent.CloseDialog(\"" + fun + "\")</" + "script>");
                Response.End();
                //注释掉上面这段则可进行匿名订购

                Random r = new Random();
                if (Request.Cookies["anonymous"] == null)
                {
                    Anonymous = DateTime.Now.ToString("yyyyMMddHHmmss") + r.Next(0, 999);
                    CreateAnymonseCookie(Anonymous);
                }
                else
                {
                    if (IsStr(Request.Cookies["anonymous"].Value))
                    {
                        Anonymous = Request.Cookies["anonymous"].Value;
                    }
                    else
                    {
                        Anonymous = DateTime.Now.ToString("yyyyMMddHHmmss") + r.Next(0, 999);
                        CreateAnymonseCookie(Anonymous);
                    }
                }
            }
            else
            {
                Member_Valicate Mck = new Member_Valicate();
                Mck.Member_Check();
                UserName  = Mck._UserName;
                Anonymous = "";
                Type_Id   = (Mck._MemberTypeId).ToString();
            }
        }
 private void Member_Check()
 {
     if (Request.Cookies["Member"] == null)
     {
         UserName = "";
         string fun = "quick_login(\"" + SiteId + "\",\"exchange('" + SiteId + "','" + Table + "'," + DetailId + ")\")";
         fun = fun.Replace("\"", "\\\"");
         Response.Write("<script type='text/javascript'>parent.CloseDialog(\"" + fun + "\")</" + "script>");
         Response.End();
     }
     else
     {
         Member_Valicate YZ = new Member_Valicate();
         YZ.Member_Check();
         UserName = YZ._UserName;
     }
     if (UserName == "")
     {
         Response.Write("<script type='text/javascript'>window.close();</script>");
         Response.End();
     }
     else
     {
         Lb_UserName.Text = UserName;
         sql = "select point_ky from pa_member where username='******'";
         OleDbCommand    comm = new OleDbCommand(sql, conn);
         OleDbDataReader dr   = comm.ExecuteReader();
         if (dr.Read())
         {
             MyPoint = dr["point_ky"].ToString();
         }
         else
         {
             MyPoint = "0";
         }
         Lb_MyPoint.Text = MyPoint;
         dr.Close();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsNum(Request.QueryString["s"]))
     {
         SiteId = Request.QueryString["s"];
         R_Url  = Request.QueryString["r_url"];
         if (string.IsNullOrEmpty(R_Url))
         {
             R_Url = "";
         }
         Member_Valicate MCheck = new Member_Valicate();
         MCheck.Member_Check(true, int.Parse(SiteId));
         UserName          = MCheck._UserName;
         TxtTotal_fee.Text = Request.QueryString["amount"];
     }
     else
     {
         UserName = "";
         SiteId   = "";
         Response.Write("<script type='text/javascript'>alert('invalid siteid!');</script>");
         Response.End();
     }
 }
示例#13
0
        private void Member_Check()
        {
            if (Request.Cookies["Member"] == null)
            {
                //注释掉下面这段则可进行匿名订购
                string fun = "quick_login(\"" + SiteId + "\",\"ordercart('" + SiteId + "')\")";
                fun = fun.Replace("\"", "\\\"");
                Response.Write("<script type='text/javascript'>parent.CloseDialog(\"" + fun + "\")</" + "script>");
                Response.End();
                //注释掉上面这段则可进行匿名订购

                if (Request.Cookies["anonymous"] == null)
                {
                    Response.Write("anonymous cookie is invalid");
                    Response.End();
                }
                else
                {
                    if (IsStr(Request.Cookies["anonymous"].Value))
                    {
                        Anonymous = Request.Cookies["anonymous"].Value;
                    }
                    else
                    {
                        Response.Write("anonymous cookie is invalid");
                        Response.End();
                    }
                }
            }
            else
            {
                Member_Valicate YZ = new Member_Valicate();
                YZ.Member_Check();
                UserName  = YZ._UserName;
                Anonymous = "";
            }
        }
示例#14
0
 private void Get_Login()
 {
     if (Request.Cookies["Member"] != null)
     {
         if (Request.Cookies["Member"].Values["UserName"] != null && Request.Cookies["Member"].Values["Type_Id"] != null)
         {
             Member_Valicate MCheck = new Member_Valicate();
             MCheck.Member_Check(true, SiteId.ToString());
             P2.Visible        = true;
             LoginName         = Request.Cookies["Member"].Values["UserName"];
             Login_Member_Type = Get_TypeName(int.Parse(Request.Cookies["Member"].Values["Type_Id"]));
             Get_NewMsg(LoginName);
         }
         else
         {
             Response.Write("<script>location.href='" + Get_Url("exit") + "'</script>");
             Response.End();
         }
     }
     else
     {
         P1.Visible = true;
     }
 }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Member_Valicate MCheck=new Member_Valicate();
           MCheck.Member_Check("cn");

        // 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"];
        remark2 = Request["remark2"];

        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);
               PageAdmin.Conn Myconn=new PageAdmin.Conn();
               string constr=Myconn.Constr();
               conn=new OleDbConnection(constr);
               conn.Open();
               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);
                }
               else
                {
                  Response.Write("<script>alert('此次支付已经成功转入到您的用户名下!')</script>");
                }
              conn.Close();
            }
        }
        else
        {
            Response.Write("校验失败,数据可疑!");
            Response.End();
        }
    }
示例#16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Member_Valicate MCheck=new Member_Valicate();
           MCheck.Member_Check("cn");
         //***************************************************************
        string alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?";
        string[] Alipay_Val=Get_Alipay().Split(',');
        string key = Alipay_Val[0]; //partner 的对应交易安全校验码(必须填写)
        string _input_charset = "utf-8";
        string partner = Alipay_Val[1]; 		//partner合作伙伴id(必须填写)

        alipayNotifyURL = alipayNotifyURL + "service=notify_verify" + "&partner=" + partner + "&notify_id=" + Request.QueryString["notify_id"];

        //获取支付宝ATN返回结果,true是正确的订单信息,false 是无效的
        string responseTxt = Get_Http(alipayNotifyURL, 120000);
        int i;
        NameValueCollection coll;
        //Load Form variables into NameValueCollection variable.
        coll = Request.QueryString;

        // Get names of all forms into a string array.
        String[] requestarr = coll.AllKeys;

        //进行排序;
        string[] Sortedstr = BubbleSort(requestarr);

           /* for (i = 0; i < Sortedstr.Length; i++)
           {
          Response.Write("Form: " + Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]] + "<br>");
           }*/

        //构造待md5摘要字符串 ;

        StringBuilder prestr = new StringBuilder();

        for (i = 0; i < Sortedstr.Length; i++)
        {
            if (Request.Form[Sortedstr[i]] != "" && Sortedstr[i] != "sign" && Sortedstr[i] != "sign_type")
            {
                if (i == Sortedstr.Length - 1)
                {
                    prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]]);
                }
                else
                {
                    prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]] + "&");

                }
            }

        }

        prestr.Append(key);
        //**********************************************************************
        //生成Md5摘要;
           // string mysign = GetMD5(prestr.ToString(), _input_charset);
        string mysign = GetMD5(prestr.ToString(), _input_charset);
        string sign = Request.QueryString["sign"];
        string trade_status = Request.QueryString["trade_status"];

        //Response.Write(prestr.ToString());  //打印返回通知消息,接收到的

        if (mysign == sign && responseTxt == "true" && trade_status == "TRADE_FINISHED")   //验证支付发过来的消息,签名是否正确
        {

            //更新自己数据库的订单语句,请自己填写一下
               string Pay_Amount=Request.QueryString["total_fee"];
               string v_oid=Request.QueryString["trade_no"];
               double Fnc_Amount=double.Parse(Pay_Amount);
               PageAdmin.Conn Myconn=new PageAdmin.Conn();
               string constr=Myconn.Constr();
               conn=new OleDbConnection(constr);
               conn.Open();
               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>支付金额:"+Pay_Amount;
                  SendMail(M_body);
                }
               else
                {
                  Response.Write("<script>alert('此次支付已经成功转入到您的用户名下!')</script>");
                }
              conn.Close();
              Pay_Result="支付成功,金额已经转入您的会员名下";

            //Response.Write("success");     //返回给支付宝消息,成功(不用返回给支付宝)
        //**************************************************************************
            //打印出接收通知。计算结果
            //Response.Write("------------------------------------------");
            //Response.Write("<br>Result:responseTxt=" + responseTxt);
            //Response.Write("<br>Result:mysign=" + mysign);
            //Response.Write("<br>Result:sign=" + sign);

        }
        else
        {
          //**************************************************************************
            //打印出接收通知。计算结果
            Response.Write("-------------------error-----------------------");
            Response.Write("<br>Result:responseTxt=" + responseTxt);
            Response.Write("<br>Result:mysign=" + mysign);
            Response.Write("<br>Result:sign=" + sign);
            Response.End();
        }
    }
示例#17
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (IsNum(Request.QueryString["s"]))
            {
                SiteId = Request.QueryString["s"];
                Member_Valicate MCheck = new Member_Valicate();
                MCheck.Member_Check(true, int.Parse(SiteId));
                UserName = MCheck._UserName;
            }
            else
            {
                UserName = "";
                SiteId   = "";
                Response.Write("<script type='text/javascript'>alert('invalid siteid!');</script>");
                Response.End();
            }

            if (IsFloat(Request.Form["pay_fee"]))
            {
                Get_TenPay();
                float Total_Fee = float.Parse(Request.Form["pay_fee"]) * 100;

                //当前时间 yyyyMMdd
                string date = DateTime.Now.ToString("yyyyMMdd");

                //生成订单10位序列号,此处用时间和随机数生成,商户根据自己调整,保证唯一
                string strReq = "" + DateTime.Now.ToString("HHmmss") + TenpayUtil.BuildRandomStr(4);

                //商户订单号,不超过32位,财付通只做记录,不保证唯一性
                string sp_billno = DateTime.Now.ToString("yyyyMMddHHmmss") + TenpayUtil.BuildRandomStr(4);

                //财付通订单号,10位商户号+8位日期+10位序列号,需保证全局唯一
                string transaction_id = bargainor_id + date + strReq;
                string return_url     = "http://" + url + "/e/member/onlinepay/tenpay/return_url.aspx";

                //创建PayRequestHandler实例
                PayRequestHandler reqHandler = new PayRequestHandler(Context);

                //设置密钥
                reqHandler.setKey(key);

                //初始化
                reqHandler.init();

                //-----------------------------
                //设置支付参数
                //-----------------------------
                reqHandler.setParameter("bargainor_id", bargainor_id);                  //商户号
                reqHandler.setParameter("sp_billno", sp_billno);                        //商家订单号
                reqHandler.setParameter("transaction_id", transaction_id);              //财付通交易单号
                reqHandler.setParameter("return_url", return_url);                      //支付通知url
                reqHandler.setParameter("desc", "订单号:" + transaction_id);               //商品名称
                reqHandler.setParameter("total_fee", Total_Fee.ToString("f0"));         //商品金额,以分为单位
                reqHandler.setParameter("cs", "utf-8");
                reqHandler.setParameter("attach", UserName + "," + SiteId);
                reqHandler.setParameter("spbill_create_ip", Page.Request.UserHostAddress);       //用户ip,测试环境时不要加这个ip参数,正式环境再加此参数
                string requestUrl = reqHandler.getRequestURL();
                Response.Redirect(requestUrl);

                //获取请求带参数的url

                /*
                 * string a_link = "<a target=\"_blank\" href=\"" + requestUrl + "\">" + "财付通支付" + "</a>";
                 *
                 * Response.Write(a_link);
                 */

                //post实现方式

                /*
                 * reqHandler.getRequestURL();
                 * Response.Write("<form method=\"post\" action=\""+ reqHandler.getGateUrl() + "\" >\n");
                 * Hashtable ht = reqHandler.getAllParameters();
                 * foreach(DictionaryEntry de in ht)
                 * {
                 *      Response.Write("<input type=\"hidden\" name=\"" + de.Key + "\" value=\"" + de.Value + "\" >\n");
                 * }
                 * Response.Write("<input type=\"submit\" value=\"财付通支付\" >\n</form>\n");
                 */

                //获取debug信息
                //string debuginfo = reqHandler.getDebugInfo();
                //Response.Write("<br/>" + debuginfo + "<br/>");

                //重定向到财付通支付
                //reqHandler.doSend();
            }
        }
示例#18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Member_Valicate MCheck=new Member_Valicate();
        MCheck.Member_Check("cn");
        Data_Bind();
 }