Admin/ResultAddzhixing.aspx.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_ResultAddzhixing : System.Web.UI.Page
{
    SqlHelper insert = new SqlHelper();
    Alert js = new Alert();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string hegeshu = Request.QueryString["shuliang"].ToString();
            this.hegeshu.Text = hegeshu;
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            int shuliang = int.Parse(Request.QueryString["shuliang"].ToString());
            string dingdanbianhao = Request.QueryString["dingdanbianhao"].ToString();
            int hegeshu = int.Parse(this.hegeshu.Text);
            int buhegeshu = int.Parse(this.buhegeshu.Text);
            string buhegeyuanyin = this.buhegeyuanyin.Text;
            string wanchengshijian = this.wanchengshijian.Text;
            //double hegelv = hegeshu * 100 / shuliang;
            float ftemp = ((float)hegeshu / shuliang)*100;
            string hegelv = Math.Round(ftemp, 2).ToString();
            string strsql1 = " insert into Result(dingdanbianhao,wanchengshijian,hegeshu,buhegeshu,hegelv,buhegeyuanyin)values(";
            strsql1 += "'" + dingdanbianhao + "','" + wanchengshijian + "'," + hegeshu + "," + buhegeshu + "," + hegelv + ",'" + buhegeyuanyin + "') ";

            strsql1 += " Update dingdan set zhuangtai='已检测完成' where dingdanbianhao='" + dingdanbianhao + "'";
            insert.RunSql(strsql1);
            Alert.AlertAndRedirect("添加成功", "ResultAdd.aspx");
        }
        catch (Exception)
        {
            js.Alertjs("格式不正确");
        }

    }
    protected void hegeshu_TextChanged(object sender, EventArgs e)
    {
        try
        {
            int shuliang = int.Parse(Request.QueryString["shuliang"].ToString());
            int hegeshu = int.Parse(this.hegeshu.Text);
            if (shuliang < hegeshu)
            {
                js.Alertjs("合格数量不能大于总数量");
                this.hegeshu.Text = "";
                return;
            }
            int buhegeshu = shuliang - hegeshu;
            this.buhegeshu.Text = buhegeshu.ToString();
后面还有 9 行代码,购买后查看完整代码

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

AI 解读 AI

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

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