wysf_add.aspx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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;

public partial class wysf_add : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string sql;
            sql = "select * from dsmon where roomno='" + Request.QueryString["no"].ToString().Trim()+"' order by id desc";
            getdata(sql);
        }
    }
    private void getdata(string sql)
    {
        DataSet result = new DataSet();
        result = new Class1().hsggetdata(sql);
        if (result != null)
        {
            if (result.Tables[0].Rows.Count > 0)
            {
                this.Label1.Text = result.Tables[0].Rows[0]["ds"].ToString().Trim();
                this.fy.Text = ""+(double.Parse(result.Tables[0].Rows[0]["ds"].ToString().Trim())*1);

            }
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        String mon = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")).AddMonths(-1).ToShortDateString();

        string newmon = mon.Substring(0, mon.LastIndexOf("-"));
        string sql;
       
        sql = "insert into wysf(yz,roomno,fy,times,mon,sfr) values('" + Request["yz"] + "','"
            + Request["no"] + "'," + this.fy.Text + ",getdate(),'"
             + mon + "','" + Session["username"] + "')";
        int result;
        result = new Class1().hsgexucute(sql);
       
        if (result == 1)
        {
            Response.Write("<script>javascript:alert('操作成功');</script>");
        }
        else
        {
            Response.Write("<script>javascript:alert('系统错误,您没有设置好数据库的连接!');</script>");
        }
    }
   
后面还有 1 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。