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

📄 cl.aspx.cs

📁 一种模拟的手机计费软件
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class CL : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string connString = @"Data Source=.;Initial Catalog=shoujijifei;Integrated Security=True";
      using (SqlConnection conn = new SqlConnection(connString))
        if(TextBox1.Text != "") 
        {
        
       conn.Open();
        string sql = "UPDATE jifee SET  cailing=1.00 WHERE CardNo='"+TextBox1.Text+"'";
        SqlCommand cmd = new SqlCommand(sql, conn);
                int i = cmd.ExecuteNonQuery();
                if (i == 1)
                {
                    Response.Write("<script>alert('彩铃办理成功!')</script>");
                   TextBox1.Text = "";
                   

                }


                else
                {
                    Response.Write("<script>alert('彩铃办理失败!该卡号不存在!')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('彩铃办理失败,卡号不能为空!')</script>");

            }
        }
    protected void  Button2_Click(object sender, EventArgs e)
{
        string connString = @"Data Source=.;Initial Catalog=shoujijifei;Integrated Security=True";
      using (SqlConnection conn = new SqlConnection(connString))
        if(TextBox1.Text != "") 
        {
        
       conn.Open();
        string sql = "UPDATE jifee SET cailing =0.00 WHERE CardNo='"+TextBox1.Text+"'";
        SqlCommand cmd = new SqlCommand(sql, conn);
                int i = cmd.ExecuteNonQuery();
                if (i == 1)
                {
                    Response.Write("<script>alert('彩铃办理成功!')</script>");
                   TextBox1.Text = "";
                   

                }


                else
                {
                    Response.Write("<script>alert('彩铃办理失败!该卡号不存在!')</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('彩铃办理失败,卡号不能为空!')</script>");

            }
        }
}


⌨️ 快捷键说明

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