⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 merchantcurl.aspx.cs

📁 商业源码
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using System.Data.OleDb;

namespace SCard.admin
{
	/// <summary>
	/// merchantCURL 的摘要说明。
	/// </summary>
	public class merchantCURL : System.Web.UI.Page
	{
        protected System.Web.UI.WebControls.Label lblText;
        protected System.Web.UI.WebControls.TextBox text;
        protected System.Web.UI.WebControls.Button btnOK;
    
		private void Page_Load(object sender, System.EventArgs e)
		{
            //权限检查
            if( Session["adminName"]==null || Session["adminName"].ToString() == String.Empty )
            {
                Response.Write("<font color=#ff0000 style='FONT-SIZE: 12px'>对不起,您没足够权限访问此页!!</font><br>");
                Response.Write("<a href=index.aspx target=_top style='FONT-SIZE: 12px'>重新登陆</a><br>");
                Response.End();
                return;
            }

            if( !IsPostBack )
            {
                lblText.Text = getMerchantCURL();//获取 商家接受支付结果的URL
            }
		}

        private string getMerchantCURL()//获取 商家接受查账结果的URL
        {
            string s = "";

            DBConn myDB = new DBConn();
            string mySql="select [text] from [wangguan] where [id]='3'";
            OleDbDataReader mydr  = myDB.getDataReader( mySql );
            if( mydr.Read() )
            {
                s = mydr["text"].ToString();
            }
            mydr.Close();
            myDB.Close();

            return s;
        }

        private int setMerchantCURL( string s )//设置 商家接受查账结果的URL
        {
            DBConn myDB = new DBConn();
            string mySql="update [wangguan] set [text]='" + s + "' where [id]='3'";
            int i = myDB.ExecuteNonQuery( mySql );
            myDB.Close();

            return i;
        }

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            this.Load += new System.EventHandler(this.Page_Load);

        }
		#endregion

        private void btnOK_Click(object sender, System.EventArgs e)
        {
            string s = text.Text.Trim();
            if( s == String.Empty )
            {
                Response.Write("<script>");
                Response.Write("alert('请输入URL!!!');");
                Response.Write("</script>");
                return;
            }
            
            if( setMerchantCURL( s ) == 1 )//设置 接受查账结果的URL
            {
                Response.Write("<script>");
                Response.Write("alert('URL,成功修改为[ " + s + " ]!!');");
                Response.Write("</script>");
                
                text.Text = "";

                lblText.Text = getMerchantCURL();//获取 接受查账结果的URL
            }  
        }
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -