コード例 #1
0
    protected void lbtn_refresh_Click(object sender, EventArgs e)
    {
        string dtss        = datemin.Value + " " + datemax.Value;
        string dtes        = datemin.Value + " " + datemax2.Value;
        string cequ        = ddl_cequ.SelectedValue;
        string gongzuomain = ddl_gongzuomian.SelectedValue;
        string strConn     = ConfigurationManager.ConnectionStrings["webConnectionString"].ToString();

        DrawImage.DrawingCurve dc = new DrawImage.DrawingCurve(strConn);
        Bitmap img = DrawImage.DrawingCurve.DrawingImg26(cequ, gongzuomain, dtss, dtes);
        string str = Server.MapPath("./xiazai/");

        img.Save(str + "huozhusuoliangfenxi.jpg");
        img1.Src = "xiazai/huozhusuoliangfenxi.jpg";

        string  sql = "select * from PressurePar where areaname='" + ddl_cequ.SelectedValue + "' and facename='" + gongzuomain + "'";
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        if (ds.Tables[0].Rows.Count > 0)
        {
            sql = "select * from HuoZhuPar where areaName='" + ddl_cequ.SelectedValue + "' and FaceName='" + gongzuomain + "'";
            ds  = DB.ExecuteSqlDataSet(sql, null);
            if (ds.Tables[0].Rows.Count > 0)
            {
                txtsuoliangyujingzhi.Value  = ds.Tables[0].Rows[0]["YujingValue"].ToString();
                txtsuoliangbaojingzhi.Value = ds.Tables[0].Rows[0]["AlarmValue"].ToString();
            }
        }
        sql = "select * from HuoZhuSenInfo where areaName='" + ddl_cequ.SelectedValue + "' and FaceName='" + gongzuomain + "'";
        ds  = DB.ExecuteSqlDataSet(sql, null);
        txtchuanganqizushu.Value = ds.Tables[0].Rows.Count.ToString();
    }
コード例 #2
0
    protected void search_Click(object sender, EventArgs e)
    {
        string    dts       = datemin.Value;
        string    dte       = datemax.Value;
        string    cequ      = ddl_cequ.SelectedValue;
        string    gzm       = ddl_gongzuomian.SelectedValue;
        string    zjbh      = ddl_zhijiabianhao.SelectedValue;
        DataTable dt_img    = new DataTable();
        DataTable dt_export = new DataTable();
        string    strConn   = ConfigurationManager.ConnectionStrings["webConnectionString"].ToString();

        DrawImage.DrawingCurve dc = new DrawImage.DrawingCurve(strConn);
        Bitmap img  = DrawImage.DrawingCurve.DrawingImg6(cequ, gzm, "4", zjbh, dts, dte, dt_img, dt_export);
        string str  = Server.MapPath("./xiazai/");
        string str2 = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "ZhongCaiGongZuoZuLiLiShiShuJuFenXiQuxian.jpg";

        img.Save(str + str2);
        panel1.BackImageUrl = "xiazai/" + str2;
        StringBuilder sb = new StringBuilder();

        sb.Append("[");
        for (int i = 0; i < dt_img.Rows.Count; i++)
        {
            if (i == 0)
            {
                sb.Append("{");
            }
            else
            {
                sb.Append(",{");
            }
            sb.Append(string.Format("\"{0}\":\"{1}\"", "content", dt_img.Rows[i]["content"].ToString()));
            sb.Append("}");
        }
        sb.Append("]");
        txtjson.Text = sb.ToString();

        //进尺数据
        string  sql = "select sum(hcjcnose) hcjcnose,sum(hcjcmid) hcjcmid,sum(hcjctail) hcjctail from Huicai where AreaName = '" + cequ + "' and FaceName = '" + gzm + "'";// and left(convert(nvarchar(50),datetime,20),10) <='" + t2 + "' ";
        DataSet ds  = DB.ExecuteSqlDataSet(sql, null);

        if (ds.Tables[0].Rows.Count > 0)
        {
            head.Value = ds.Tables[0].Rows[0]["hcjcnose"].ToString() == "" ? "0.00" : ds.Tables[0].Rows[0]["hcjcnose"].ToString();
            body.Value = ds.Tables[0].Rows[0]["hcjcmid"].ToString() == "" ? "0.00" : ds.Tables[0].Rows[0]["hcjcmid"].ToString();
            foot.Value = ds.Tables[0].Rows[0]["hcjctail"].ToString() == "" ? "0.00" : ds.Tables[0].Rows[0]["hcjctail"].ToString();
        }
        else
        {
            head.Value = "0.00";
            body.Value = "0.00";
            foot.Value = "0.00";
        }
    }
コード例 #3
0
    protected void search_Click(object sender, EventArgs e)
    {
        string    dts       = datemin.Value;
        string    dte       = datemax.Value;
        string    cequ      = ddl_cequ.SelectedValue;
        string    gzm       = ddl_gongzuomian.SelectedValue;
        string    zjbh      = ddl_zhijiabianhao.SelectedValue;
        DataTable dt_img    = new DataTable();
        DataTable dt_export = new DataTable();
        string    zhu       = "1";//左柱

        if (zuozhu.Checked == true)
        {
            zhu = "1";
        }
        if (youzhu.Checked == true)
        {
            zhu = "2";
        }
        string strConn = ConfigurationManager.ConnectionStrings["webConnectionString"].ToString();

        DrawImage.DrawingCurve dc = new DrawImage.DrawingCurve(strConn);
        //Bitmap img = DrawImage.DrawingCurve.DrawingImg(cequ, gzm, zjbh, dts, dte);
        decimal CCL     = Convert.ToDecimal(ConfigurationManager.ConnectionStrings["CCmin"].ToString());
        decimal ZLvalue = Convert.ToDecimal(ConfigurationManager.ConnectionStrings["ZLvalue"].ToString());
        Bitmap  img     = DrawImage.DrawingCurve.DrawingImg9(cequ, gzm, zhu, zjbh, dts, dte, dt_img, dt_export, CCL, ZLvalue);
        string  str     = Server.MapPath("./xiazai/");
        string  str2    = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "anquanfakaiqiquxian.jpg";

        img.Save(str + str2);
        panel1.BackImageUrl = "xiazai/" + str2;
        StringBuilder sb = new StringBuilder();

        sb.Append("[");
        for (int i = 0; i < dt_img.Rows.Count; i++)
        {
            if (i == 0)
            {
                sb.Append("{");
            }
            else
            {
                sb.Append(",{");
            }
            sb.Append(string.Format("\"{0}\":\"{1}\"", "content", dt_img.Rows[i]["content"].ToString()));
            sb.Append("}");
        }
        sb.Append("]");
        txtjson.Text = sb.ToString();
    }
コード例 #4
0
    protected void search_Click(object sender, EventArgs e)
    {
        string url = datemin.Value;

        if (url == "")
        {
            SystemTool.AlertShow(this, "开始日期不能为空");
            return;
        }
        url = datemax.Value;
        if (url == "")
        {
            SystemTool.AlertShow(this, "结束日期不能为空");
            return;
        }
        string riqi        = datemin.Value;
        string riqi2       = datemax.Value;
        string t1          = "00:00:00"; // datemax.Value;
        string t2          = "23:59:59"; // datemax2.Value;
        string cequ        = ddl_cequ.SelectedValue;
        string gongzuomian = ddl_gongzuomian.SelectedValue;
        string yz          = ConfigurationManager.ConnectionStrings["YuZhi"].ToString();//小于此值,舍去yuzhi.Value;
        string zhu         = "3";
        string strConn     = ConfigurationManager.ConnectionStrings["webConnectionString"].ToString();

        DrawImage.DrawingCurve dc = new DrawImage.DrawingCurve(strConn);
        Bitmap img  = DrawImage.DrawingCurve.DrawingImg10_0(cequ, gongzuomian, zhu, yz, riqi, riqi2 + " " + t2);
        string str  = Server.MapPath("./xiazai/");
        string str2 = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "MeiRiGongZuoZuLiFenBuQuXian.jpg";

        img.Save(str + str2);
        img1.ImageUrl           = "xiazai/" + str2;
        ViewState["date"]       = riqi;
        ViewState["date2"]      = riqi2;
        ViewState["baojingzhi"] = "0";
        ViewState["yujingzhi"]  = "0";
        string  sqlbjz = "select * from dbo.PressurePar where areaname='" + cequ + "' and facename='" + gongzuomian + "'";
        DataSet result = DB.ExecuteSqlDataSet(sqlbjz, null);

        if (result.Tables[0].Rows.Count > 0)
        {
            ViewState["baojingzhi"] = result.Tables[0].Rows[0]["pressuremax"].ToString();
            ViewState["yujingzhi"]  = result.Tables[0].Rows[0]["pressuremin"].ToString();
        }
    }
コード例 #5
0
    protected void search_Click(object sender, EventArgs e)
    {
        string       time1          = datemin.Value;
        string       time2          = datemax.Value;
        string       cequ           = ddl_cequ.SelectedValue;
        string       roadway        = ddl_roadway.SelectedValue;
        string       maoguleixing   = ddl_maoguleixing.SelectedValue;
        string       anzhuangweizhi = ddl_anzhuangweizhi.SelectedValue;
        DrawingCurve MyDc           = new DrawingCurve();
        DataTable    a       = new DataTable();
        DataTable    b       = new DataTable();
        string       strConn = ConfigurationManager.ConnectionStrings["webConnectionString"].ToString();

        DrawImage.DrawingCurve dc = new DrawImage.DrawingCurve(strConn);
        Bitmap img = DrawImage.DrawingCurve.DrawingImg22(cequ, roadway, maoguleixing, anzhuangweizhi, time1, time2, a);
        string str = Server.MapPath("./xiazai/");

        img.Save(str + "maoganmaosuoshujufenxi.jpg");
        panel1.BackImageUrl = "xiazai/maoganmaosuoshujufenxi.jpg";
        StringBuilder sb = new StringBuilder();

        sb.Append("[");
        for (int i = 0; i < a.Rows.Count; i++)
        {
            if (i == 0)
            {
                sb.Append("{");
            }
            else
            {
                sb.Append(",{");
            }
            sb.Append(string.Format("\"{0}\":\"{1}\"", "content", a.Rows[i]["content"].ToString()));
            sb.Append("}");
        }
        sb.Append("]");
        txtjson.Text = sb.ToString();
    }
コード例 #6
0
    protected void search_Click(object sender, EventArgs e)
    {
        string    dts       = datemin.Value;
        string    dte       = datemax.Value;
        string    cequ      = ddl_cequ.SelectedValue;
        string    gzm       = ddl_gongzuomian.SelectedValue;
        string    zjbh      = ddl_zhijiabianhao.SelectedValue;
        DataTable dt_img    = new DataTable();
        DataTable dt_export = new DataTable();
        string    zhu       = "3";

        if (zhengjia.Checked == true)
        {
            zhu = "3";
        }
        if (zuozhu.Checked == true)
        {
            zhu = "1";
        }
        if (youzhu.Checked == true)
        {
            zhu = "2";
        }
        string strConn = ConfigurationManager.ConnectionStrings["webConnectionString"].ToString();

        DrawImage.DrawingCurve dc = new DrawImage.DrawingCurve(strConn);
        //Bitmap img = DrawImage.DrawingCurve.DrawingImg(cequ, gzm, zjbh, dts, dte);
        decimal CCL     = Convert.ToDecimal(ConfigurationManager.ConnectionStrings["CCmin"].ToString());
        decimal ZLvalue = Convert.ToDecimal(ConfigurationManager.ConnectionStrings["ZLvalue"].ToString());
        Bitmap  img     = DrawImage.DrawingCurve.DrawingImg7(cequ, gzm, zhu, zjbh, dts, dte, dt_img, dt_export, CCL, ZLvalue);
        string  str     = Server.MapPath("./xiazai/");
        string  str2    = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "chuzhangliyumozulifenxiquxian.jpg";

        img.Save(str + str2);
        panel1.BackImageUrl = "xiazai/" + str2;
        StringBuilder sb = new StringBuilder();

        sb.Append("[");
        for (int i = 0; i < dt_img.Rows.Count; i++)
        {
            if (i == 0)
            {
                sb.Append("{");
            }
            else
            {
                sb.Append(",{");
            }
            sb.Append(string.Format("\"{0}\":\"{1}\"", "content", dt_img.Rows[i]["content"].ToString()));
            sb.Append("}");
        }
        sb.Append("]");
        txtjson.Text       = sb.ToString();
        ViewState["excel"] = dt_export;
        //保存分析数据到PreReport
//        string sqlck = "select * from PreReport where areaName='"+cequ+"' and faceName='"+gzm+"' and bracketNo='"+zjbh+"' and reportDate='"+dts+"'";
//        DataSet dsck = DB.ExecuteSqlDataSet(sqlck, null);
//        if (dsck.Tables[0].Rows.Count <=0) {
//            decimal CCLmax = 0;// Convert.ToDecimal(dt_export.Compute("Min(chuchengli)", "true"));
//            decimal MZLmax = 0;// Convert.ToDecimal(dt_export.Compute("Max(mozuli)", "true"));
//            int intCCL = 0;
//            int intMZL = 0;
//            decimal decCCL = 0;
//            decimal decMZL = 0;
//            for (int i = 0; i < dt_export.Rows.Count; i++)
//            {
//                if (dt_export.Rows[i]["chuchengli"].ToString() != "")
//                {
//                    intCCL += 1;
//                    decCCL += Convert.ToDecimal(dt_export.Rows[i]["chuchengli"].ToString());
//                    CCLmax = CCLmax > Convert.ToDecimal(dt_export.Rows[i]["chuchengli"].ToString()) ? CCLmax : Convert.ToDecimal(dt_export.Rows[i]["chuchengli"].ToString());

//                }
//                if (dt_export.Rows[i]["mozuli"].ToString() != "")
//                {
//                    intMZL += 1;
//                    decMZL += Convert.ToDecimal(dt_export.Rows[i]["mozuli"].ToString());
//                    MZLmax = MZLmax > Convert.ToDecimal(dt_export.Rows[i]["mozuli"].ToString()) ? MZLmax : Convert.ToDecimal(dt_export.Rows[i]["mozuli"].ToString());
//                }
//            }
//            decimal CCLavg = intCCL == 0 ? 0 : decCCL / intCCL;
//            decimal MZLavg = intMZL == 0 ? 0 : decMZL / intMZL;
//            decimal GZZLmax = 0;
//            decimal GZZLmin = 0;
//            decimal GZZLavg = 0;
//            string SensorNo = "";
//            string distance = "";
//            dte += " 23:59:59";
//            string sqlgzzl = @"select max(pressure1) maxpre,min(pressure1) minpre,max(pressure2) maxpre2,min(pressure2) minpre2,avg(pressure1+pressure2)/2 avgpre3 from pressuredata
//where areaName='" + cequ + "' and FaceName = '" + gzm + "' and SensorNo = (select SensorNo from PreSenInfo where areaName = '" + cequ + "' and FaceName='" + gzm + "' and BracketNo = '" + zjbh + "') and time between '" + dts + "' and '" + dte + "' and (Pressure1>=" + CCL + " or Pressure2>=" + CCL + ") ";
//            DataSet dsgzzl = DB.ExecuteSqlDataSet(sqlgzzl, null);
//            if (dsgzzl.Tables[0].Rows.Count > 0)
//            {
//                string m1 = dsgzzl.Tables[0].Rows[0]["maxpre"].ToString() == "" ? "0" : dsgzzl.Tables[0].Rows[0]["maxpre"].ToString();
//                decimal maxpre = Convert.ToDecimal(m1);
//                string m2 = dsgzzl.Tables[0].Rows[0]["maxpre2"].ToString() == "" ? "0" : dsgzzl.Tables[0].Rows[0]["maxpre2"].ToString();
//                decimal maxpre2 = Convert.ToDecimal(m2);
//                string m3 = dsgzzl.Tables[0].Rows[0]["avgpre3"].ToString() == "" ? "0" : dsgzzl.Tables[0].Rows[0]["avgpre3"].ToString();
//                decimal avgpre3 = Convert.ToDecimal(m3);
//                GZZLmax = maxpre > maxpre2 ? maxpre : maxpre2;
//                GZZLavg = avgpre3;
//                string m4 = dsgzzl.Tables[0].Rows[0]["minpre"].ToString() == "" ? "0" : dsgzzl.Tables[0].Rows[0]["minpre"].ToString();
//                decimal minpre = Convert.ToDecimal(m4);
//                string m5 = dsgzzl.Tables[0].Rows[0]["minpre2"].ToString() == "" ? "0" : dsgzzl.Tables[0].Rows[0]["minpre2"].ToString();
//                decimal minpre2 = Convert.ToDecimal(m5);
//                GZZLmin = minpre < minpre2 ? minpre : minpre2;

//            }
//            sqlgzzl = "select SensorNo,distance from PreSenInfo where areaName = '" + cequ + "' and FaceName='" + gzm + "' and BracketNo = '" + zjbh + "'";
//            dsgzzl = DB.ExecuteSqlDataSet(sqlgzzl, null);
//            if (dsgzzl.Tables[0].Rows.Count > 0)
//            {
//                SensorNo = dsgzzl.Tables[0].Rows[0]["SensorNo"].ToString();
//                distance = dsgzzl.Tables[0].Rows[0]["distance"].ToString();
//            }
//            sqlgzzl = "insert into PreReport (areaName,faceName,sensorNo,bracketNo,distance,ZLmax,ZLavg,CCLmax,CCLavg,MZLmax,MZLavg,reportDate,zlmin) values('" + cequ + "','" + gzm + "','" + SensorNo + "','" + zjbh + "','" + distance + "','" + GZZLmax + "','" + GZZLavg + "','" + CCLmax + "','" + CCLavg + "','" + MZLmax + "','" + MZLavg + "','" + dts + "','" + GZZLmin + "')";
//            DB.ExecuteSql(sqlgzzl, null);
//        }
    }