Ejemplo n.º 1
0
        /// <summary>
        /// 用ASM对象插入或更新条检测数据
        /// </summary>
        /// <param name="asm">ASM</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_ASM(ASM asm)
        {
            string sqli = "insert into asm(CLID,CLPH,CO25CLZ,CO25XZ,CO25PD,HC25CLZ,HC25XZ,HC25PD,NOX25CLZ,NOX25XZ,NOX25PD,CO40CLZ,CO40XZ,CO40PD,HC40CLZ,HC40XZ,HC40PD,NOX40CLZ,NOX40XZ,NOX40PD,ZHPD,JCRQ,WD,SD,DQY,SBMC,SBXH,SBZZC,CGJXH,CGJBH,CGJZZC,FXYXH,FXYBH,FXYZZC,FDJZS5025,FDJYW5025,FDJZS2540,FDJYW2540,JCBGBH,SHY,SYNCHDATE,YW,JCKSSJ,JCJSSJ,LAMBDA5025,LAMBDA2540,CO25025,O25025,CO22540,O22540,JYLSH,JYCS,JZZGL5025,JZZGL2540,SBRZBM) values(@CLID,@CLPH,@CO25CLZ,@CO25XZ,@CO25PD,@HC25CLZ,@HC25XZ,@HC25PD,@NOX25CLZ,@NOX25XZ,@NOX25PD,@CO40CLZ,@CO40XZ,@CO40PD,@HC40CLZ,@HC40XZ,@HC40PD,@NOX40CLZ,@NOX40XZ,@NOX40PD,@ZHPD,@JCRQ,@WD,@SD,@DQY,@SBMC,@SBXH,@SBZZC,@CGJXH,@CGJBH,@CGJZZC,@FXYXH,@FXYBH,@FXYZZC,@FDJZS5025,@FDJYW5025,@FDJZS2540,@FDJYW2540,@JCBGBH,@SHY,@SYNCHDATE,@YW,@JCKSSJ,@JCJSSJ,@LAMBDA5025,@LAMBDA2540,@CO25025,@O25025,@CO22540,@O22540,@JYLSH,@JYCS,@JZZGL5025,@JZZGL2540,@SBRZBM)";
            string sqlu = "update asm set CLPH=@CLPH,CO25CLZ=@CO25CLZ,CO25XZ=@CO25XZ,CO25PD=@CO25PD,HC25CLZ=@HC25CLZ,HC25XZ=@HC25XZ,HC25PD=@HC25PD,NOX25CLZ=@NOX25CLZ,NOX25XZ=@NOX25XZ,NOX25PD=@NOX25PD,CO40CLZ=@CO40CLZ,CO40XZ=@CO40XZ,CO40PD=@CO40PD,HC40CLZ=@HC40CLZ,HC40XZ=@HC40XZ,HC40PD=@HC40PD,NOX40CLZ=@NOX40CLZ,NOX40XZ=@NOX40XZ,NOX40PD=@NOX40PD,ZHPD=@ZHPD,JCRQ=@JCRQ,WD=@WD,SD=@SD,DQY=@DQY,SBMC=@SBMC,SBXH=@SBXH,SBZZC=@SBZZC,CGJXH=@CGJXH,CGJBH=@CGJBH,CGJZZC=@CGJZZC,FXYXH=@FXYXH,FXYBH=@FXYBH,FXYZZC=@FXYZZC,FDJZS5025=@FDJZS5025,FDJYW5025=@FDJYW5025,FDJZS2540=@FDJZS2540,FDJYW2540=@FDJYW2540,JCBGBH=@JCBGBH,SHY=@SHY,SYNCHDATE=@SYNCHDATE,YW=@YW,JCKSSJ=@JCKSSJ,JCJSSJ=@JCJSSJ,LAMBDA5025=@LAMBDA5025,LAMBDA2540=@LAMBDA2540,CO25025=@CO25025,O25025=@O25025,CO22540=@CO22540,O22540=@O22540,JYLSH=@JYLSH,JYCS=@JYCS,JZZGL5025=@JZZGL5025,JZZGL2540=@JZZGL2540,SBRZBM=@SBRZBM where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID",       asm.CLID),             //1
                new SqlParameter("@CLPH",       asm.CLPH),             //1
                new SqlParameter("@CO25CLZ",    asm.CO25CLZ),
                new SqlParameter("@CO25XZ",     asm.CO25XZ),
                new SqlParameter("@CO25PD",     asm.CO25PD),
                new SqlParameter("@HC25CLZ",    asm.HC25CLZ),               //6
                new SqlParameter("@HC25XZ",     asm.HC25XZ),
                new SqlParameter("@HC25PD",     asm.HC25PD),
                new SqlParameter("@NOX25CLZ",   asm.NOX25CLZ),
                new SqlParameter("@NOX25XZ",    asm.NOX25XZ),
                new SqlParameter("@NOX25PD",    asm.NOX25PD),               //11
                new SqlParameter("@CO40CLZ",    asm.CO40CLZ),
                new SqlParameter("@CO40XZ",     asm.CO40XZ),
                new SqlParameter("@CO40PD",     asm.CO40PD),
                new SqlParameter("@HC40CLZ",    asm.HC40CLZ),               //6
                new SqlParameter("@HC40XZ",     asm.HC40XZ),
                new SqlParameter("@HC40PD",     asm.HC40PD),
                new SqlParameter("@NOX40CLZ",   asm.NOX40CLZ),
                new SqlParameter("@NOX40XZ",    asm.NOX40XZ),
                new SqlParameter("@NOX40PD",    asm.NOX40PD),               //11
                new SqlParameter("@ZHPD",       asm.ZHPD),
                new SqlParameter("@JCRQ",       asm.JCRQ),
                new SqlParameter("@WD",         asm.WD),
                new SqlParameter("@SD",         asm.SD),
                new SqlParameter("@DQY",        asm.DQY),           //16
                new SqlParameter("@SBMC",       asm.SBMC),
                new SqlParameter("@SBXH",       asm.SBXH),
                new SqlParameter("@SBZZC",      asm.SBZZC),
                new SqlParameter("@CGJXH",      asm.CGJXH),
                new SqlParameter("@CGJBH",      asm.CGJBH),             //21
                new SqlParameter("@CGJZZC",     asm.CGJZZC),
                new SqlParameter("@FXYXH",      asm.FXYXH),
                new SqlParameter("@FXYBH",      asm.FXYBH),
                new SqlParameter("@FXYZZC",     asm.FXYZZC),
                new SqlParameter("@FDJZS5025",  asm.FDJZS5025),
                new SqlParameter("@FDJYW5025",  asm.FDJYW5025),                 //21
                new SqlParameter("@FDJZS2540",  asm.FDJZS2540),
                new SqlParameter("@FDJYW2540",  asm.FDJYW2540),
                new SqlParameter("@JCBGBH",     asm.JCBGBH),
                new SqlParameter("@SHY",        asm.SHY),           //21
                new SqlParameter("@SYNCHDATE",  asm.SYNCHDATE),
                new SqlParameter("@YW",         asm.YW),
                new SqlParameter("@JCKSSJ",     asm.JCKSSJ),
                new SqlParameter("@JCJSSJ",     asm.JCJSSJ),
                new SqlParameter("@LAMBDA5025", asm.LAMBDA5025),
                new SqlParameter("@LAMBDA2540", asm.LAMBDA2540),
                new SqlParameter("@CO25025",    asm.CO25025),
                new SqlParameter("@O25025",     asm.O25025),
                new SqlParameter("@CO22540",    asm.CO22540),
                new SqlParameter("@O22540",     asm.O22540),
                new SqlParameter("@JYLSH",      asm.JYLSH),
                new SqlParameter("@JYCS",       asm.JYCS),
                new SqlParameter("@JZZGL5025",  asm.JZZGL5025),
                new SqlParameter("@JZZGL2540",  asm.JZZGL2540),
                new SqlParameter("@SBRZBM",     asm.SBRZBM)
            };
            try
            {
                if (Have_ASM(asm.CLID))
                {
                    ini.INIIO.saveLogInf("Save_ASM()过程中发现ID号重复:" + asm.CLID);
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        ini.INIIO.saveLogInf("更新结果成功,ID号:" + asm.CLID);
                        return(2);
                    }
                    else
                    {
                        ini.INIIO.saveLogInf("更新结果失败,ID号:" + asm.CLID);
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        ini.INIIO.saveLogInf("Save_ASM()成功,ID号:" + asm.CLID);
                        return(1);
                    }
                    else
                    {
                        ini.INIIO.saveLogInf("Save_ASM()失败,ID号:" + asm.CLID);
                        return(0);
                    }
                }
            }
            catch (Exception er)
            {
                ini.INIIO.saveLogInf("Save_ASM()过程中出现异常:" + er.Message);
                throw;
            }
        }
Ejemplo n.º 2
0
        public bool saveInertnessDataByIni(inertness model, string stationid, string lineid, DateTime bdrq)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [惯量测试] (");
            strSql.Append("STATIONID,");  //=@PZLX,");1
            strSql.Append("LINEID,");     //=@JCCLPH,");2
            strSql.Append("T1POWER,");    //=@CLXHBH,");3
            strSql.Append("T2POWER,");    //=@CLXHBH,");3
            strSql.Append("STARTSPEED,"); //=@JCCS,");4
            strSql.Append("ENDSPEED,");   //=@CCRQ,");5
            strSql.Append("ACD1_1,");     //=@DJRQ,"); 6
            strSql.Append("ACD1_2,");     //=@FDJH,");7
            strSql.Append("ACD1_3,");     //=@CJH,");8
            strSql.Append("ACD1,");       //=@CZ,");9
            strSql.Append("ACD2_1,");     //=@DJRQ,"); 6
            strSql.Append("ACD2_2,");     //=@FDJH,");7
            strSql.Append("ACD2_3,");     //=@CJH,");8
            strSql.Append("ACD2,");       //=@CZ,");9
            strSql.Append("DIW_1,");      //=@DJRQ,"); 6
            strSql.Append("DIW_2,");      //=@FDJH,");7
            strSql.Append("DIW_3,");      //=@CJH,");8
            strSql.Append("DIW,");        //=@CZ,");9
            strSql.Append("DIW_BC,");     //=@CZDH,");10
            strSql.Append("DIW_SC,");     //=@CZDZ,");11
            strSql.Append("WC,");         //=@CZ,");9
            strSql.Append("PD,");         //=@CZDH,");10
            strSql.Append("HXSJ,");       //=@CZDZ,");11
            strSql.Append("BZ,");         //=@LCBDS,");12
            strSql.Append("BDJG,");       //=@HBBZ,");13
            strSql.Append("BDRQ) ");      //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@T1POWER,@T2POWER,@STARTSPEED,@ENDSPEED,@ACD1_1,@ACD1_2,@ACD1_3,@ACD1,@ACD2_1,@ACD2_2,@ACD2_3,@ACD2,@DIW_1,@DIW_2,@DIW_3,@DIW,@DIW_BC,@DIW_SC,@WC,@PD,@HXSJ,@BZ,@BDJG,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID",  SqlDbType.VarChar,  50),
                new SqlParameter("@LINEID",     SqlDbType.VarChar,  50),
                new SqlParameter("@T1POWER",    SqlDbType.VarChar,  50),
                new SqlParameter("@T2POWER",    SqlDbType.VarChar, 100),
                new SqlParameter("@STARTSPEED", SqlDbType.VarChar,  50),
                new SqlParameter("@ENDSPEED",   SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1_1",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1_2",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1_3",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1",       SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2_1",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2_2",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2_3",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2",       SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_1",      SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_2",      SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_3",      SqlDbType.VarChar,  50),
                new SqlParameter("@DIW",        SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_BC",     SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_SC",     SqlDbType.VarChar,  50),
                new SqlParameter("@WC",         SqlDbType.VarChar,  50),
                new SqlParameter("@PD",         SqlDbType.VarChar,  50),
                new SqlParameter("@HXSJ",       SqlDbType.VarChar,  50),
                new SqlParameter("@BZ",         SqlDbType.VarChar,  50),
                new SqlParameter("@BDJG",       SqlDbType.VarChar,  50),
                new SqlParameter("@BDRQ",       SqlDbType.DateTime)
            };
            parameters[i++].Value = stationid;
            parameters[i++].Value = lineid;
            parameters[i++].Value = model.T1power;
            parameters[i++].Value = model.T2power;
            parameters[i++].Value = model.StartSpeed;
            parameters[i++].Value = model.EndSpeed;
            parameters[i++].Value = model.Acd1_1;
            parameters[i++].Value = model.Acd1_2;
            parameters[i++].Value = model.Acd1_3;
            parameters[i++].Value = model.Acd1;
            parameters[i++].Value = model.Acd2_1;
            parameters[i++].Value = model.Acd2_2;
            parameters[i++].Value = model.Acd2_3;
            parameters[i++].Value = model.Acd2;
            parameters[i++].Value = model.Diw_1;
            parameters[i++].Value = model.Diw_2;
            parameters[i++].Value = model.Diw_3;
            parameters[i++].Value = model.Diw;
            parameters[i++].Value = model.Diw_bc;
            parameters[i++].Value = model.Diw_sc;
            parameters[i++].Value = model.Wc;
            parameters[i++].Value = model.Pd;
            parameters[i++].Value = model.Hxsj;
            parameters[i++].Value = model.Bz;
            parameters[i++].Value = model.Bdjg;
            parameters[i++].Value = bdrq;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 用检测编号和次数查询一条检测数据
        /// </summary>
        /// <param name="jcbh">检测编号</param>
        /// <param name="jccs">检测次数</param>
        /// <returns>SDS检测数据Model</returns>
        public SDS Get_SDS(string CLID)
        {
            DateTime a;
            string   sql = "select * from SDS where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID", CLID)
            };
            try
            {
                SDS       SDS = new SDS();
                DataTable dt  = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    SDS.CLID         = dt.Rows[0]["CLID"].ToString();   //1
                    SDS.JCBGBH       = dt.Rows[0]["JCBGBH"].ToString(); //1
                    SDS.CLPH         = dt.Rows[0]["CLPH"].ToString();
                    SDS.COLOWCLZ     = dt.Rows[0]["COLOWCLZ"].ToString();
                    SDS.COLOWXZ      = dt.Rows[0]["COLOWXZ"].ToString();
                    SDS.HCLOWCLZ     = dt.Rows[0]["HCLOWCLZ"].ToString();
                    SDS.HCLOWXZ      = dt.Rows[0]["HCLOWXZ"].ToString();//6
                    SDS.COHIGHCLZ    = dt.Rows[0]["COHIGHCLZ"].ToString();
                    SDS.COHIGHXZ     = dt.Rows[0]["COHIGHXZ"].ToString();
                    SDS.HCHIGHCLZ    = dt.Rows[0]["HCHIGHCLZ"].ToString();
                    SDS.HCHIGHXZ     = dt.Rows[0]["HCHIGHXZ"].ToString();
                    SDS.LAMDAHIGHCLZ = dt.Rows[0]["LAMDAHIGHCLZ"].ToString(); //11
                    SDS.LAMDAHIGHXZ  = dt.Rows[0]["LAMDAHIGHXZ"].ToString();  //11
                    SDS.LAMDAHIGHPD  = dt.Rows[0]["LAMDAHIGHPD"].ToString();  //11
                    SDS.LOWPD        = dt.Rows[0]["LOWPD"].ToString();        //11
                    SDS.HIGHPD       = dt.Rows[0]["HIGHPD"].ToString();       //11
                    SDS.ZHPD         = dt.Rows[0]["ZHPD"].ToString();
                    DateTime.TryParse(dt.Rows[0]["JCRQ"].ToString(), out a);
                    if (a != null)
                    {
                        SDS.JCRQ = a;
                    }
                    else
                    {
                        SDS.JCRQ = DateTime.Today;
                    }
                    SDS.WD     = dt.Rows[0]["WD"].ToString();
                    SDS.SD     = dt.Rows[0]["SD"].ToString();
                    SDS.DQY    = dt.Rows[0]["DQY"].ToString();//16
                    SDS.SBMC   = dt.Rows[0]["SBMC"].ToString();
                    SDS.SBXH   = dt.Rows[0]["SBXH"].ToString();
                    SDS.SBZZC  = dt.Rows[0]["SBZZC"].ToString();
                    SDS.ZSJXH  = dt.Rows[0]["ZSJXH"].ToString();
                    SDS.ZSJBH  = dt.Rows[0]["ZSJBH"].ToString();//21
                    SDS.ZSJZZC = dt.Rows[0]["ZSJZZC"].ToString();
                    SDS.FXYXH  = dt.Rows[0]["FXYXH"].ToString();
                    SDS.FXYBH  = dt.Rows[0]["FXYBH"].ToString();
                    SDS.FXYZZC = dt.Rows[0]["FXYZZC"].ToString();

                    SDS.COLOWPD  = dt.Rows[0]["COLOWPD"].ToString();
                    SDS.HCLOWPD  = dt.Rows[0]["HCLOWPD"].ToString();
                    SDS.ZSLOW    = dt.Rows[0]["ZSLOW"].ToString();
                    SDS.JYWDLOW  = dt.Rows[0]["JYWDLOW"].ToString();
                    SDS.COHIGHPD = dt.Rows[0]["COHIGHPD"].ToString();
                    SDS.HCHIGHPD = dt.Rows[0]["HCHIGHPD"].ToString();
                    SDS.ZSHIGH   = dt.Rows[0]["ZSHIGH"].ToString();
                    SDS.JYWDHIGH = dt.Rows[0]["JYWDHIGH"].ToString();

                    SDS.SHY        = dt.Rows[0]["SHY"].ToString();
                    SDS.SYNCHDATE  = dt.Rows[0]["SYNCHDATE"].ToString();
                    SDS.YW         = dt.Rows[0]["YW"].ToString();
                    SDS.GLKQXSSX   = dt.Rows[0]["GLKQXSSX"].ToString();
                    SDS.GLKQXSXX   = dt.Rows[0]["GLKQXSXX"].ToString();
                    SDS.JCKSSJ     = dt.Rows[0]["JCKSSJ"].ToString();
                    SDS.JCJSSJ     = dt.Rows[0]["JCJSSJ"].ToString();
                    SDS.CO2HIGH    = dt.Rows[0]["CO2HIGH"].ToString();
                    SDS.O2HIGH     = dt.Rows[0]["O2HIGH"].ToString();
                    SDS.CO2LOW     = dt.Rows[0]["CO2LOW"].ToString();
                    SDS.O2LOW      = dt.Rows[0]["O2LOW"].ToString();
                    SDS.COLOWXXZ   = dt.Rows[0]["COLOWXXZ"].ToString();
                    SDS.COHIGHXXZ  = dt.Rows[0]["COHIGHXXZ"].ToString();
                    SDS.COLOWXYZ   = dt.Rows[0]["COLOWXYZ"].ToString();
                    SDS.COHIGHXYZ  = dt.Rows[0]["COHIGHXYZ"].ToString();
                    SDS.CO2LOWXYZ  = dt.Rows[0]["CO2LOWXYZ"].ToString();
                    SDS.CO2HIGHXYZ = dt.Rows[0]["CO2HIGHXYZ"].ToString();
                    SDS.HCLOWXYZ   = dt.Rows[0]["HCLOWXYZ"].ToString();
                    SDS.HCHIGHXYZ  = dt.Rows[0]["HCHIGHXYZ"].ToString();
                }
                else
                {
                    SDS.CLID = "-2";
                }
                return(SDS);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 4
0
        public bool saveAnalysisData(ANALYSISMETER model)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [废气仪标定] (");
            strSql.Append("STATIONID,"); //=@PZLX,");1
            strSql.Append("LINEID,");    //=@JCCLPH,");2
            strSql.Append("CO2BZ,");     //=@CLXHBH,");3
            strSql.Append("CO2CLZ,");    //=@CLXHBH,");3
            strSql.Append("COBZ,");      //=@JCCS,");4
            strSql.Append("COCLZ,");     //=@CCRQ,");5
            strSql.Append("HCBZ,");      //=@DJRQ,"); 6
            strSql.Append("HCCLZ,");     //=@FDJH,");7
            strSql.Append("NOBZ,");      //=@CJH,");8
            strSql.Append("NOCLZ,");     //=@CZ,");9
            strSql.Append("JZDS,");      //=@CZDH,");10
            strSql.Append("GDJZ,");      //=@CZDZ,");11
            strSql.Append("BZSM,");      //=@LCBDS,");12
            strSql.Append("BDJG,");      //=@HBBZ,");13
            strSql.Append("BDRQ) ");     //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@CO2BZ,@CO2CLZ,@COBZ,@COCLZ,@HCBZ,@HCCLZ,@NOBZ,@NOCLZ,@JZDS,@GDJZ,@BZSM,@BDJG,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID", SqlDbType.VarChar,  50),
                new SqlParameter("@LINEID",    SqlDbType.VarChar,  50),
                new SqlParameter("@CO2BZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@CO2CLZ",    SqlDbType.VarChar, 100),
                new SqlParameter("@COBZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@COCLZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@HCBZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@HCCLZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@NOBZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@NOCLZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@JZDS",      SqlDbType.VarChar,  50),
                new SqlParameter("@GDJZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@BZSM",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDJG",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDRQ",      SqlDbType.DateTime)
            };
            parameters[i++].Value = model.STATIONID;
            parameters[i++].Value = model.LINEID;
            parameters[i++].Value = model.CO2BZ;
            parameters[i++].Value = model.CO2CLZ;
            parameters[i++].Value = model.COBZ;
            parameters[i++].Value = model.COCLZ;
            parameters[i++].Value = model.HCBZ;
            parameters[i++].Value = model.HCCLZ;
            parameters[i++].Value = model.NOBZ;
            parameters[i++].Value = model.NOCLZ;
            parameters[i++].Value = model.JZDS;
            parameters[i++].Value = model.GDJZ;
            parameters[i++].Value = model.BZSM;
            parameters[i++].Value = model.BDJG;
            parameters[i++].Value = model.BDRQ;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 5
0
        public bool saveGlideDataByIni(glide model, string stationid, string lineid, DateTime bdrq)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [加载滑行试验] (");
            strSql.Append("STATIONID,"); //=@PZLX,");1
            strSql.Append("LINEID,");    //=@JCCLPH,");2
            strSql.Append("HXQJ,");      //=@CLXHBH,");3
            strSql.Append("QJMYSD,");    //=@CLXHBH,");3
            strSql.Append("PLHP,");      //=@JCCS,");4
            strSql.Append("CCDT,");      //=@CCRQ,");5
            strSql.Append("ACDT,");      //=@DJRQ,"); 6
            strSql.Append("WC,");        //=@FDJH,");7
            strSql.Append("JZSDGL,");    //=@CJH,");8
            strSql.Append("BZSM,");      //=@LCBDS,");12
            strSql.Append("BDJG,");      //=@HBBZ,");13
            strSql.Append("BDRQ) ");     //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@HXQJ,@QJMYSD,@PLHP,@CCDT,@ACDT,@WC,@JZSDGL,@BZSM,@BDJG,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID", SqlDbType.VarChar,  50),
                new SqlParameter("@LINEID",    SqlDbType.VarChar,  50),
                new SqlParameter("@HXQJ",      SqlDbType.VarChar,  50),
                new SqlParameter("@QJMYSD",    SqlDbType.VarChar, 100),
                new SqlParameter("@PLHP",      SqlDbType.VarChar,  50),
                new SqlParameter("@CCDT",      SqlDbType.VarChar,  50),
                new SqlParameter("@ACDT",      SqlDbType.VarChar,  50),
                new SqlParameter("@WC",        SqlDbType.VarChar,  50),
                new SqlParameter("@JZSDGL",    SqlDbType.VarChar,  50),
                new SqlParameter("@BZSM",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDJG",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDRQ",      SqlDbType.DateTime)
            };
            parameters[i++].Value = stationid;
            parameters[i++].Value = lineid;
            parameters[i++].Value = model.Hxqj;
            parameters[i++].Value = model.Qjmysd;
            parameters[i++].Value = model.Plhp;
            parameters[i++].Value = model.Ccdt;
            parameters[i++].Value = model.Acdt;
            parameters[i++].Value = model.Wc;
            parameters[i++].Value = model.Jzsdgl;
            parameters[i++].Value = model.Bzsm;
            parameters[i++].Value = model.Bdjg;
            parameters[i++].Value = bdrq;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public bool savemoneyRecordInf(MONEY model)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [收费记录] (");
            strSql.Append("CLID,");
            strSql.Append("CLHP,");
            strSql.Append("DLSJ,");
            strSql.Append("EXHAUST,");
            strSql.Append("SAFE,");
            strSql.Append("EXHAUSTSTANDARDFY,");
            strSql.Append("SAFESTANDARDFY,");
            strSql.Append("EXHAUSTFY,");
            strSql.Append("SAFEFY,");
            strSql.Append("EXHAUSTBZ,");
            strSql.Append("SAFEBZ,");
            strSql.Append("FY,");
            strSql.Append("SKR,");
            strSql.Append("TF,");
            strSql.Append("TFFY,");
            strSql.Append("CZ,");
            strSql.Append("SFSJ)");
            strSql.Append("values (@CLID,@CLHP,@DLSJ,@EXHAUST,@SAFE,@EXHAUSTSTANDARDFY,@SAFESTANDARDFY,@EXHAUSTFY,@SAFEFY,@EXHAUSTBZ,@SAFEBZ,@FY,@SKR,@TF,@TFFY,@CZ,@SFSJ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CLID",              SqlDbType.VarChar,   50),
                new SqlParameter("@CLHP",              SqlDbType.VarChar,   50),
                new SqlParameter("@DLSJ",              SqlDbType.DateTime),
                new SqlParameter("@EXHAUST",           SqlDbType.VarChar,   50),
                new SqlParameter("@SAFE",              SqlDbType.VarChar,   50),
                new SqlParameter("@EXHAUSTSTANDARDFY", SqlDbType.VarChar,   50),
                new SqlParameter("@SAFESTANDARDFY",    SqlDbType.VarChar,   50),
                new SqlParameter("@EXHAUSTFY",         SqlDbType.VarChar,   50),
                new SqlParameter("@SAFEFY",            SqlDbType.VarChar,   50),
                new SqlParameter("@EXHAUSTBZ",         SqlDbType.VarChar,   50),
                new SqlParameter("@SAFEBZ",            SqlDbType.VarChar,   50),
                new SqlParameter("@FY",                SqlDbType.VarChar,   50),
                new SqlParameter("@SKR",               SqlDbType.VarChar,   50),
                new SqlParameter("@TF",                SqlDbType.VarChar,   50),
                new SqlParameter("@TFFY",              SqlDbType.VarChar,   50),
                new SqlParameter("@CZ",                SqlDbType.VarChar,   50),
                new SqlParameter("@SFSJ",              SqlDbType.DateTime)
            };
            parameters[i++].Value = model.CLID;
            parameters[i++].Value = model.CLHP;
            parameters[i++].Value = model.DLSJ;
            parameters[i++].Value = model.EXHAUST;
            parameters[i++].Value = model.SAFE;
            parameters[i++].Value = model.EXHAUSTSTANDARDFY;
            parameters[i++].Value = model.SAFESTANDARDFY;
            parameters[i++].Value = model.EXHAUSTFY;
            parameters[i++].Value = model.SAFEFY;
            parameters[i++].Value = model.EXHAUSTBZ;
            parameters[i++].Value = model.SAFEBZ;
            parameters[i++].Value = model.FY;
            parameters[i++].Value = model.SKR;
            parameters[i++].Value = model.TF;
            parameters[i++].Value = model.TFFY;
            parameters[i++].Value = model.CZ;
            parameters[i++].Value = model.SFSJ;
            try
            {
                if (checkMoneyRecordIsAlive(model.CLID))
                {
                    if (updateMoneyRecordInf(model))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 7
0
        public bool saveSdDataByIni(sdbddata model, string stationid, string lineid, DateTime bdrq)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [速度标定] (");
            strSql.Append("STATIONID,"); //=@PZLX,");1
            strSql.Append("LINEID,");    //=@JCCLPH,");2
            strSql.Append("BZ1,");       //=@CLXHBH,");3
            strSql.Append("CLZ1,");      //=@CLXHBH,");3
            strSql.Append("WC1,");       //=@JCCS,");4
            strSql.Append("BZ2,");       //=@CLXHBH,");3
            strSql.Append("CLZ2,");      //=@CLXHBH,");3
            strSql.Append("WC2,");       //=@JCCS,");4
            strSql.Append("BZ3,");       //=@CLXHBH,");3
            strSql.Append("CLZ3,");      //=@CLXHBH,");3
            strSql.Append("WC3,");       //=@JCCS,");4
            strSql.Append("BDDS,");      //=@CCRQ,");5
            strSql.Append("BDJG,");      //=@DJRQ,"); 6
            strSql.Append("BZSM,");      //=@FDJH,");7
            strSql.Append("BDRQ) ");     //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@BZ1,@CLZ1,@WC1,@BZ2,@CLZ2,@WC2,@BZ3,@CLZ3,@WC3,@BDDS,@BDJG,@BZSM,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID", SqlDbType.VarChar, 50),
                new SqlParameter("@LINEID",    SqlDbType.VarChar, 50),
                new SqlParameter("@BZ1",       SqlDbType.VarChar, 50),
                new SqlParameter("@CLZ1",      SqlDbType.VarChar, 50),
                new SqlParameter("@WC1",       SqlDbType.VarChar, 50),
                new SqlParameter("@BZ2",       SqlDbType.VarChar, 50),
                new SqlParameter("@CLZ2",      SqlDbType.VarChar, 50),
                new SqlParameter("@WC2",       SqlDbType.VarChar, 50),
                new SqlParameter("@BZ3",       SqlDbType.VarChar, 50),
                new SqlParameter("@CLZ3",      SqlDbType.VarChar, 50),
                new SqlParameter("@WC3",       SqlDbType.VarChar, 50),
                new SqlParameter("@BDDS",      SqlDbType.VarChar, 50),
                new SqlParameter("@BDJG",      SqlDbType.VarChar, 50),
                new SqlParameter("@BZSM",      SqlDbType.VarChar, 50),
                new SqlParameter("@BDRQ",      SqlDbType.DateTime)
            };
            parameters[i++].Value = stationid;
            parameters[i++].Value = lineid;
            parameters[i++].Value = model.Bz1;
            parameters[i++].Value = model.Clz1;
            parameters[i++].Value = model.Wc1;
            parameters[i++].Value = model.Bz2;
            parameters[i++].Value = model.Clz2;
            parameters[i++].Value = model.Wc2;
            parameters[i++].Value = model.Bz3;
            parameters[i++].Value = model.Clz3;
            parameters[i++].Value = model.Wc3;
            parameters[i++].Value = model.Bdds;
            parameters[i++].Value = model.Bdjg;
            parameters[i++].Value = model.Bzsm;
            parameters[i++].Value = bdrq;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 用ASM对象插入或更新条检测数据
        /// </summary>
        /// <param name="asm">ASM</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_VMAS(VMAS vmas)
        {
            string sqli = "insert into vmas(CSLJCCSJ,XSLC,JYLSH,JYCS,SBRZBM,CLID,CLPH,COZL,COXZ,COPD,NOXZL,NOXXZ,NOXPD,HCZL,HCXZ,HCPD,ZHPD,JCRQ,WD,SD,DQY,SBMC,SBXH,SBZZC,CGJXH,CGJBH,CGJZZC,FXYXH,FXYBH,FXYZZC,LLJXH,LLJBH,LLJZZC,BEFORE) values(@CSLJCCSJ,@XSLC,@JYLSH,@JYCS,@SBRZBM,@CLID,@CLPH,@COZL,@COXZ,@COPD,@NOXZL,@NOXXZ,@NOXPD,@HCZL,@HCXZ,@HCPD,@ZHPD,@JCRQ,@WD,@SD,@DQY,@SBMC,@SBXH,@SBZZC,@CGJXH,@CGJBH,@CGJZZC,@FXYXH,@FXYBH,@FXYZZC,@LLJXH,@LLJBH,@LLJZZC,@BEFORE)";
            string sqlu = "update vmas set CSLJCCSJ=@CSLJCCSJ,XSLC=@XSLC,JYLSH=@JYLSH,JYCS=@JYCS,SBRZBM=@SBRZBM,CLPH=@CLPH,COZL=@COZL,COXZ=@COXZ,COPD=@COPD,NOXZL=@NOXZL,NOXXZ=@NOXXZ,NOXPD=@NOXPD,HCZL=@HCZL,HCXZ=@HCXZ,HCPD=@HCPD,ZHPD=@ZHPD,JCRQ=@JCRQ,WD=@WD,SD=@SD,DQY=@DQY,SBMC=@SBMC,SBXH=@SBXH,SBZZC=@SBZZC,CGJXH=@CGJXH,CGJBH=@CGJBH,CGJZZC=@CGJZZC,FXYXH=@FXYXH,FXYBH=@FXYBH,FXYZZC=@FXYZZC,LLJXH=@LLJXH,LLJBH=@LLJBH,LLJZZC=@LLJZZC,BEFORE=@BEFORE where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CSLJCCSJ", vmas.CSLJCCSJ),
                new SqlParameter("@XSLC",     vmas.XSLC),
                new SqlParameter("@JYLSH",    vmas.JYLSH),
                new SqlParameter("@JYCS",     vmas.JYCS),
                new SqlParameter("@SBRZBM",   vmas.SBRZBM),
                new SqlParameter("@CLID",     vmas.CLID),               //1
                new SqlParameter("@CLPH",     vmas.CLPH),
                new SqlParameter("@COZL",     vmas.COZL),
                new SqlParameter("@COXZ",     vmas.COXZ),
                new SqlParameter("@COPD",     vmas.COPD),
                new SqlParameter("@NOXZL",    vmas.NOXZL),               //6
                new SqlParameter("@NOXXZ",    vmas.NOXXZ),
                new SqlParameter("@NOXPD",    vmas.NOXPD),
                new SqlParameter("@HCZL",     vmas.HCZL),
                new SqlParameter("@HCXZ",     vmas.HCXZ),
                new SqlParameter("@HCPD",     vmas.HCPD),              //11
                new SqlParameter("@ZHPD",     vmas.ZHPD),
                new SqlParameter("@JCRQ",     vmas.JCRQ),
                new SqlParameter("@WD",       vmas.WD),
                new SqlParameter("@SD",       vmas.SD),
                new SqlParameter("@DQY",      vmas.DQY),             //16
                new SqlParameter("@SBMC",     vmas.SBMC),
                new SqlParameter("@SBXH",     vmas.SBXH),
                new SqlParameter("@SBZZC",    vmas.SBZZC),
                new SqlParameter("@CGJXH",    vmas.CGJXH),
                new SqlParameter("@CGJBH",    vmas.CGJBH),               //21
                new SqlParameter("@CGJZZC",   vmas.CGJZZC),
                new SqlParameter("@FXYXH",    vmas.FXYXH),
                new SqlParameter("@FXYBH",    vmas.FXYBH),
                new SqlParameter("@FXYZZC",   vmas.FXYZZC),                //47
                new SqlParameter("@LLJXH",    vmas.LLJXH),
                new SqlParameter("@LLJBH",    vmas.LLJBH),
                new SqlParameter("@LLJZZC",   vmas.LLJZZC),                //47
                new SqlParameter("@BEFORE",   vmas.BEFORE)
            };
            try
            {
                if (Have_VMAS(vmas.CLID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 用检测编号和次数查询一条检测数据
        /// </summary>
        /// <param name="jcbh">检测编号</param>
        /// <param name="jccs">检测次数</param>
        /// <returns>JZJS检测数据Model</returns>
        public JZJS Get_JZJS(string CLID)
        {
            DateTime a;
            string   sql = "select * from JZJS where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID", CLID)
            };
            try
            {
                JZJS      JZJS = new JZJS();
                DataTable dt   = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    JZJS.CLID    = dt.Rows[0]["CLID"].ToString();//1
                    JZJS.CLPH    = dt.Rows[0]["CLPH"].ToString();
                    JZJS.HK      = dt.Rows[0]["HK"].ToString();
                    JZJS.NK      = dt.Rows[0]["NK"].ToString();
                    JZJS.EK      = dt.Rows[0]["EK"].ToString();
                    JZJS.YDXZ    = dt.Rows[0]["YDXZ"].ToString();//6
                    JZJS.HKPD    = dt.Rows[0]["HKPD"].ToString();
                    JZJS.NKPD    = dt.Rows[0]["NKPD"].ToString();
                    JZJS.EKPD    = dt.Rows[0]["EKPD"].ToString();
                    JZJS.MAXLBGL = dt.Rows[0]["MAXLBGL"].ToString();
                    JZJS.GLXZ    = dt.Rows[0]["GLXZ"].ToString();
                    JZJS.GLPD    = dt.Rows[0]["GLPD"].ToString();
                    JZJS.MAXLBZS = dt.Rows[0]["MAXLBZS"].ToString(); //11
                    JZJS.ZSXZ    = dt.Rows[0]["ZSXZ"].ToString();    //11
                    JZJS.ZSPD    = dt.Rows[0]["ZSPD"].ToString();    //11
                    JZJS.ZHPD    = dt.Rows[0]["ZHPD"].ToString();
                    DateTime.TryParse(dt.Rows[0]["JCRQ"].ToString(), out a);
                    if (a != null)
                    {
                        JZJS.JCRQ = a;
                    }
                    else
                    {
                        JZJS.JCRQ = DateTime.Today;
                    }
                    JZJS.WD     = dt.Rows[0]["WD"].ToString();
                    JZJS.SD     = dt.Rows[0]["SD"].ToString();
                    JZJS.DQY    = dt.Rows[0]["DQY"].ToString();//16
                    JZJS.SBMC   = dt.Rows[0]["SBMC"].ToString();
                    JZJS.SBXH   = dt.Rows[0]["SBXH"].ToString();
                    JZJS.SBZZC  = dt.Rows[0]["SBZZC"].ToString();
                    JZJS.CGJXH  = dt.Rows[0]["CGJXH"].ToString();
                    JZJS.CGJBH  = dt.Rows[0]["CGJBH"].ToString();//21
                    JZJS.CGJZZC = dt.Rows[0]["CGJZZC"].ToString();
                    JZJS.YDJXH  = dt.Rows[0]["YDJXH"].ToString();
                    JZJS.YDJBH  = dt.Rows[0]["YDJBH"].ToString();
                    JZJS.YDJZZC = dt.Rows[0]["YDJZZC"].ToString();
                    JZJS.ZSJXH  = dt.Rows[0]["ZSJXH"].ToString();
                    JZJS.ZSJBH  = dt.Rows[0]["ZSJBH"].ToString();
                    JZJS.ZSJZZC = dt.Rows[0]["ZSJZZC"].ToString();
                }
                else
                {
                    JZJS.CLID = "-2";
                }
                return(JZJS);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 10
0
        public VMASseconds Get_VMASDataSeconds(string clhp, DateTime jcsj)
        {
            DateTime a;
            string   sql = "select * from VMAS_DATASECONDS where clhp=@clhp and convert(varchar(50),jcsj,120)=convert(varchar(50),@jcsj,120)";

            SqlParameter[] spr =
            {
                new SqlParameter("@clhp", clhp),
                new SqlParameter("@jcsj", jcsj.ToString("yyyy-MM-dd HH:mm:ss"))
            };
            try
            {
                VMASseconds asm = new VMASseconds();
                DataTable   dt  = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    asm.CLID   = dt.Rows[0]["CLID"].ToString();//1
                    asm.CLHP   = dt.Rows[0]["CLHP"].ToString();
                    asm.JCSJ   = DateTime.Parse(dt.Rows[0]["JCSJ"].ToString());
                    asm.MMTIME = dt.Rows[0]["MMTIME"].ToString();
                    asm.MMSX   = dt.Rows[0]["MMSX"].ToString();
                    asm.MMLB   = dt.Rows[0]["MMLB"].ToString();
                    asm.MMHC   = dt.Rows[0]["MMHC"].ToString();//6
                    asm.MMCO   = dt.Rows[0]["MMCO"].ToString();
                    asm.MMO2   = dt.Rows[0]["MMO2"].ToString();
                    asm.MMCO2  = dt.Rows[0]["MMCO2"].ToString();
                    asm.MMNO   = dt.Rows[0]["MMNO"].ToString();
                    asm.MMCOZL = dt.Rows[0]["MMCOZL"].ToString();
                    asm.MMHCZL = dt.Rows[0]["MMHCZL"].ToString();
                    asm.MMNOZL = dt.Rows[0]["MMNOZL"].ToString();
                    asm.MMXSO2 = dt.Rows[0]["MMXSO2"].ToString();
                    asm.MMHJO2 = dt.Rows[0]["MMHJO2"].ToString();
                    asm.MMSJLL = dt.Rows[0]["MMSJLL"].ToString();
                    asm.MMBZLL = dt.Rows[0]["MMBZLL"].ToString();
                    asm.MMWQLL = dt.Rows[0]["MMWQLL"].ToString();
                    asm.MMXSB  = dt.Rows[0]["MMXSB"].ToString();

                    asm.MMWD    = dt.Rows[0]["MMWD"].ToString();//11
                    asm.MMSD    = dt.Rows[0]["MMSD"].ToString();
                    asm.MMDQY   = dt.Rows[0]["MMDQY"].ToString();
                    asm.MMLLJWD = dt.Rows[0]["MMLLJWD"].ToString();
                    asm.MMLLJYL = dt.Rows[0]["MMLLJYL"].ToString();
                    asm.MMCS    = dt.Rows[0]["MMCS"].ToString();
                    asm.MMBZCS  = dt.Rows[0]["MMBZCS"].ToString();
                    asm.MMXSXZ  = dt.Rows[0]["MMXSXZ"].ToString();
                    asm.MMSDXZ  = dt.Rows[0]["MMSDXZ"].ToString();
                    asm.MMGLYL  = dt.Rows[0]["MMGLYL"].ToString();
                    asm.MMYW    = dt.Rows[0]["MMYW"].ToString();
                    asm.MMJSGL  = dt.Rows[0]["MMJSGL"].ToString();//11
                    asm.MMNJ    = dt.Rows[0]["MMNJ"].ToString();
                    asm.MMGL    = dt.Rows[0]["MMGL"].ToString();
                }
                else
                {
                    asm.CLID = "-2";
                }
                return(asm);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 用JZJS插入逐秒数据
        /// </summary>
        /// <param name="JZJS">JZJS</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_VMASSseconds(VMASseconds asm)
        {
            string sqli = "insert into VMAS_DATASECONDS(JYLSH,JYCS,CYDS,MMZS,MMZSGL,MMJZGL,MMCO2ZL,CLID,CLHP,JCSJ,MMTIME,MMSX,MMLB,MMHC,MMCO,MMO2,MMCO2,MMNO,MMCOZL,MMHCZL,MMNOZL,MMXSO2,MMHJO2,MMSJLL,MMBZLL,MMWQLL,MMXSB,MMWD,MMSD,MMDQY,MMLLJWD,MMLLJYL,MMCS,MMBZCS,MMGL,MMNJ,MMXSXZ,MMSDXZ,MMGLYL,MMYW,MMJSGL) values(@JYLSH,@JYCS,@CYDS,@MMZS,@MMZSGL,@MMJZGL,@MMCO2ZL,@CLID,@CLHP,@JCSJ,@MMTIME,@MMSX,@MMLB,@MMHC,@MMCO,@MMO2,@MMCO2,@MMNO,@MMCOZL,@MMHCZL,@MMNOZL,@MMXSO2,@MMHJO2,@MMSJLL,@MMBZLL,@MMWQLL,@MMXSB,@MMWD,@MMSD,@MMDQY,@MMLLJWD,@MMLLJYL,@MMCS,@MMBZCS,@MMGL,@MMNJ,@MMXSXZ,@MMSDXZ,@MMGLYL,@MMYW,@MMJSGL)";
            string sqlu = "update VMAS_DATASECONDS set JYLSH=@JYLSH,JYCS=@JYCS,CYDS=@CYDS,MMZS=@MMZS,MMZSGL=@MMZSGL,MMJZGL=@MMJZGL,MMCO2ZL=@MMCO2ZL,CLHP=@CLHP,JCSJ=@JCSJ,MMTIME=@MMTIME,MMSX=@MMSX,MMLB=@MMLB,MMHC=@MMHC,MMCO=@MMCO,MMO2=@MMO2,MMCO2=@MMCO2,MMNO=@MMNO,MMCOZL=@MMCOZL,MMHCZL=@MMHCZL,MMNOZL=@MMNOZL,MMXSO2=@MMXSO2,MMHJO2=@MMHJO2,MMSJLL=@MMSJLL,MMBZLL=@MMBZLL,MMWQLL=@MMWQLL,MMXSB=@MMXSB,MMWD=@MMWD,MMSD=@MMSD,MMDQY=@MMDQY,MMLLJWD=@MMLLJWD,MMLLJYL=@MMLLJYL,MMCS=@MMCS,MMBZCS=@MMBZCS,MMGL=@MMGL,MMNJ=@MMNJ,MMXSXZ=@MMXSXZ,MMSDXZ=@MMSDXZ,MMGLYL=@MMGLYL,MMYW=@MMYW,MMJSGL=@MMJSGL where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@JYLSH",   asm.JYLSH),
                new SqlParameter("@JYCS",    asm.JYCS),
                new SqlParameter("@CYDS",    asm.CYDS),
                new SqlParameter("@MMZS",    asm.MMZS),
                new SqlParameter("@MMZSGL",  asm.MMZSGL),
                new SqlParameter("@MMJZGL",  asm.MMJZGL),
                new SqlParameter("@MMCO2ZL", asm.MMCO2ZL),
                new SqlParameter("@CLID",    asm.CLID),                //1
                new SqlParameter("@CLHP",    asm.CLHP),
                new SqlParameter("@JCSJ",    asm.JCSJ),
                new SqlParameter("@MMTIME",  asm.MMTIME),
                new SqlParameter("@MMSX",    asm.MMSX),
                new SqlParameter("@MMLB",    asm.MMLB),               //6
                new SqlParameter("@MMHC",    asm.MMHC),
                new SqlParameter("@MMCO",    asm.MMCO),
                new SqlParameter("@MMO2",    asm.MMO2),
                new SqlParameter("@MMCO2",   asm.MMCO2),
                new SqlParameter("@MMNO",    asm.MMNO),
                new SqlParameter("@MMCOZL",  asm.MMCOZL),
                new SqlParameter("@MMHCZL",  asm.MMHCZL),
                new SqlParameter("@MMNOZL",  asm.MMNOZL),
                new SqlParameter("@MMXSO2",  asm.MMXSO2),                 //6
                new SqlParameter("@MMHJO2",  asm.MMHJO2),
                new SqlParameter("@MMSJLL",  asm.MMSJLL),
                new SqlParameter("@MMBZLL",  asm.MMBZLL),
                new SqlParameter("@MMWQLL",  asm.MMWQLL),
                new SqlParameter("@MMXSB",   asm.MMXSB),

                new SqlParameter("@MMWD",    asm.MMWD),
                new SqlParameter("@MMSD",    asm.MMSD),
                new SqlParameter("@MMDQY",   asm.MMDQY),
                new SqlParameter("@MMLLJWD", asm.MMLLJWD),
                new SqlParameter("@MMLLJYL", asm.MMLLJYL),

                new SqlParameter("@MMCS",    asm.MMCS),
                new SqlParameter("@MMBZCS",  asm.MMBZCS),
                new SqlParameter("@MMXSXZ",  asm.MMXSXZ),
                new SqlParameter("@MMSDXZ",  asm.MMSDXZ),                 //6
                new SqlParameter("@MMGLYL",  asm.MMGLYL),
                new SqlParameter("@MMYW",    asm.MMYW),
                new SqlParameter("@MMJSGL",  asm.MMJSGL),
                new SqlParameter("@MMGL",    asm.MMGL),
                new SqlParameter("@MMNJ",    asm.MMNJ)               //6
                //47
            };
            try
            {
                if (Have_VMASseconds(asm.CLID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                //throw;
                return(0);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 用检测编号和次数查询一条检测数据
        /// </summary>
        /// <param name="jcbh">检测编号</param>
        /// <param name="jccs">检测次数</param>
        /// <returns>ASM检测数据Model</returns>
        public VMAS Get_VMAS(string CLID)
        {
            DateTime a;
            string   sql = "select * from vmas where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID", CLID)
            };
            try
            {
                VMAS      vmas = new VMAS();
                DataTable dt   = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    vmas.CLID  = dt.Rows[0]["CLID"].ToString();//1
                    vmas.CLPH  = dt.Rows[0]["CLPH"].ToString();
                    vmas.COZL  = dt.Rows[0]["COZL"].ToString();
                    vmas.COXZ  = dt.Rows[0]["COXZ"].ToString();
                    vmas.COPD  = dt.Rows[0]["COPD"].ToString();
                    vmas.NOXZL = dt.Rows[0]["NOXZL"].ToString();//6
                    vmas.NOXXZ = dt.Rows[0]["NOXXZ"].ToString();
                    vmas.NOXPD = dt.Rows[0]["NOXPD"].ToString();
                    vmas.HCZL  = dt.Rows[0]["HCZL"].ToString();
                    vmas.HCXZ  = dt.Rows[0]["HCXZ"].ToString();
                    vmas.HCPD  = dt.Rows[0]["HCPD"].ToString();//11
                    vmas.ZHPD  = dt.Rows[0]["ZHPD"].ToString();
                    DateTime.TryParse(dt.Rows[0]["JCRQ"].ToString(), out a);
                    if (a != null)
                    {
                        vmas.JCRQ = a;
                    }
                    else
                    {
                        vmas.JCRQ = DateTime.Today;
                    }
                    vmas.WD     = dt.Rows[0]["WD"].ToString();
                    vmas.SD     = dt.Rows[0]["SD"].ToString();
                    vmas.DQY    = dt.Rows[0]["DQY"].ToString();//16
                    vmas.SBMC   = dt.Rows[0]["SBMC"].ToString();
                    vmas.SBXH   = dt.Rows[0]["SBXH"].ToString();
                    vmas.SBZZC  = dt.Rows[0]["SBZZC"].ToString();
                    vmas.CGJXH  = dt.Rows[0]["CGJXH"].ToString();
                    vmas.CGJBH  = dt.Rows[0]["CGJBH"].ToString();//21
                    vmas.CGJZZC = dt.Rows[0]["CGJZZC"].ToString();
                    vmas.FXYXH  = dt.Rows[0]["FXYXH"].ToString();
                    vmas.FXYBH  = dt.Rows[0]["FXYBH"].ToString();
                    vmas.FXYZZC = dt.Rows[0]["FXYZZC"].ToString();
                    vmas.LLJXH  = dt.Rows[0]["LLJXH"].ToString();
                    vmas.LLJBH  = dt.Rows[0]["LLJBH"].ToString();
                    vmas.LLJZZC = dt.Rows[0]["LLJZZC"].ToString();
                    vmas.BEFORE = dt.Rows[0]["BEFORE"].ToString();
                }
                else
                {
                    vmas.CLID = "-2";
                }
                return(vmas);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 用ASM对象插入或更新条检测数据
        /// </summary>
        /// <param name="asm">ASM</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_ASM(ASM asm)
        {
            string sqli = "insert into asm(CLID,CLPH,CO25CLZ,CO25XZ,CO25PD,HC25CLZ,HC25XZ,HC25PD,NOX25CLZ,NOX25XZ,NOX25PD,CO40CLZ,CO40XZ,CO40PD,HC40CLZ,HC40XZ,HC40PD,NOX40CLZ,NOX40XZ,NOX40PD,ZHPD,JCRQ,WD,SD,DQY,SBMC,SBXH,SBZZC,CGJXH,CGJBH,CGJZZC,FXYXH,FXYBH,FXYZZC) values(@CLID,@CLPH,@CO25CLZ,@CO25XZ,@CO25PD,@HC25CLZ,@HC25XZ,@HC25PD,@NOX25CLZ,@NOX25XZ,@NOX25PD,@CO40CLZ,@CO40XZ,@CO40PD,@HC40CLZ,@HC40XZ,@HC40PD,@NOX40CLZ,@NOX40XZ,@NOX40PD,@ZHPD,@JCRQ,@WD,@SD,@DQY,@SBMC,@SBXH,@SBZZC,@CGJXH,@CGJBH,@CGJZZC,@FXYXH,@FXYBH,@FXYZZC)";
            string sqlu = "update asm set CLPH=@CLPH,CO25CLZ=@CO25CLZ,CO25XZ=@CO25XZ,CO25PD=@CO25PD,HC25CLZ=@HC25CLZ,HC25XZ=@HC25XZ,HC25PD=@HC25PD,NOX25CLZ=@NOX25CLZ,NOX25XZ=@NOX25XZ,NOX25PD=@NOX25PD,CO40CLZ=@CO40CLZ,CO40XZ=@CO40XZ,CO40PD=@CO40PD,HC40CLZ=@HC40CLZ,HC40XZ=@HC40XZ,HC40PD=@HC40PD,NOX40CLZ=@NOX40CLZ,NOX40XZ=@NOX40XZ,NOX40PD=@NOX40PD,ZHPD=@ZHPD,JCRQ=@JCRQ,WD=@WD,SD=@SD,DQY=@DQY,SBMC=@SBMC,SBXH=@SBXH,SBZZC=@SBZZC,CGJXH=@CGJXH,CGJBH=@CGJBH,CGJZZC=@CGJZZC,FXYXH=@FXYXH,FXYBH=@FXYBH,FXYZZC=@FXYZZC where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID",     asm.CLID),               //1
                new SqlParameter("@CLPH",     asm.CLPH),               //1
                new SqlParameter("@CO25CLZ",  asm.CO25CLZ),
                new SqlParameter("@CO25XZ",   asm.CO25XZ),
                new SqlParameter("@CO25PD",   asm.CO25PD),
                new SqlParameter("@HC25CLZ",  asm.HC25CLZ),                 //6
                new SqlParameter("@HC25XZ",   asm.HC25XZ),
                new SqlParameter("@HC25PD",   asm.HC25PD),
                new SqlParameter("@NOX25CLZ", asm.NOX25CLZ),
                new SqlParameter("@NOX25XZ",  asm.NOX25XZ),
                new SqlParameter("@NOX25PD",  asm.NOX25PD),                 //11
                new SqlParameter("@CO40CLZ",  asm.CO40CLZ),
                new SqlParameter("@CO40XZ",   asm.CO40XZ),
                new SqlParameter("@CO40PD",   asm.CO40PD),
                new SqlParameter("@HC40CLZ",  asm.HC40CLZ),                 //6
                new SqlParameter("@HC40XZ",   asm.HC40XZ),
                new SqlParameter("@HC40PD",   asm.HC40PD),
                new SqlParameter("@NOX40CLZ", asm.NOX40CLZ),
                new SqlParameter("@NOX40XZ",  asm.NOX40XZ),
                new SqlParameter("@NOX40PD",  asm.NOX40PD),                 //11
                new SqlParameter("@ZHPD",     asm.ZHPD),
                new SqlParameter("@JCRQ",     asm.JCRQ),
                new SqlParameter("@WD",       asm.WD),
                new SqlParameter("@SD",       asm.SD),
                new SqlParameter("@DQY",      asm.DQY),             //16
                new SqlParameter("@SBMC",     asm.SBMC),
                new SqlParameter("@SBXH",     asm.SBXH),
                new SqlParameter("@SBZZC",    asm.SBZZC),
                new SqlParameter("@CGJXH",    asm.CGJXH),
                new SqlParameter("@CGJBH",    asm.CGJBH),               //21
                new SqlParameter("@CGJZZC",   asm.CGJZZC),
                new SqlParameter("@FXYXH",    asm.FXYXH),
                new SqlParameter("@FXYBH",    asm.FXYBH),
                new SqlParameter("@FXYZZC",   asm.FXYZZC)
            };
            try
            {
                if (Have_ASM(asm.CLID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 用检测编号和次数查询一条检测数据
        /// </summary>
        /// <param name="jcbh">检测编号</param>
        /// <param name="jccs">检测次数</param>
        /// <returns>ASM检测数据Model</returns>
        public ASM Get_ASM(string CLID)
        {
            DateTime a;
            string   sql = "select * from asm where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID", CLID)
            };
            try
            {
                ASM       asm = new ASM();
                DataTable dt  = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    asm.CLID     = dt.Rows[0]["CLID"].ToString();//1
                    asm.CLPH     = dt.Rows[0]["CLPH"].ToString();
                    asm.CO25CLZ  = dt.Rows[0]["CO25CLZ"].ToString();
                    asm.CO25XZ   = dt.Rows[0]["CO25XZ"].ToString();
                    asm.CO25PD   = dt.Rows[0]["CO25PD"].ToString();
                    asm.HC25CLZ  = dt.Rows[0]["HC25CLZ"].ToString();//6
                    asm.HC25XZ   = dt.Rows[0]["HC25XZ"].ToString();
                    asm.HC25PD   = dt.Rows[0]["HC25PD"].ToString();
                    asm.NOX25CLZ = dt.Rows[0]["NOX25CLZ"].ToString();
                    asm.NOX25XZ  = dt.Rows[0]["NOX25XZ"].ToString();
                    asm.NOX25PD  = dt.Rows[0]["NOX25PD"].ToString();//11
                    asm.CO40CLZ  = dt.Rows[0]["CO40CLZ"].ToString();
                    asm.CO40XZ   = dt.Rows[0]["CO40XZ"].ToString();
                    asm.CO40PD   = dt.Rows[0]["CO40PD"].ToString();
                    asm.HC40CLZ  = dt.Rows[0]["HC40CLZ"].ToString();//6
                    asm.HC40XZ   = dt.Rows[0]["HC40XZ"].ToString();
                    asm.HC40PD   = dt.Rows[0]["HC40PD"].ToString();
                    asm.NOX40CLZ = dt.Rows[0]["NOX40CLZ"].ToString();
                    asm.NOX40XZ  = dt.Rows[0]["NOX40XZ"].ToString();
                    asm.NOX40PD  = dt.Rows[0]["NOX40PD"].ToString();//11
                    asm.ZHPD     = dt.Rows[0]["ZHPD"].ToString();
                    DateTime.TryParse(dt.Rows[0]["JCRQ"].ToString(), out a);
                    if (a != null)
                    {
                        asm.JCRQ = a;
                    }
                    else
                    {
                        asm.JCRQ = DateTime.Today;
                    }
                    asm.WD      = dt.Rows[0]["WD"].ToString();
                    asm.SD      = dt.Rows[0]["SD"].ToString();
                    asm.DQY     = dt.Rows[0]["DQY"].ToString();//16
                    asm.SBMC    = dt.Rows[0]["SBMC"].ToString();
                    asm.SBXH    = dt.Rows[0]["SBXH"].ToString();
                    asm.SBZZC   = dt.Rows[0]["SBZZC"].ToString();
                    asm.CGJXH   = dt.Rows[0]["CGJXH"].ToString();
                    asm.CGJBH   = dt.Rows[0]["CGJBH"].ToString();//21
                    asm.CGJZZC  = dt.Rows[0]["CGJZZC"].ToString();
                    asm.FXYXH   = dt.Rows[0]["FXYXH"].ToString();
                    asm.FXYBH   = dt.Rows[0]["FXYBH"].ToString();
                    asm.FXYZZC  = dt.Rows[0]["FXYZZC"].ToString();
                    asm.CO25025 = dt.Rows[0]["CO25025"].ToString();
                    asm.O25025  = dt.Rows[0]["O25025"].ToString();
                    asm.CO22540 = dt.Rows[0]["CO22540"].ToString();
                    asm.O22540  = dt.Rows[0]["O22540"].ToString();
                    if (dt.Columns.Contains("LAMBDA5025"))
                    {
                        asm.LAMBDA5025 = dt.Rows[0]["LAMBDA5025"].ToString();
                        asm.LAMBDA2540 = dt.Rows[0]["LAMBDA2540"].ToString();
                    }
                }
                else
                {
                    asm.CLID = "-2";
                }
                return(asm);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 15
0
        public bool updateBdsx(BDSX model)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update [设备标定时限] set ");
            strSql.Append("HXSX=@HXSX,");
            strSql.Append("JSGLSX=@JSGLSX,");
            strSql.Append("GLSX=@GLSX,");
            strSql.Append("LLJSX=@LLJSX,");
            strSql.Append("YDJSX=@YDJSX,");
            strSql.Append("FXYLOWSX=@FXYLOWSX,");
            strSql.Append("FXYHIGHSX=@FXYHIGHSX,");
            strSql.Append("FXYMIDSX=@FXYMIDSX,");
            strSql.Append("FXYLOWMIDSX=@FXYLOWMIDSX,");
            strSql.Append("FXYHIGHMIDSX=@FXYHIGHMIDSX,");
            strSql.Append("ZJSX=@ZJSX,");
            strSql.Append("YRSX=@YRSX,");
            strSql.Append("YLJSX=@YLJSX,");
            strSql.Append("SDSX=@SDSX,");
            strSql.Append("HJCSSX=@HJCSSX,");
            strSql.Append("ZSJSX=@ZSJSX,");
            strSql.Append("JLSX=@JLSX");
            SqlParameter[] parameters =
            {
                //new SqlParameter("@STAFFID", SqlDbType.VarChar,50),
                new SqlParameter("@HXSX",         SqlDbType.VarChar, 50),
                new SqlParameter("@JSGLSX",       SqlDbType.VarChar, 50),
                new SqlParameter("@GLSX",         SqlDbType.VarChar, 50),
                new SqlParameter("@LLJSX",        SqlDbType.VarChar, 50),
                new SqlParameter("@YDJSX",        SqlDbType.VarChar, 50),
                new SqlParameter("@FXYLOWSX",     SqlDbType.VarChar, 50),
                new SqlParameter("@FXYHIGHSX",    SqlDbType.VarChar, 50),
                new SqlParameter("@FXYMIDSX",     SqlDbType.VarChar, 50),
                new SqlParameter("@FXYLOWMIDSX",  SqlDbType.VarChar, 50),
                new SqlParameter("@FXYHIGHMIDSX", SqlDbType.VarChar, 50),
                new SqlParameter("@ZJSX",         SqlDbType.VarChar, 50),
                new SqlParameter("@YRSX",         SqlDbType.VarChar, 50),
                new SqlParameter("@YLJSX",        SqlDbType.VarChar, 50),
                new SqlParameter("@SDSX",         SqlDbType.VarChar, 50),
                new SqlParameter("@HJCSSX",       SqlDbType.VarChar, 50),
                new SqlParameter("@ZSJSX",        SqlDbType.VarChar, 50),
                new SqlParameter("@JLSX",         SqlDbType.VarChar, 50)
            };
            //parameters[i++].Value = model.STAFFID;
            parameters[i++].Value = model.HXSX;
            parameters[i++].Value = model.JSGLSX;
            parameters[i++].Value = model.GLSX;
            parameters[i++].Value = model.LLJSX;
            parameters[i++].Value = model.YDJSX;
            parameters[i++].Value = model.FXYLOWSX;
            parameters[i++].Value = model.FXYHIGHSX;
            parameters[i++].Value = model.FXYMIDSX;
            parameters[i++].Value = model.FXYLOWMIDSX;
            parameters[i++].Value = model.FXYHIGHMIDSX;
            parameters[i++].Value = model.ZJSX;
            parameters[i++].Value = model.YRSX;
            parameters[i++].Value = model.YLJSX;
            parameters[i++].Value = model.SDSX;
            parameters[i++].Value = model.HJCSSX;
            parameters[i++].Value = model.ZSJSX;
            parameters[i++].Value = model.JLSX;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 用JZJS对象插入或更新条检测数据
        /// </summary>
        /// <param name="JZJS">JZJS</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_JZJS(JZJS jzjs)
        {
            string sqli = "insert into jzjs(CLID,CLPH,HK,NK,EK,YDXZ,HKPD,NKPD,EKPD,MAXLBGL,GLXZ,GLPD,MAXLBZS,ZSXZ,ZSPD,ZHPD,JCRQ,WD,SD,DQY,SBMC,SBXH,SBZZC,CGJXH,CGJBH,CGJZZC,YDJXH,YDJBH,YDJZZC,ZSJXH,ZSJBH,ZSJZZC) values(@CLID,@CLPH,@HK,@NK,@EK,@YDXZ,@HKPD,@NKPD,@EKPD,@MAXLBGL,@GLXZ,@GLPD,@MAXLBZS,@ZSXZ,@ZSPD,@ZHPD,@JCRQ,@WD,@SD,@DQY,@SBMC,@SBXH,@SBZZC,@CGJXH,@CGJBH,@CGJZZC,@YDJXH,@YDJBH,@YDJZZC,@ZSJXH,@ZSJBH,@ZSJZZC)";
            string sqlu = "update jzjs set CLPH=@CLPH,HK=@HK,NK=@NK,EK=@EK,YDXZ=@YDXZ,HKPD=@HKPD,NKPD=@NKPD,EKPD=@EKPD,MAXLBGL=@MAXLBGL,GLXZ=@GLXZ,GLPD=@GLPD,MAXLBZS=@MAXLBZS,ZSXZ=@ZSXZ,ZSPD=@ZSPD,ZHPD=@ZHPD,JCRQ=@JCRQ,WD=@WD,SD=@SD,DQY=@DQY,SBMC=@SBMC,SBXH=@SBXH,SBZZC=@SBZZC,CGJXH=@CGJXH,CGJBH=@CGJBH,CGJZZC=@CGJZZC,YDJXH=@YDJXH,YDJBH=@YDJBH,YDJZZC=@YDJZZC,ZSJXH=@ZSJXH,ZSJBH=@ZSJBH,ZSJZZC=@ZSJZZC where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID",    jzjs.CLID),                //1
                new SqlParameter("@CLPH",    jzjs.CLPH),
                new SqlParameter("@HK",      jzjs.HK),
                new SqlParameter("@NK",      jzjs.NK),
                new SqlParameter("@EK",      jzjs.EK),
                new SqlParameter("@YDXZ",    jzjs.YDXZ),               //6
                new SqlParameter("@HKPD",    jzjs.HKPD),
                new SqlParameter("@NKPD",    jzjs.NKPD),
                new SqlParameter("@EKPD",    jzjs.EKPD),
                new SqlParameter("@MAXLBGL", jzjs.MAXLBGL),
                new SqlParameter("@GLXZ",    jzjs.GLXZ),
                new SqlParameter("@GLPD",    jzjs.GLPD),
                new SqlParameter("@MAXLBZS", jzjs.MAXLBZS),                  //11
                new SqlParameter("@ZSXZ",    jzjs.ZSXZ),
                new SqlParameter("@ZSPD",    jzjs.ZSPD),
                new SqlParameter("@ZHPD",    jzjs.ZHPD),
                new SqlParameter("@JCRQ",    jzjs.JCRQ),
                new SqlParameter("@WD",      jzjs.WD),
                new SqlParameter("@SD",      jzjs.SD),
                new SqlParameter("@DQY",     jzjs.DQY),              //16
                new SqlParameter("@SBMC",    jzjs.SBMC),
                new SqlParameter("@SBXH",    jzjs.SBXH),
                new SqlParameter("@SBZZC",   jzjs.SBZZC),
                new SqlParameter("@CGJXH",   jzjs.CGJXH),
                new SqlParameter("@CGJBH",   jzjs.CGJBH),                //21
                new SqlParameter("@CGJZZC",  jzjs.CGJZZC),
                new SqlParameter("@YDJXH",   jzjs.YDJXH),
                new SqlParameter("@YDJBH",   jzjs.YDJBH),
                new SqlParameter("@YDJZZC",  jzjs.YDJZZC),
                new SqlParameter("@ZSJXH",   jzjs.ZSJXH),
                new SqlParameter("@ZSJBH",   jzjs.ZSJBH),
                new SqlParameter("@ZSJZZC",  jzjs.ZSJZZC)                 //47
            };
            try
            {
                if (Have_JZJS(jzjs.CLID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public bool updateMoneyRecordInf(MONEY model)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update [收费记录] set ");
            strSql.Append("CLHP=@CLHP,");
            strSql.Append("DLSJ=@DLSJ,");

            strSql.Append("EXHAUST=@EXHAUST,");
            strSql.Append("SAFE=@SAFE,");
            strSql.Append("EXHAUSTSTANDARDFY=@EXHAUSTSTANDARDFY,");
            strSql.Append("SAFESTANDARDFY=@SAFESTANDARDFY,");
            strSql.Append("EXHAUSTFY=@EXHAUSTFY,");
            strSql.Append("SAFEFY=@SAFEFY,");
            strSql.Append("EXHAUSTBZ=@EXHAUSTBZ,");
            strSql.Append("SAFEBZ=@SAFEBZ,");
            strSql.Append("FY=@FY,");
            strSql.Append("SKR=@SKR,");
            strSql.Append("TF=@TF,");
            strSql.Append("TFFY=@TFFY,");
            strSql.Append("CZ=@CZ,");
            strSql.Append("SFSJ=@SFSJ");
            strSql.Append(" where CLID='" + model.CLID + "'");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CLHP",              SqlDbType.VarChar,   50),
                new SqlParameter("@DLSJ",              SqlDbType.DateTime),
                new SqlParameter("@EXHAUST",           SqlDbType.VarChar,   50),
                new SqlParameter("@SAFE",              SqlDbType.VarChar,   50),
                new SqlParameter("@EXHAUSTSTANDARDFY", SqlDbType.VarChar,   50),
                new SqlParameter("@SAFESTANDARDFY",    SqlDbType.VarChar,   50),
                new SqlParameter("@EXHAUSTFY",         SqlDbType.VarChar,   50),
                new SqlParameter("@SAFEFY",            SqlDbType.VarChar,   50),
                new SqlParameter("@EXHAUSTBZ",         SqlDbType.VarChar,   50),
                new SqlParameter("@SAFEBZ",            SqlDbType.VarChar,   50),
                new SqlParameter("@FY",                SqlDbType.VarChar,   50),
                new SqlParameter("@SKR",               SqlDbType.VarChar,   50),
                new SqlParameter("@TF",                SqlDbType.VarChar,   50),
                new SqlParameter("@TFFY",              SqlDbType.VarChar,   50),
                new SqlParameter("@CZ",                SqlDbType.VarChar,   50),
                new SqlParameter("@SFSJ",              SqlDbType.DateTime)
            };
            parameters[i++].Value = model.CLHP;
            parameters[i++].Value = model.DLSJ;
            parameters[i++].Value = model.EXHAUST;
            parameters[i++].Value = model.SAFE;
            parameters[i++].Value = model.EXHAUSTSTANDARDFY;
            parameters[i++].Value = model.SAFESTANDARDFY;
            parameters[i++].Value = model.EXHAUSTFY;
            parameters[i++].Value = model.SAFEFY;
            parameters[i++].Value = model.EXHAUSTBZ;
            parameters[i++].Value = model.SAFEBZ;
            parameters[i++].Value = model.FY;
            parameters[i++].Value = model.SKR;
            parameters[i++].Value = model.TF;
            parameters[i++].Value = model.TFFY;
            parameters[i++].Value = model.CZ;
            parameters[i++].Value = model.SFSJ;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 用检测编号和次数查询一条检测数据
        /// </summary>
        /// <param name="jcbh">检测编号</param>
        /// <param name="jccs">检测次数</param>
        /// <returns>Zyjs_Btg检测数据Model</returns>
        public Zyjs_Btg Get_Zyjs(string CLID)
        {
            DateTime a;
            string   sql = "select * from zyjs_btg where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@CLID", CLID)
            };
            try
            {
                Zyjs_Btg  zyjs = new Zyjs_Btg();
                DataTable dt   = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    zyjs.CLID        = dt.Rows[0]["CLID"].ToString();//1
                    zyjs.JCBGBH      = dt.Rows[0]["JCBGBH"].ToString();
                    zyjs.CLPH        = dt.Rows[0]["CLPH"].ToString();
                    zyjs.FIRSTDATA   = dt.Rows[0]["FIRSTDATA"].ToString();
                    zyjs.SECONDDATA  = dt.Rows[0]["SECONDDATA"].ToString();
                    zyjs.THIRDDATA   = dt.Rows[0]["THIRDDATA"].ToString();
                    zyjs.FOURTHDATA  = dt.Rows[0]["FOURTHDATA"].ToString();
                    zyjs.AVERAGEDATA = dt.Rows[0]["AVERAGEDATA"].ToString(); //6
                    zyjs.YDXZ        = dt.Rows[0]["YDXZ"].ToString();        //6
                    zyjs.YDPD        = dt.Rows[0]["YDPD"].ToString();
                    zyjs.DSZS        = dt.Rows[0]["DSZS"].ToString();
                    zyjs.ZHPD        = dt.Rows[0]["ZHPD"].ToString();
                    DateTime.TryParse(dt.Rows[0]["JCRQ"].ToString(), out a);
                    if (a != null)
                    {
                        zyjs.JCRQ = a;
                    }
                    else
                    {
                        zyjs.JCRQ = DateTime.Today;
                    }
                    zyjs.WD        = dt.Rows[0]["WD"].ToString();
                    zyjs.SD        = dt.Rows[0]["SD"].ToString();
                    zyjs.DQY       = dt.Rows[0]["DQY"].ToString();//16
                    zyjs.SBMC      = dt.Rows[0]["SBMC"].ToString();
                    zyjs.SBXH      = dt.Rows[0]["SBXH"].ToString();
                    zyjs.SBZZC     = dt.Rows[0]["SBZZC"].ToString();
                    zyjs.ZSJXH     = dt.Rows[0]["ZSJXH"].ToString();
                    zyjs.ZSJBH     = dt.Rows[0]["ZSJBH"].ToString();//21
                    zyjs.ZSJZZC    = dt.Rows[0]["ZSJZZC"].ToString();
                    zyjs.YDJXH     = dt.Rows[0]["YDJXH"].ToString();
                    zyjs.YDJBH     = dt.Rows[0]["YDJBH"].ToString();
                    zyjs.YDJZZC    = dt.Rows[0]["YDJZZC"].ToString();
                    zyjs.SHY       = dt.Rows[0]["SHY"].ToString();
                    zyjs.SYNCHDATE = dt.Rows[0]["SYNCHDATE"].ToString();
                    zyjs.YW        = dt.Rows[0]["YW"].ToString();
                    zyjs.JCKSSJ    = dt.Rows[0]["JCKSSJ"].ToString();
                    zyjs.JCJSSJ    = dt.Rows[0]["JCJSSJ"].ToString();
                    zyjs.JCFF      = dt.Rows[0]["JCFF"].ToString();
                }
                else
                {
                    zyjs.CLID = "-2";
                }
                return(zyjs);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 19
0
        public bool saveTemperatureDataByIni(temperatureData model, string stationid, string lineid, DateTime bdrq)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [气象站校准] (");
            strSql.Append("STATIONID,"); //=@PZLX,");1
            strSql.Append("LINEID,");    //=@JCCLPH,");2
            strSql.Append("WDBZ,");      //=@CLXHBH,");3
            strSql.Append("WDSCZ,");     //=@CLXHBH,");3
            strSql.Append("SDBZ,");      //=@JCCS,");4
            strSql.Append("SDSCZ,");     //=@CCRQ,");5

            strSql.Append("DQYBZ,");     //=@CLXHBH,");3
            strSql.Append("DQYSCZ,");    //=@CLXHBH,");3
            strSql.Append("WDWC,");      //=@JCCS,");4
            strSql.Append("SDWC,");      //=@CCRQ,");5
            strSql.Append("DQYWC,");     //=@CCRQ,");5

            strSql.Append("BDJG,");      //=@DJRQ,"); 6
            strSql.Append("BZSM,");      //=@FDJH,");7
            strSql.Append("CZY,");       //=@LCBDS,");12
            strSql.Append("BDRQ) ");     //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@WDBZ,@WDSCZ,@SDBZ,@SDSCZ,@DQYBZ,@DQYSCZ,@WDWC,@SDWC,@DQYWC,@BDJG,@BZSM,@CZY,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID", SqlDbType.VarChar, 50),
                new SqlParameter("@LINEID",    SqlDbType.VarChar, 50),
                new SqlParameter("@WDBZ",      SqlDbType.VarChar, 50),
                new SqlParameter("@WDSCZ",     SqlDbType.VarChar, 50),
                new SqlParameter("@SDBZ",      SqlDbType.VarChar, 50),
                new SqlParameter("@SDSCZ",     SqlDbType.VarChar, 50),

                new SqlParameter("@DQYBZ",     SqlDbType.VarChar, 50),
                new SqlParameter("@DQYSCZ",    SqlDbType.VarChar, 50),
                new SqlParameter("@WDWC",      SqlDbType.VarChar, 50),
                new SqlParameter("@SDWC",      SqlDbType.VarChar, 50),
                new SqlParameter("@DQYWC",     SqlDbType.VarChar, 50),

                new SqlParameter("@BDJG",      SqlDbType.VarChar, 50),
                new SqlParameter("@BZSM",      SqlDbType.VarChar, 50),
                new SqlParameter("@CZY",       SqlDbType.VarChar, 50),
                new SqlParameter("@BDRQ",      SqlDbType.DateTime)
            };
            parameters[i++].Value = stationid;
            parameters[i++].Value = lineid;
            parameters[i++].Value = model.Wdbz.ToString("0.00");
            parameters[i++].Value = model.Wdscz.ToString("0.00");
            parameters[i++].Value = model.Sdbz.ToString("0.00");
            parameters[i++].Value = model.Sdscz.ToString("0.00");
            parameters[i++].Value = model.Dqybz.ToString("0.00");
            parameters[i++].Value = model.Dqyscz.ToString("0.00");
            parameters[i++].Value = model.Wdwc.ToString("0.00");
            parameters[i++].Value = model.Sdwc.ToString("0.00");
            parameters[i++].Value = model.Dqywc.ToString("0.00");
            parameters[i++].Value = model.Bdjg;
            parameters[i++].Value = model.Bzsm;
            parameters[i++].Value = "";
            parameters[i++].Value = bdrq;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 用Zyjs_Btg对象插入或更新条检测数据
        /// </summary>
        /// <param name="zyjs">Zyjs_Btg</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_Zyjs_Btg(Zyjs_Btg zyjs)
        {
            string sqli = "insert into zyjs_btg(JYLSH,JYCS,SBRZBM,CLID,CLPH,FIRSTDATA,SECONDDATA,THIRDDATA,FOURTHDATA,AVERAGEDATA,YDXZ,YDPD,DSZS,ZHPD,JCRQ,WD,SD,DQY,SBMC,SBXH,SBZZC,YDJXH,YDJBH,YDJZZC,ZSJXH,ZSJBH,ZSJZZC,JCBGBH,SHY,SYNCHDATE,YW,JCKSSJ,JCJSSJ,JCFF) values(@JYLSH,@JYCS,@SBRZBM,@CLID,@CLPH,@FIRSTDATA,@SECONDDATA,@THIRDDATA,@FOURTHDATA,@AVERAGEDATA,@YDXZ,@YDPD,@DSZS,@ZHPD,@JCRQ,@WD,@SD,@DQY,@SBMC,@SBXH,@SBZZC,@YDJXH,@YDJBH,@YDJZZC,@ZSJXH,@ZSJBH,@ZSJZZC,@JCBGBH,@SHY,@SYNCHDATE,@YW,@JCKSSJ,@JCJSSJ,@JCFF)";
            string sqlu = "update zyjs_btg set JYLSH=@JYLSH,JYCS=@JYCS,SBRZBM=@SBRZBM,CLPH=@CLPH,FIRSTDATA=@FIRSTDATA,SECONDDATA=@SECONDDATA,THIRDDATA=@THIRDDATA,FOURTHDATA=@FOURTHDATA,AVERAGEDATA=@AVERAGEDATA,YDXZ=@YDXZ,YDPD=@YDPD,DSZS=@DSZS,ZHPD=@ZHPD,JCRQ=@JCRQ,WD=@WD,SD=@SD,DQY=@DQY,SBMC=@SBMC,SBXH=@SBXH,SBZZC=@SBZZC,YDJXH=@YDJXH,YDJBH=@YDJBH,YDJZZC=@YDJZZC,ZSJXH=@ZSJXH,ZSJBH=@ZSJBH,ZSJZZC=@ZSJZZC,JCBGBH=@JCBGBH,SHY=@SHY,SYNCHDATE=@SYNCHDATE,YW=@YW,JCKSSJ=@JCKSSJ,JCJSSJ=@JCJSSJ,JCFF=@JCFF where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@JYLSH",       zyjs.JYLSH),
                new SqlParameter("@JYCS",        zyjs.JYCS),
                new SqlParameter("@SBRZBM",      zyjs.SBRZBM),
                new SqlParameter("@CLID",        zyjs.CLID),            //1
                new SqlParameter("@CLPH",        zyjs.CLPH),
                new SqlParameter("@FIRSTDATA",   zyjs.FIRSTDATA),
                new SqlParameter("@SECONDDATA",  zyjs.SECONDDATA),
                new SqlParameter("@THIRDDATA",   zyjs.THIRDDATA),
                new SqlParameter("@FOURTHDATA",  zyjs.FOURTHDATA),
                new SqlParameter("@AVERAGEDATA", zyjs.AVERAGEDATA),                  //6zyjs
                new SqlParameter("@YDXZ",        zyjs.YDXZ),
                new SqlParameter("@YDPD",        zyjs.YDPD),
                new SqlParameter("@DSZS",        zyjs.DSZS),
                new SqlParameter("@ZHPD",        zyjs.ZHPD),
                new SqlParameter("@JCRQ",        zyjs.JCRQ),
                new SqlParameter("@WD",          zyjs.WD),
                new SqlParameter("@SD",          zyjs.SD),
                new SqlParameter("@DQY",         zyjs.DQY),          //16
                new SqlParameter("@SBMC",        zyjs.SBMC),
                new SqlParameter("@SBXH",        zyjs.SBXH),
                new SqlParameter("@SBZZC",       zyjs.SBZZC),
                new SqlParameter("@ZSJXH",       zyjs.ZSJXH),
                new SqlParameter("@ZSJBH",       zyjs.ZSJBH),            //21
                new SqlParameter("@ZSJZZC",      zyjs.ZSJZZC),
                new SqlParameter("@YDJXH",       zyjs.YDJXH),
                new SqlParameter("@YDJBH",       zyjs.YDJBH),
                new SqlParameter("@YDJZZC",      zyjs.YDJZZC),       //47
                new SqlParameter("@JCBGBH",      zyjs.JCBGBH),
                new SqlParameter("@SHY",         zyjs.SHY),          //21
                new SqlParameter("@SYNCHDATE",   zyjs.SYNCHDATE),
                new SqlParameter("@YW",          zyjs.YW),
                new SqlParameter("@JCKSSJ",      zyjs.JCKSSJ),
                new SqlParameter("@JCJSSJ",      zyjs.JCJSSJ),
                new SqlParameter("@JCFF",        zyjs.JCFF)
            };
            try
            {
                if (Have_Zyjs_Btg(zyjs.CLID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 21
0
        public bool saveAnswerTimeByIni(xysjData model, string stationid, string lineid, DateTime bdrq)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [响应时间测试] (");
            strSql.Append("STATIONID,");  //=@PZLX,");1
            strSql.Append("LINEID,");     //=@JCCLPH,");2
            strSql.Append("SPEED,");      //=@CLXHBH,");3
            strSql.Append("STARTPOWER,"); //=@CLXHBH,");3
            strSql.Append("STARTFORCE,"); //=@JCCS,");4
            strSql.Append("ENDPOWER,");   //=@CCRQ,");5
            strSql.Append("ENDFORCE,");   //=@CCRQ,");5
            strSql.Append("XYTIME,");     //=@CCRQ,");5
            strSql.Append("WDTIME,");     //=@CCRQ,");5
            strSql.Append("BDJG,");       //=@DJRQ,"); 6
            strSql.Append("CZY,");        //=@LCBDS,");12
            strSql.Append("BDRQ) ");      //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@SPEED,@STARTPOWER,@STARTFORCE,@ENDPOWER,@ENDFORCE,@XYTIME,@WDTIME,@BDJG,@CZY,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID",  SqlDbType.VarChar, 50),
                new SqlParameter("@LINEID",     SqlDbType.VarChar, 50),
                new SqlParameter("@SPEED",      SqlDbType.VarChar, 50),
                new SqlParameter("@STARTPOWER", SqlDbType.VarChar, 50),
                new SqlParameter("@STARTFORCE", SqlDbType.VarChar, 50),
                new SqlParameter("@ENDPOWER",   SqlDbType.VarChar, 50),
                new SqlParameter("@ENDFORCE",   SqlDbType.VarChar, 50),
                new SqlParameter("@XYTIME",     SqlDbType.VarChar, 50),
                new SqlParameter("@WDTIME",     SqlDbType.VarChar, 50),
                new SqlParameter("@BDJG",       SqlDbType.VarChar, 50),
                new SqlParameter("@CZY",        SqlDbType.VarChar, 50),
                new SqlParameter("@BDRQ",       SqlDbType.DateTime)
            };
            parameters[i++].Value = stationid;
            parameters[i++].Value = lineid;
            parameters[i++].Value = model.Sd;
            parameters[i++].Value = model.StartPower;
            parameters[i++].Value = model.StartForce;
            parameters[i++].Value = model.EndPower;
            parameters[i++].Value = model.EndForce;
            parameters[i++].Value = model.XyTime;
            parameters[i++].Value = model.WdTime;
            parameters[i++].Value = model.Bdjg;
            parameters[i++].Value = "";
            parameters[i++].Value = bdrq;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 用检测编号和次数查询一条检测数据
        /// </summary>
        /// <param name="jcbh">检测编号</param>
        /// <param name="jccs">检测次数</param>
        /// <returns>Zyjs_Btg检测数据Model</returns>
        public selfcheckdata Get_SelfCheckData(string ID)
        {
            DateTime a;
            string   sql = "select * from [自检记录] where ID=@ID";

            SqlParameter[] spr =
            {
                new SqlParameter("@ID", ID)
            };
            try
            {
                selfcheckdata zyjs = new selfcheckdata();
                DataTable     dt   = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    zyjs.ID             = dt.Rows[0]["ID"].ToString();
                    zyjs.WORKTIME       = DateTime.Parse(dt.Rows[0]["WORKTIME"].ToString());
                    zyjs.WORKER         = dt.Rows[0]["WORKER"].ToString();
                    zyjs.ISQXZCHECK     = dt.Rows[0]["ISQXZCHECK"].ToString();
                    zyjs.ISFQYCHECK     = dt.Rows[0]["ISFQYCHECK"].ToString();
                    zyjs.ISBTGCHECK     = dt.Rows[0]["ISBTGCHECK"].ToString();
                    zyjs.ISCGJCHECK     = dt.Rows[0]["ISCGJCHECK"].ToString();
                    zyjs.ISLLJCHECK     = dt.Rows[0]["ISLLJCHECK"].ToString();
                    zyjs.ISZSJCHECK     = dt.Rows[0]["ISZSJCHECK"].ToString();
                    zyjs.TEMPOK         = dt.Rows[0]["TEMPOK"].ToString();
                    zyjs.HUMIOK         = dt.Rows[0]["HUMIOK"].ToString();
                    zyjs.AIRPOK         = dt.Rows[0]["AIRPOK"].ToString();
                    zyjs.TEMP           = dt.Rows[0]["TEMP"].ToString();
                    zyjs.HUMI           = dt.Rows[0]["HUMI"].ToString();
                    zyjs.AIRP           = dt.Rows[0]["AIRP"].ToString();
                    zyjs.FQYTX          = dt.Rows[0]["FQYTX"].ToString();
                    zyjs.FQYYR          = dt.Rows[0]["FQYYR"].ToString();
                    zyjs.FQYTL          = dt.Rows[0]["FQYTL"].ToString();
                    zyjs.FQYJL          = dt.Rows[0]["FQYJL"].ToString();
                    zyjs.FQYLC          = dt.Rows[0]["FQYLC"].ToString();
                    zyjs.FQYO2          = dt.Rows[0]["FQYO2"].ToString();
                    zyjs.BTGTX          = dt.Rows[0]["BTGTX"].ToString();
                    zyjs.BTGYR          = dt.Rows[0]["BTGYR"].ToString();
                    zyjs.BTGTL          = dt.Rows[0]["BTGTL"].ToString();
                    zyjs.BTGLC          = dt.Rows[0]["BTGLC"].ToString();
                    zyjs.BTGJZ          = dt.Rows[0]["BTGJZ"].ToString();
                    zyjs.CGJTX          = dt.Rows[0]["CGJTX"].ToString();
                    zyjs.CGJYR          = dt.Rows[0]["CGJYR"].ToString();
                    zyjs.CGJQL          = dt.Rows[0]["CGJQL"].ToString();
                    zyjs.CGJJSGL        = dt.Rows[0]["CGJJSGL"].ToString();
                    zyjs.CGJJZHX        = dt.Rows[0]["CGJJZHX"].ToString();
                    zyjs.CGJEDGL        = dt.Rows[0]["CGJEDGL"].ToString();
                    zyjs.CGJSJGL        = dt.Rows[0]["CGJSJGL"].ToString();
                    zyjs.CGJGLWC        = dt.Rows[0]["CGJGLWC"].ToString();
                    zyjs.CGJVITRUALTIME = dt.Rows[0]["CGJVITRUALTIME"].ToString();
                    zyjs.CGJREALTIME    = dt.Rows[0]["CGJREALTIME"].ToString();
                    zyjs.CGJTIMEWC      = dt.Rows[0]["CGJTIMEWC"].ToString();
                    zyjs.LLJTX          = dt.Rows[0]["LLJTX"].ToString();
                    zyjs.LLJLL          = dt.Rows[0]["LLJLL"].ToString();
                    zyjs.ZSJTX          = dt.Rows[0]["ZSJTX"].ToString();
                    zyjs.ZSJLC          = dt.Rows[0]["ZSJLC"].ToString();


                    zyjs.HSSlideActualTime      = dt.Rows[0]["HSSlideActualTime"].ToString();
                    zyjs.HSSlideTheoreticalTime = dt.Rows[0]["HSSlideTheoreticalTime"].ToString();
                    zyjs.HSSlideLoadPower       = dt.Rows[0]["HSSlideLoadPower"].ToString();
                    zyjs.HSSlideBeginTime       = dt.Rows[0]["HSSlideBeginTime"].ToString();
                    zyjs.HSSlideEndTime         = dt.Rows[0]["HSSlideEndTime"].ToString();
                    zyjs.LSSlideActualTime      = dt.Rows[0]["LSSlideActualTime"].ToString();
                    zyjs.LSSlideTheoreticalTime = dt.Rows[0]["LSSlideTheoreticalTime"].ToString();
                    zyjs.LSSlideLoadPower       = dt.Rows[0]["LSSlideLoadPower"].ToString();
                    zyjs.LSSlideBeginTime       = dt.Rows[0]["LSSlideBeginTime"].ToString();
                    zyjs.LSSlideEndTime         = dt.Rows[0]["LSSlideEndTime"].ToString();
                    zyjs.WattlessMaxSpeed1      = dt.Rows[0]["WattlessMaxSpeed1"].ToString();
                    zyjs.WattlessMinSpeed1      = dt.Rows[0]["WattlessMinSpeed1"].ToString();
                    zyjs.WattlessNorminalSpeed1 = dt.Rows[0]["WattlessNorminalSpeed1"].ToString();
                    zyjs.WattlessBeginTime1     = dt.Rows[0]["WattlessBeginTime1"].ToString();
                    zyjs.WattlessEndTime1       = dt.Rows[0]["WattlessEndTime1"].ToString();
                    zyjs.WattlessOutput1        = dt.Rows[0]["WattlessOutput1"].ToString();
                    zyjs.WattlessMaxSpeed2      = dt.Rows[0]["WattlessMaxSpeed2"].ToString();
                    zyjs.WattlessMinSpeed2      = dt.Rows[0]["WattlessMinSpeed2"].ToString();
                    zyjs.WattlessNorminalSpeed2 = dt.Rows[0]["WattlessNorminalSpeed2"].ToString();
                    zyjs.WattlessBeginTime2     = dt.Rows[0]["WattlessBeginTime2"].ToString();
                    zyjs.WattlessEndTime2       = dt.Rows[0]["WattlessEndTime2"].ToString();
                    zyjs.WattlessOutput2        = dt.Rows[0]["WattlessOutput2"].ToString();
                    zyjs.WattlessMaxSpeed3      = dt.Rows[0]["WattlessMaxSpeed3"].ToString();
                    zyjs.WattlessMinSpeed3      = dt.Rows[0]["WattlessMinSpeed3"].ToString();
                    zyjs.WattlessNorminalSpeed3 = dt.Rows[0]["WattlessNorminalSpeed3"].ToString();
                    zyjs.WattlessBeginTime3     = dt.Rows[0]["WattlessBeginTime3"].ToString();
                    zyjs.WattlessEndTime3       = dt.Rows[0]["WattlessEndTime3"].ToString();
                    zyjs.WattlessOutput3        = dt.Rows[0]["WattlessOutput3"].ToString();
                    zyjs.WattlessMaxSpeed4      = dt.Rows[0]["WattlessMaxSpeed4"].ToString();
                    zyjs.WattlessMinSpeed4      = dt.Rows[0]["WattlessMinSpeed4"].ToString();
                    zyjs.WattlessNorminalSpeed4 = dt.Rows[0]["WattlessNorminalSpeed4"].ToString();
                    zyjs.WattlessBeginTime4     = dt.Rows[0]["WattlessBeginTime4"].ToString();
                    zyjs.WattlessEndTime4       = dt.Rows[0]["WattlessEndTime4"].ToString();
                    zyjs.WattlessOutput4        = dt.Rows[0]["WattlessOutput4"].ToString();
                    zyjs.O2MRBeginTime          = dt.Rows[0]["O2MRBeginTime"].ToString();
                    zyjs.O2MREndTime            = dt.Rows[0]["O2MREndTime"].ToString();
                    zyjs.WQBeginTime            = dt.Rows[0]["WQBeginTime"].ToString();
                    zyjs.WQEndTime     = dt.Rows[0]["WQEndTime"].ToString();
                    zyjs.SlideJudge    = dt.Rows[0]["SlideJudge"].ToString();
                    zyjs.WattlessJudge = dt.Rows[0]["WattlessJudge"].ToString();
                    zyjs.O2MRJudge     = dt.Rows[0]["O2MRJudge"].ToString();
                    zyjs.WQJudge       = dt.Rows[0]["WQJudge"].ToString();
                    zyjs.AllJudge      = dt.Rows[0]["AllJudge"].ToString();
                }
                else
                {
                    zyjs.ID = "-2";
                }
                return(zyjs);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 23
0
        public bool saveGlideData(GLIDE model)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [加载滑行试验] (");
            strSql.Append("STATIONID,"); //=@PZLX,");1
            strSql.Append("LINEID,");    //=@JCCLPH,");2
            strSql.Append("HXQJ,");      //=@CLXHBH,");3
            strSql.Append("QJMYSD,");    //=@CLXHBH,");3
            strSql.Append("PLHP,");      //=@JCCS,");4
            strSql.Append("CCDT,");      //=@CCRQ,");5
            strSql.Append("ACDT,");      //=@DJRQ,"); 6
            strSql.Append("WC,");        //=@FDJH,");7
            strSql.Append("JZSDGL,");    //=@CJH,");8
            strSql.Append("BZSM,");      //=@LCBDS,");12
            strSql.Append("BDJG,");      //=@HBBZ,");13
            strSql.Append("BDRQ) ");     //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@HXQJ,@QJMYSD,@PLHP,@CCDT,@ACDT,@WC,@JZSDGL,@BZSM,@BDJG,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID", SqlDbType.VarChar,  50),
                new SqlParameter("@LINEID",    SqlDbType.VarChar,  50),
                new SqlParameter("@HXQJ",      SqlDbType.VarChar,  50),
                new SqlParameter("@QJMYSD",    SqlDbType.VarChar, 100),
                new SqlParameter("@PLHP",      SqlDbType.VarChar,  50),
                new SqlParameter("@CCDT",      SqlDbType.VarChar,  50),
                new SqlParameter("@ACDT",      SqlDbType.VarChar,  50),
                new SqlParameter("@WC",        SqlDbType.VarChar,  50),
                new SqlParameter("@JZSDGL",    SqlDbType.VarChar,  50),
                new SqlParameter("@BZSM",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDJG",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDRQ",      SqlDbType.DateTime)
            };
            parameters[i++].Value = model.STATIONID;
            parameters[i++].Value = model.LINEID;
            parameters[i++].Value = model.HXQJ;
            parameters[i++].Value = model.QJMYSD;
            parameters[i++].Value = model.PLHP;
            parameters[i++].Value = model.CCDT;
            parameters[i++].Value = model.ACDT;
            parameters[i++].Value = model.WC;
            parameters[i++].Value = model.JZSDGL;
            parameters[i++].Value = model.BZSM;
            parameters[i++].Value = model.BDJG;
            parameters[i++].Value = model.BDRQ;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 用Zyjs_Btg对象插入或更新条检测数据
        /// </summary>
        /// <param name="zyjs">Zyjs_Btg</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_SelfCheckData(selfcheckdata zyjs)
        {
            string sqli = "insert into [自检记录](ID,WORKTIME,WORKER,ISQXZCHECK,ISFQYCHECK,ISBTGCHECK,ISCGJCHECK,ISLLJCHECK,ISZSJCHECK,TEMPOK,HUMIOK,AIRPOK,TEMP,HUMI,AIRP,FQYTX,FQYYR,FQYTL,FQYJL,FQYLC,FQYO2,BTGTX,BTGYR,BTGTL,BTGLC,BTGJZ,CGJTX,CGJYR,CGJQL,CGJJSGL,CGJJZHX,CGJEDGL,CGJSJGL,CGJGLWC,CGJVITRUALTIME,CGJREALTIME,CGJTIMEWC,LLJTX,LLJLL,ZSJTX,ZSJLC," +
                          "HSSlideBeginTime, HSSlideEndTime, HSSlideTheoreticalTime, HSSlideActualTime, HSSlideLoadPower, LSSlideBeginTime, LSSlideEndTime, LSSlideTheoreticalTime, LSSlideActualTime, LSSlideLoadPower," +
                          "WattlessMaxSpeed1,WattlessMinSpeed1,WattlessNorminalSpeed1,WattlessBeginTime1,WattlessEndTime1,WattlessOutput1," +
                          "WattlessMaxSpeed2,WattlessMinSpeed2,WattlessNorminalSpeed2,WattlessBeginTime2,WattlessEndTime2,WattlessOutput2," +
                          "WattlessMaxSpeed3,WattlessMinSpeed3,WattlessNorminalSpeed3,WattlessBeginTime3,WattlessEndTime3,WattlessOutput3," +
                          "WattlessMaxSpeed4,WattlessMinSpeed4,WattlessNorminalSpeed4,WattlessBeginTime4,WattlessEndTime4,WattlessOutput4," +
                          "O2MRBeginTime,O2MREndTime,WQBeginTime,WQEndTime,SlideJudge,WattlessJudge,O2MRJudge,WQJudge,AllJudge)" +
                          " values(@ID,@WORKTIME,@WORKER,@ISQXZCHECK,@ISFQYCHECK,@ISBTGCHECK,@ISCGJCHECK,@ISLLJCHECK,@ISZSJCHECK,@TEMPOK,@HUMIOK,@AIRPOK,@TEMP,@HUMI,@AIRP,@FQYTX,@FQYYR,@FQYTL,@FQYJL,@FQYLC,@FQYO2,@BTGTX,@BTGYR,@BTGTL,@BTGLC,@BTGJZ,@CGJTX,@CGJYR,@CGJQL,@CGJJSGL,@CGJJZHX,@CGJEDGL,@CGJSJGL,@CGJGLWC,@CGJVITRUALTIME,@CGJREALTIME,@CGJTIMEWC,@LLJTX,@LLJLL,@ZSJTX,@ZSJLC," +
                          "@HSSlideBeginTime, @HSSlideEndTime, @HSSlideTheoreticalTime, @HSSlideActualTime, @HSSlideLoadPower, @LSSlideBeginTime, @LSSlideEndTime, @LSSlideTheoreticalTime, @LSSlideActualTime, @LSSlideLoadPower," +
                          "@WattlessMaxSpeed1,@WattlessMinSpeed1,@WattlessNorminalSpeed1,@WattlessBeginTime1,@WattlessEndTime1,@WattlessOutput1," +
                          "@WattlessMaxSpeed2,@WattlessMinSpeed2,@WattlessNorminalSpeed2,@WattlessBeginTime2,@WattlessEndTime2,@WattlessOutput2," +
                          "@WattlessMaxSpeed3,@WattlessMinSpeed3,@WattlessNorminalSpeed3,@WattlessBeginTime3,@WattlessEndTime3,@WattlessOutput3," +
                          "@WattlessMaxSpeed4,@WattlessMinSpeed4,@WattlessNorminalSpeed4,@WattlessBeginTime4,@WattlessEndTime4,@WattlessOutput4," +
                          "@O2MRBeginTime,@O2MREndTime,@WQBeginTime,@WQEndTime,@SlideJudge,@WattlessJudge,@O2MRJudge,@WQJudge,@AllJudge" +
                          ")";
            string sqlu = "update [自检记录] set WORKTIME=@WORKTIME,WORKER=@WORKER,ISQXZCHECK=@ISQXZCHECK,ISFQYCHECK=@ISFQYCHECK,ISBTGCHECK=@ISBTGCHECK,ISCGJCHECK=@ISCGJCHECK,ISLLJCHECK=@ISLLJCHECK,ISZSJCHECK=@ISZSJCHECK,TEMPOK=@TEMPOK,HUMIOK=@HUMIOK,AIRPOK=@AIRPOK,TEMP=@TEMP,HUMI=@HUMI,AIRP=@AIRP,FQYTX=@FQYTX,FQYYR=@FQYYR,FQYTL=@FQYTL,FQYJL=@FQYJL,FQYLC=@FQYLC,FQYO2=@FQYO2,BTGTX=@BTGTX,BTGYR=@BTGYR,BTGTL=@BTGTL,BTGLC=@BTGLC,BTGJZ=@BTGJZ,CGJTX=@CGJTX,CGJYR=@CGJYR,CGJQL=@CGJQL,CGJJSGL=@CGJJSGL,CGJJZHX=@CGJJZHX,CGJEDGL=@CGJEDGL,CGJSJGL=@CGJSJGL,CGJGLWC=@CGJGLWC,CGJVITRUALTIME=@CGJVITRUALTIME,CGJREALTIME=@CGJREALTIME,CGJTIMEWC=@CGJTIMEWC,LLJTX=@LLJTX,LLJLL=@LLJLL,ZSJTX=@ZSJTX,ZSJLC=@ZSJLC," +
                          "HSSlideBeginTime=@HSSlideBeginTime, HSSlideEndTime=@HSSlideEndTime, HSSlideTheoreticalTime=@HSSlideTheoreticalTime, HSSlideActualTime=@HSSlideActualTime, HSSlideLoadPower=@HSSlideLoadPower, LSSlideBeginTime=@LSSlideBeginTime, LSSlideEndTime=@LSSlideEndTime, LSSlideTheoreticalTime=@LSSlideTheoreticalTime, LSSlideActualTime=@LSSlideActualTime, LSSlideLoadPower=@LSSlideLoadPower," +
                          "WattlessMaxSpeed1=@WattlessMaxSpeed1,WattlessMinSpeed1=@WattlessMinSpeed1,WattlessNorminalSpeed1=@WattlessNorminalSpeed1,WattlessBeginTime1=@WattlessBeginTime1,WattlessEndTime1=@WattlessEndTime1,WattlessOutput1=@WattlessOutput1," +
                          "WattlessMaxSpeed2=@WattlessMaxSpeed2,WattlessMinSpeed2=@WattlessMinSpeed2,WattlessNorminalSpeed2=@WattlessNorminalSpeed2,WattlessBeginTime2=@WattlessBeginTime2,WattlessEndTime2=@WattlessEndTime2,WattlessOutput2=@WattlessOutput2," +
                          "WattlessMaxSpeed3=@WattlessMaxSpeed3,WattlessMinSpeed3=@WattlessMinSpeed3,WattlessNorminalSpeed3=@WattlessNorminalSpeed3,WattlessBeginTime3=@WattlessBeginTime3,WattlessEndTime3=@WattlessEndTime3,WattlessOutput3=@WattlessOutput3," +
                          "WattlessMaxSpeed4=@WattlessMaxSpeed4,WattlessMinSpeed4=@WattlessMinSpeed4,WattlessNorminalSpeed4=@WattlessNorminalSpeed4,WattlessBeginTime4=@WattlessBeginTime4,WattlessEndTime4=@WattlessEndTime4,WattlessOutput4=@WattlessOutput4," +
                          "O2MRBeginTime=@O2MRBeginTime,O2MREndTime=@O2MREndTime,WQBeginTime=@WQBeginTime,WQEndTime=@WQEndTime,SlideJudge=@SlideJudge,WattlessJudge=@WattlessJudge,O2MRJudge=@O2MRJudge,WQJudge=@WQJudge,AllJudge=@AllJudge " +

                          "where ID=@ID";

            SqlParameter[] spr =
            {
                new SqlParameter("@ID",                     zyjs.ID),
                new SqlParameter("@WORKTIME",               zyjs.WORKTIME),
                new SqlParameter("@WORKER",                 zyjs.WORKER),
                new SqlParameter("@ISQXZCHECK",             zyjs.ISQXZCHECK),
                new SqlParameter("@ISFQYCHECK",             zyjs.ISFQYCHECK),
                new SqlParameter("@ISBTGCHECK",             zyjs.ISBTGCHECK),
                new SqlParameter("@ISCGJCHECK",             zyjs.ISCGJCHECK),
                new SqlParameter("@ISLLJCHECK",             zyjs.ISLLJCHECK),
                new SqlParameter("@ISZSJCHECK",             zyjs.ISZSJCHECK),
                new SqlParameter("@TEMPOK",                 zyjs.TEMPOK),
                new SqlParameter("@HUMIOK",                 zyjs.HUMIOK),
                new SqlParameter("@AIRPOK",                 zyjs.AIRPOK),
                new SqlParameter("@TEMP",                   zyjs.TEMP),
                new SqlParameter("@HUMI",                   zyjs.HUMI),
                new SqlParameter("@AIRP",                   zyjs.AIRP),
                new SqlParameter("@FQYTX",                  zyjs.FQYTX),
                new SqlParameter("@FQYYR",                  zyjs.FQYYR),
                new SqlParameter("@FQYTL",                  zyjs.FQYTL),
                new SqlParameter("@FQYJL",                  zyjs.FQYJL),
                new SqlParameter("@FQYLC",                  zyjs.FQYLC),
                new SqlParameter("@FQYO2",                  zyjs.FQYO2),
                new SqlParameter("@BTGTX",                  zyjs.BTGTX),
                new SqlParameter("@BTGYR",                  zyjs.BTGYR),
                new SqlParameter("@BTGTL",                  zyjs.BTGTL),
                new SqlParameter("@BTGLC",                  zyjs.BTGLC),
                new SqlParameter("@BTGJZ",                  zyjs.BTGJZ),
                new SqlParameter("@CGJTX",                  zyjs.CGJTX),
                new SqlParameter("@CGJYR",                  zyjs.CGJYR),
                new SqlParameter("@CGJQL",                  zyjs.CGJQL),
                new SqlParameter("@CGJJSGL",                zyjs.CGJJSGL),
                new SqlParameter("@CGJJZHX",                zyjs.CGJJZHX),
                new SqlParameter("@CGJEDGL",                zyjs.CGJEDGL),
                new SqlParameter("@CGJSJGL",                zyjs.CGJSJGL),
                new SqlParameter("@CGJGLWC",                zyjs.CGJGLWC),
                new SqlParameter("@CGJVITRUALTIME",         zyjs.CGJVITRUALTIME),
                new SqlParameter("@CGJREALTIME",            zyjs.CGJREALTIME),
                new SqlParameter("@CGJTIMEWC",              zyjs.CGJTIMEWC),
                new SqlParameter("@LLJTX",                  zyjs.LLJTX),
                new SqlParameter("@LLJLL",                  zyjs.LLJLL),
                new SqlParameter("@ZSJTX",                  zyjs.ZSJTX),
                new SqlParameter("@ZSJLC",                  zyjs.ZSJLC),

                new SqlParameter("@HSSlideActualTime",      zyjs.HSSlideActualTime),
                new SqlParameter("@HSSlideTheoreticalTime", zyjs.HSSlideTheoreticalTime),
                new SqlParameter("@HSSlideLoadPower",       zyjs.HSSlideLoadPower),
                new SqlParameter("@HSSlideBeginTime",       zyjs.HSSlideBeginTime),
                new SqlParameter("@HSSlideEndTime",         zyjs.HSSlideEndTime),
                new SqlParameter("@LSSlideActualTime",      zyjs.LSSlideActualTime),
                new SqlParameter("@LSSlideTheoreticalTime", zyjs.LSSlideTheoreticalTime),
                new SqlParameter("@LSSlideLoadPower",       zyjs.LSSlideLoadPower),
                new SqlParameter("@LSSlideBeginTime",       zyjs.LSSlideBeginTime),
                new SqlParameter("@LSSlideEndTime",         zyjs.LSSlideEndTime),
                new SqlParameter("@WattlessMaxSpeed1",      zyjs.WattlessMaxSpeed1),
                new SqlParameter("@WattlessMinSpeed1",      zyjs.WattlessMinSpeed1),
                new SqlParameter("@WattlessNorminalSpeed1", zyjs.WattlessNorminalSpeed1),
                new SqlParameter("@WattlessBeginTime1",     zyjs.WattlessBeginTime1),
                new SqlParameter("@WattlessEndTime1",       zyjs.WattlessEndTime1),
                new SqlParameter("@WattlessOutput1",        zyjs.WattlessOutput1),
                new SqlParameter("@WattlessMaxSpeed2",      zyjs.WattlessMaxSpeed2),
                new SqlParameter("@WattlessMinSpeed2",      zyjs.WattlessMinSpeed2),
                new SqlParameter("@WattlessNorminalSpeed2", zyjs.WattlessNorminalSpeed2),
                new SqlParameter("@WattlessBeginTime2",     zyjs.WattlessBeginTime2),
                new SqlParameter("@WattlessEndTime2",       zyjs.WattlessEndTime2),
                new SqlParameter("@WattlessOutput2",        zyjs.WattlessOutput2),
                new SqlParameter("@WattlessMaxSpeed3",      zyjs.WattlessMaxSpeed3),
                new SqlParameter("@WattlessMinSpeed3",      zyjs.WattlessMinSpeed3),
                new SqlParameter("@WattlessNorminalSpeed3", zyjs.WattlessNorminalSpeed3),
                new SqlParameter("@WattlessBeginTime3",     zyjs.WattlessBeginTime3),
                new SqlParameter("@WattlessEndTime3",       zyjs.WattlessEndTime3),
                new SqlParameter("@WattlessOutput3",        zyjs.WattlessOutput3),
                new SqlParameter("@WattlessMaxSpeed4",      zyjs.WattlessMaxSpeed4),
                new SqlParameter("@WattlessMinSpeed4",      zyjs.WattlessMinSpeed4),
                new SqlParameter("@WattlessNorminalSpeed4", zyjs.WattlessNorminalSpeed4),
                new SqlParameter("@WattlessBeginTime4",     zyjs.WattlessBeginTime4),
                new SqlParameter("@WattlessEndTime4",       zyjs.WattlessEndTime4),
                new SqlParameter("@WattlessOutput4",        zyjs.WattlessOutput4),
                new SqlParameter("@O2MRBeginTime",          zyjs.O2MRBeginTime),
                new SqlParameter("@O2MREndTime",            zyjs.O2MREndTime),
                new SqlParameter("@WQBeginTime",            zyjs.WQBeginTime),
                new SqlParameter("@WQEndTime",              zyjs.WQEndTime),
                new SqlParameter("@SlideJudge",             zyjs.SlideJudge),
                new SqlParameter("@WattlessJudge",          zyjs.WattlessJudge),
                new SqlParameter("@O2MRJudge",              zyjs.O2MRJudge),
                new SqlParameter("@WQJudge",                zyjs.WQJudge),
                new SqlParameter("@AllJudge",               zyjs.AllJudge)
            };
            try
            {
                if (Have_SelfCheckData(zyjs.ID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception er)
            {
                throw;
            }
        }
Ejemplo n.º 25
0
        public bool saveInertnessData(INERTNESS model)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [惯量测试] (");
            strSql.Append("STATIONID,");  //=@PZLX,");1
            strSql.Append("LINEID,");     //=@JCCLPH,");2
            strSql.Append("T1POWER,");    //=@CLXHBH,");3
            strSql.Append("T2POWER,");    //=@CLXHBH,");3
            strSql.Append("STARTSPEED,"); //=@JCCS,");4
            strSql.Append("ENDSPEED,");   //=@CCRQ,");5
            strSql.Append("ACD1_1,");     //=@DJRQ,"); 6
            strSql.Append("ACD1_2,");     //=@FDJH,");7
            strSql.Append("ACD1_3,");     //=@CJH,");8
            strSql.Append("ACD1,");       //=@CZ,");9
            strSql.Append("ACD2_1,");     //=@DJRQ,"); 6
            strSql.Append("ACD2_2,");     //=@FDJH,");7
            strSql.Append("ACD2_3,");     //=@CJH,");8
            strSql.Append("ACD2,");       //=@CZ,");9
            strSql.Append("DIW_1,");      //=@DJRQ,"); 6
            strSql.Append("DIW_2,");      //=@FDJH,");7
            strSql.Append("DIW_3,");      //=@CJH,");8
            strSql.Append("DIW,");        //=@CZ,");9
            strSql.Append("DIW_BC,");     //=@CZDH,");10
            strSql.Append("DIW_SC,");     //=@CZDZ,");11
            strSql.Append("WC,");         //=@CZ,");9
            strSql.Append("PD,");         //=@CZDH,");10
            strSql.Append("HXSJ,");       //=@CZDZ,");11
            strSql.Append("BZ,");         //=@LCBDS,");12
            strSql.Append("BDJG,");       //=@HBBZ,");13
            strSql.Append("BDRQ) ");      //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@T1POWER,@T2POWER,@STARTSPEED,@ENDSPEED,@ACD1_1,@ACD1_2,@ACD1_3,@ACD1,@ACD2_1,@ACD2_2,@ACD2_3,@ACD2,@DIW_1,@DIW_2,@DIW_3,@DIW,@DIW_BC,@DIW_SC,@WC,@PD,@HXSJ,@BZ,@BDJG,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID",  SqlDbType.VarChar,  50),
                new SqlParameter("@LINEID",     SqlDbType.VarChar,  50),
                new SqlParameter("@T1POWER",    SqlDbType.VarChar,  50),
                new SqlParameter("@T2POWER",    SqlDbType.VarChar, 100),
                new SqlParameter("@STARTSPEED", SqlDbType.VarChar,  50),
                new SqlParameter("@ENDSPEED",   SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1_1",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1_2",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1_3",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD1",       SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2_1",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2_2",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2_3",     SqlDbType.VarChar,  50),
                new SqlParameter("@ACD2",       SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_1",      SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_2",      SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_3",      SqlDbType.VarChar,  50),
                new SqlParameter("@DIW",        SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_BC",     SqlDbType.VarChar,  50),
                new SqlParameter("@DIW_SC",     SqlDbType.VarChar,  50),
                new SqlParameter("@WC",         SqlDbType.VarChar,  50),
                new SqlParameter("@PD",         SqlDbType.VarChar,  50),
                new SqlParameter("@HXSJ",       SqlDbType.VarChar,  50),
                new SqlParameter("@BZ",         SqlDbType.VarChar,  50),
                new SqlParameter("@BDJG",       SqlDbType.VarChar,  50),
                new SqlParameter("@BDRQ",       SqlDbType.DateTime)
            };
            parameters[i++].Value = model.STATIONID;
            parameters[i++].Value = model.LINEID;
            parameters[i++].Value = model.T1POWER;
            parameters[i++].Value = model.T2POWER;
            parameters[i++].Value = model.STARTSPEED;
            parameters[i++].Value = model.ENDSPEED;
            parameters[i++].Value = model.ACD1_1;
            parameters[i++].Value = model.ACD1_2;
            parameters[i++].Value = model.ACD1_3;
            parameters[i++].Value = model.ACD1;
            parameters[i++].Value = model.ACD2_1;
            parameters[i++].Value = model.ACD2_2;
            parameters[i++].Value = model.ACD2_3;
            parameters[i++].Value = model.ACD2;
            parameters[i++].Value = model.DIW_1;
            parameters[i++].Value = model.DIW_2;
            parameters[i++].Value = model.DIW_3;
            parameters[i++].Value = model.DIW;
            parameters[i++].Value = model.DIW_BC;
            parameters[i++].Value = model.DIW_SC;
            parameters[i++].Value = model.WC;
            parameters[i++].Value = model.PD;
            parameters[i++].Value = model.HXSJ;
            parameters[i++].Value = model.BZ;
            parameters[i++].Value = model.BDJG;
            parameters[i++].Value = model.BDRQ;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 26
0
        public LINESBBD getLineDemarcateInf(string station, string line)
        {
            LINESBBD model = new LINESBBD();
            string   sql   = "select * from [设备标定] where STATIONID='" + station + "' and LINEID='" + line + "'";

            try
            {
                DataTable dt = DBHelperSQL.GetDataTable(sql, CommandType.Text);
                if (dt.Rows.Count > 0)
                {
                    model.STATIONID        = dt.Rows[0]["STATIONID"].ToString();
                    model.LINEID           = dt.Rows[0]["LINEID"].ToString();
                    model.Hxdate           = DateTime.Parse(dt.Rows[0]["HXDATE"].ToString());
                    model.Hxenable         = (dt.Rows[0]["HXENABLE"].ToString() == "Y");
                    model.Jsgldate         = DateTime.Parse(dt.Rows[0]["JSGLDATE"].ToString());
                    model.Jsglenable       = (dt.Rows[0]["JSGLENABLE"].ToString() == "Y");
                    model.Gldate           = DateTime.Parse(dt.Rows[0]["GLDATE"].ToString());
                    model.Glenable         = (dt.Rows[0]["GLENABLE"].ToString() == "Y");
                    model.Yrdate           = DateTime.Parse(dt.Rows[0]["YRDATE"].ToString());
                    model.Yrenable         = (dt.Rows[0]["YRENABLE"].ToString() == "Y");
                    model.Zjdate           = DateTime.Parse(dt.Rows[0]["ZJDATE"].ToString());
                    model.Zjenable         = (dt.Rows[0]["ZJENABLE"].ToString() == "Y");
                    model.Fxylowdate       = DateTime.Parse(dt.Rows[0]["FXYLOWDATE"].ToString());
                    model.Fxylowenable     = (dt.Rows[0]["FXYLOWENABLE"].ToString() == "Y");
                    model.Fxyhighdate      = DateTime.Parse(dt.Rows[0]["FXYHIGHDATE"].ToString());
                    model.Fxyhighenable    = (dt.Rows[0]["FXYHIGHENABLE"].ToString() == "Y");
                    model.Fxymiddate       = DateTime.Parse(dt.Rows[0]["FXYMIDDATE"].ToString());
                    model.Fxymidenable     = (dt.Rows[0]["FXYMIDENABLE"].ToString() == "Y");
                    model.Fxylowmiddate    = DateTime.Parse(dt.Rows[0]["FXYLOWMIDDATE"].ToString());
                    model.Fxylowmidenable  = (dt.Rows[0]["FXYLOWMIDENABLE"].ToString() == "Y");
                    model.Fxyhighmiddate   = DateTime.Parse(dt.Rows[0]["FXYHIGHMIDDATE"].ToString());
                    model.Fxyhighmidenable = (dt.Rows[0]["FXYHIGHMIDENABLE"].ToString() == "Y");
                    model.Ydjdate          = DateTime.Parse(dt.Rows[0]["YDJDATE"].ToString());
                    model.Ydjenable        = (dt.Rows[0]["YDJENABLE"].ToString() == "Y");
                    model.Lljdate          = DateTime.Parse(dt.Rows[0]["LLJDATE"].ToString());
                    model.Lljenable        = (dt.Rows[0]["LLJENABLE"].ToString() == "Y");
                    model.Yljdate          = DateTime.Parse(dt.Rows[0]["YLJDATE"].ToString());
                    model.Yljenable        = (dt.Rows[0]["YLJENABLE"].ToString() == "Y");
                    model.Sddate           = DateTime.Parse(dt.Rows[0]["SDDATE"].ToString());
                    model.Sdenable         = (dt.Rows[0]["SDENABLE"].ToString() == "Y");
                    model.Hjcsdate         = DateTime.Parse(dt.Rows[0]["HJCSDATE"].ToString());
                    model.Hjcsenable       = (dt.Rows[0]["HJCSENABLE"].ToString() == "Y");
                    model.Zsjdate          = DateTime.Parse(dt.Rows[0]["ZSJDATE"].ToString());
                    model.Zsjenable        = (dt.Rows[0]["ZSJENABLE"].ToString() == "Y");
                    model.Jldate           = DateTime.Parse(dt.Rows[0]["JLDATE"].ToString());
                    model.Jlenable         = (dt.Rows[0]["JLENABLE"].ToString() == "Y");
                }
                else
                {
                    model.STATIONID        = station;
                    model.LINEID           = line;
                    model.Hxdate           = DateTime.Now;
                    model.Hxenable         = true;
                    model.Jsgldate         = DateTime.Now;
                    model.Jsglenable       = true;
                    model.Gldate           = DateTime.Now;
                    model.Glenable         = true;
                    model.Yrdate           = DateTime.Now;
                    model.Yrenable         = true;
                    model.Zjdate           = DateTime.Now;
                    model.Zjenable         = true;
                    model.Fxylowdate       = DateTime.Now;
                    model.Fxylowenable     = true;
                    model.Fxyhighdate      = DateTime.Now;
                    model.Fxyhighenable    = true;
                    model.Fxymiddate       = DateTime.Now;
                    model.Fxymidenable     = true;
                    model.Fxylowmiddate    = DateTime.Now;
                    model.Fxylowmidenable  = false;
                    model.Fxyhighmiddate   = DateTime.Now;
                    model.Fxyhighmidenable = false;
                    model.Ydjdate          = DateTime.Now;
                    model.Ydjenable        = true;
                    model.Lljdate          = DateTime.Now;
                    model.Lljenable        = true;
                    model.Yljdate          = DateTime.Now;
                    model.Yljenable        = true;
                    model.Sddate           = DateTime.Now;
                    model.Sdenable         = true;
                    model.Hjcsdate         = DateTime.Now;
                    model.Hjcsenable       = true;
                    model.Zsjdate          = DateTime.Now;
                    model.Zsjenable        = true;
                    model.Jldate           = DateTime.Now;
                    model.Jlenable         = true;
                }
            }
            catch (Exception)
            {
                model.STATIONID        = station;
                model.LINEID           = line;
                model.Hxdate           = DateTime.Now;
                model.Hxenable         = true;
                model.Jsgldate         = DateTime.Now;
                model.Jsglenable       = true;
                model.Gldate           = DateTime.Now;
                model.Glenable         = true;
                model.Yrdate           = DateTime.Now;
                model.Yrenable         = true;
                model.Zjdate           = DateTime.Now;
                model.Zjenable         = true;
                model.Fxylowdate       = DateTime.Now;
                model.Fxylowenable     = true;
                model.Fxyhighdate      = DateTime.Now;
                model.Fxyhighenable    = true;
                model.Fxymiddate       = DateTime.Now;
                model.Fxymidenable     = true;
                model.Fxylowmiddate    = DateTime.Now;
                model.Fxylowmidenable  = false;
                model.Fxyhighmiddate   = DateTime.Now;
                model.Fxyhighmidenable = false;
                model.Ydjdate          = DateTime.Now;
                model.Ydjenable        = true;
                model.Lljdate          = DateTime.Now;
                model.Lljenable        = true;
                model.Yljdate          = DateTime.Now;
                model.Yljenable        = true;
                model.Sddate           = DateTime.Now;
                model.Sdenable         = true;
                model.Hjcsdate         = DateTime.Now;
                model.Hjcsenable       = true;
                model.Zsjdate          = DateTime.Now;
                model.Zsjenable        = true;
                model.Jldate           = DateTime.Now;
                model.Jlenable         = true;
            }
            return(model);
        }
Ejemplo n.º 27
0
        public bool saveAnalysisDataByIni(analysismeterInidata model, string stationid, string lineid, DateTime bdrq)
        {
            int           i      = 0;
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [废气仪标定] (");
            strSql.Append("STATIONID,"); //=@PZLX,");1
            strSql.Append("LINEID,");    //=@JCCLPH,");2
            strSql.Append("CO2BZ,");     //=@CLXHBH,");3
            strSql.Append("CO2CLZ,");    //=@CLXHBH,");3
            strSql.Append("COBZ,");      //=@JCCS,");4
            strSql.Append("COCLZ,");     //=@CCRQ,");5
            strSql.Append("HCBZ,");      //=@DJRQ,"); 6
            strSql.Append("HCCLZ,");     //=@FDJH,");7
            strSql.Append("NOBZ,");      //=@CJH,");8
            strSql.Append("NOCLZ,");     //=@CZ,");9
            strSql.Append("JZDS,");      //=@CZDH,");10
            strSql.Append("GDJZ,");      //=@CZDZ,");11
            strSql.Append("BZSM,");      //=@LCBDS,");12
            strSql.Append("BDJG,");      //=@HBBZ,");13
            strSql.Append("BDRQ) ");     //=@SYQK,");14
            strSql.Append("values (@STATIONID,@LINEID,@CO2BZ,@CO2CLZ,@COBZ,@COCLZ,@HCBZ,@HCCLZ,@NOBZ,@NOCLZ,@JZDS,@GDJZ,@BZSM,@BDJG,@BDRQ)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@STATIONID", SqlDbType.VarChar,  50),
                new SqlParameter("@LINEID",    SqlDbType.VarChar,  50),
                new SqlParameter("@CO2BZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@CO2CLZ",    SqlDbType.VarChar, 100),
                new SqlParameter("@COBZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@COCLZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@HCBZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@HCCLZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@NOBZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@NOCLZ",     SqlDbType.VarChar,  50),
                new SqlParameter("@JZDS",      SqlDbType.VarChar,  50),
                new SqlParameter("@GDJZ",      SqlDbType.VarChar,  50),
                new SqlParameter("@BZSM",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDJG",      SqlDbType.VarChar,  50),
                new SqlParameter("@BDRQ",      SqlDbType.DateTime)
            };
            parameters[i++].Value = stationid;
            parameters[i++].Value = lineid;
            parameters[i++].Value = model.Co2bz.ToString("0.00");
            parameters[i++].Value = model.Co2clz.ToString("0.00");
            parameters[i++].Value = model.Cobz.ToString("0.00");
            parameters[i++].Value = model.Coclz.ToString("0.00");
            parameters[i++].Value = model.Hcbz.ToString("0.00");
            parameters[i++].Value = model.Hcclz.ToString("0.00");
            parameters[i++].Value = model.Nobz.ToString("0.00");
            parameters[i++].Value = model.Noclz.ToString("0.00");
            parameters[i++].Value = model.Jzds.ToString();
            parameters[i++].Value = model.Gdjz;
            parameters[i++].Value = model.Bzsm;
            parameters[i++].Value = model.Bdjg;
            parameters[i++].Value = bdrq;
            try
            {
                if (DBHelperSQL.Execute(strSql.ToString(), parameters) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 28
0
        public stationInfModel   getStationInf(string stationid)
        {
            stationInfModel model = new stationInfModel();
            string          sql   = "select * from stationNormalInf";
            DateTime        datetimemodel;

            try
            {
                DataTable dt = DBHelperSQL.GetDataTable(sql, CommandType.Text);
                if (dt.Rows.Count > 0)
                {
                    model.STATIONID      = dt.Rows[0]["STATIONID"].ToString();
                    model.STATIONADD     = dt.Rows[0]["STATIONADD"].ToString();
                    model.STATIONNAME    = dt.Rows[0]["STATIONNAME"].ToString();
                    model.STATIONPERSON  = dt.Rows[0]["STATIONPERSON"].ToString();
                    model.STATIONPHONE   = dt.Rows[0]["STATIONPHONE"].ToString();
                    model.STATIONDATE    = dt.Rows[0]["STATIONDATE"].ToString();
                    model.STATIONJCFF    = dt.Rows[0]["STATIONJCFF"].ToString();
                    model.STANDARD       = dt.Rows[0]["STANDARD"].ToString();
                    model.STATIONNET     = dt.Rows[0]["STATIONNET"].ToString();
                    model.StationCompany = dt.Rows[0]["STATIONCOMPANY"].ToString();

                    model.JCZXKZH = dt.Rows[0]["JCZXKZH"].ToString();
                    model.SBHZBH  = dt.Rows[0]["SBHZBH"].ToString();
                    if (DateTime.TryParse(dt.Rows[0]["YXQSTARTTIME"].ToString(), out datetimemodel))
                    {
                        model.YXQSTARTTIME = datetimemodel;
                    }
                    else
                    {
                        model.YXQSTARTTIME = DateTime.Now;
                    }
                    if (DateTime.TryParse(dt.Rows[0]["YXQENDTIME"].ToString(), out datetimemodel))
                    {
                        model.YXQENDTIME = datetimemodel;
                    }
                    else
                    {
                        model.YXQENDTIME = DateTime.Now;
                    }
                    model.ISLOCK     = (dt.Rows[0]["ISLOCK"].ToString() == "Y");
                    model.LOCKREASON = dt.Rows[0]["LOCKREASON"].ToString();
                    if (dt.Columns.Contains("CLEARMODE"))
                    {
                        model.CLEARMODE = dt.Rows[0]["CLEARMODE"].ToString();
                    }
                    else
                    {
                        model.CLEARMODE = "Y";
                    }
                    if (dt.Columns.Contains("JJLX"))
                    {
                        model.JJLX = dt.Rows[0]["JJLX"].ToString();
                        model.LXR  = dt.Rows[0]["LXR"].ToString();
                        model.FZR  = dt.Rows[0]["FZR"].ToString();
                        if (DateTime.TryParse(dt.Rows[0]["ZCSJ"].ToString(), out datetimemodel))
                        {
                            model.ZCSJ = datetimemodel;
                        }
                        else
                        {
                            model.ZCSJ = DateTime.Now;
                        }
                    }
                    else
                    {
                        model.JJLX = "";
                        model.LXR  = "";
                        model.FZR  = "";
                        model.ZCSJ = DateTime.Now;
                    }
                    if (dt.Columns.Contains("JCXS"))
                    {
                        model.JCXS = dt.Rows[0]["JCXS"].ToString();
                    }
                    else
                    {
                        model.JCXS = "";
                    }
                    if (dt.Columns.Contains("STATIONCOUNTDATE"))
                    {
                        if (DateTime.TryParse(dt.Rows[0]["STATIONCOUNTDATE"].ToString(), out datetimemodel))
                        {
                            model.STATIONCOUNTDATE = datetimemodel;
                        }
                        else
                        {
                            model.STATIONCOUNTDATE = DateTime.Now.AddDays(-1);
                        }
                        if (DateTime.TryParse(dt.Rows[0]["LOGINCOUNTDATE"].ToString(), out datetimemodel))
                        {
                            model.LOGINCOUNTDATE = datetimemodel;
                        }
                        else
                        {
                            model.LOGINCOUNTDATE = DateTime.Now.AddDays(-1);
                        }
                    }
                    else
                    {
                        model.STATIONCOUNTDATE = DateTime.Now.AddDays(-1);
                        model.LOGINCOUNTDATE   = DateTime.Now.AddDays(-1);
                    }
                    if (dt.Columns.Contains("LSHRULE"))
                    {
                        model.LSHRULE = dt.Rows[0]["LSHRULE"].ToString();
                        if (model.LSHRULE == "")
                        {
                            model.LSHRULE = "通用";
                        }
                    }
                    else
                    {
                        model.LSHRULE = "通用";
                    }
                }
                else
                {
                    model.STATIONID = "-2";       //当服务器上没有找到本线时,本线编号置为-2,以免为0
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(model);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 用SDS对象插入或更新条检测数据
        /// </summary>
        /// <param name="SDS">SDS</param>
        /// <returns>int 0为失败,1为插入成功,2为更新成功</returns>
        public int Save_SDS(SDS SDS)
        {
            string sqli = "insert into SDS(JYLSH,JYCS,SBRZBM,CLID,JCBGBH,CLPH,COLOWCLZ,COLOWXZ,HCLOWCLZ,HCLOWXZ,COHIGHCLZ,COHIGHXZ,HCHIGHCLZ,HCHIGHXZ,LAMDAHIGHCLZ,LAMDAHIGHXZ,LAMDAHIGHPD,LOWPD,HIGHPD,ZHPD,JCRQ,WD,SD,DQY,SBMC,SBXH,SBZZC,FXYXH,FXYBH,FXYZZC,ZSJXH,ZSJBH,ZSJZZC,COLOWPD,HCLOWPD,ZSLOW,JYWDLOW,COHIGHPD,HCHIGHPD,ZSHIGH,JYWDHIGH,SHY,SYNCHDATE,YW,GLKQXSSX,GLKQXSXX,JCKSSJ,JCJSSJ,CO2HIGH,O2HIGH,CO2LOW,O2LOW,COLOWXXZ,COHIGHXXZ,COLOWXYZ,COHIGHXYZ,CO2LOWXYZ,CO2HIGHXYZ,HCLOWXYZ,HCHIGHXYZ) values(@JYLSH,@JYCS,@SBRZBM,@CLID,@JCBGBH,@CLPH,@COLOWCLZ,@COLOWXZ,@HCLOWCLZ,@HCLOWXZ,@COHIGHCLZ,@COHIGHXZ,@HCHIGHCLZ,@HCHIGHXZ,@LAMDAHIGHCLZ,@LAMDAHIGHXZ,@LAMDAHIGHPD,@LOWPD,@HIGHPD,@ZHPD,@JCRQ,@WD,@SD,@DQY,@SBMC,@SBXH,@SBZZC,@FXYXH,@FXYBH,@FXYZZC,@ZSJXH,@ZSJBH,@ZSJZZC,@COLOWPD,@HCLOWPD,@ZSLOW,@JYWDLOW,@COHIGHPD,@HCHIGHPD,@ZSHIGH,@JYWDHIGH,@SHY,@SYNCHDATE,@YW,@GLKQXSSX,@GLKQXSXX,@JCKSSJ,@JCJSSJ,@CO2HIGH,@O2HIGH,@CO2LOW,@O2LOW,@COLOWXXZ,@COHIGHXXZ,@COLOWXYZ,@COHIGHXYZ,@CO2LOWXYZ,@CO2HIGHXYZ,@HCLOWXYZ,@HCHIGHXYZ)";
            string sqlu = "update SDS set JYLSH=@JYLSH,JYCS=@JYCS,SBRZBM=@SBRZBM,CLPH=@CLPH,JCBGBH=@JCBGBH,COLOWCLZ=@COLOWCLZ,COLOWXZ=@COLOWXZ,HCLOWCLZ=@HCLOWCLZ,HCLOWXZ=@HCLOWXZ,COHIGHCLZ=@COHIGHCLZ,COHIGHXZ=@COHIGHXZ,HCHIGHCLZ=@HCHIGHCLZ,HCHIGHXZ=@HCHIGHXZ,LAMDAHIGHCLZ=@LAMDAHIGHCLZ,LAMDAHIGHXZ=@LAMDAHIGHXZ,LAMDAHIGHPD=@LAMDAHIGHPD,LOWPD=@LOWPD,HIGHPD=@HIGHPD,ZHPD=@ZHPD,JCRQ=@JCRQ,WD=@WD,SD=@SD,DQY=@DQY,SBMC=@SBMC,SBXH=@SBXH,SBZZC=@SBZZC,FXYXH=@FXYXH,FXYBH=@FXYBH,FXYZZC=@FXYZZC,ZSJXH=@ZSJXH,ZSJBH=@ZSJBH,ZSJZZC=@ZSJZZC,COLOWPD=@COLOWPD,HCLOWPD=@HCLOWPD,ZSLOW=@ZSLOW,JYWDLOW=@JYWDLOW,COHIGHPD=@COHIGHPD,HCHIGHPD=@HCHIGHPD,ZSHIGH=@ZSHIGH,JYWDHIGH=@JYWDHIGH,SHY=@SHY,SYNCHDATE=@SYNCHDATE,YW=@YW,GLKQXSSX=@GLKQXSSX,GLKQXSXX=@GLKQXSXX,JCKSSJ=@JCKSSJ,JCJSSJ=@JCJSSJ,CO2HIGH=@CO2HIGH,O2HIGH=@O2HIGH,CO2LOW=@CO2LOW,O2LOW=@O2LOW,COLOWXXZ=@COLOWXXZ,COHIGHXXZ=@COHIGHXXZ,COLOWXYZ=@COLOWXYZ,COHIGHXYZ=@COHIGHXYZ,CO2LOWXYZ=@CO2LOWXYZ,CO2HIGHXYZ=@CO2HIGHXYZ,HCLOWXYZ=@HCLOWXYZ,HCHIGHXYZ=@HCHIGHXYZ where CLID=@CLID";

            SqlParameter[] spr =
            {
                new SqlParameter("@JYLSH",        SDS.JYLSH),
                new SqlParameter("@JYCS",         SDS.JYCS),
                new SqlParameter("@SBRZBM",       SDS.SBRZBM),
                new SqlParameter("@CLID",         SDS.CLID),           //1
                new SqlParameter("@JCBGBH",       SDS.JCBGBH),         //1
                new SqlParameter("@CLPH",         SDS.CLPH),
                new SqlParameter("@COLOWCLZ",     SDS.COLOWCLZ),
                new SqlParameter("@COLOWXZ",      SDS.COLOWXZ),
                new SqlParameter("@HCLOWCLZ",     SDS.HCLOWCLZ),
                new SqlParameter("@HCLOWXZ",      SDS.HCLOWXZ),
                new SqlParameter("@COHIGHCLZ",    SDS.COHIGHCLZ),               //6
                new SqlParameter("@COHIGHXZ",     SDS.COHIGHXZ),
                new SqlParameter("@HCHIGHCLZ",    SDS.HCHIGHCLZ),
                new SqlParameter("@HCHIGHXZ",     SDS.HCHIGHXZ),
                new SqlParameter("@LAMDAHIGHCLZ", SDS.LAMDAHIGHCLZ),
                new SqlParameter("@LAMDAHIGHXZ",  SDS.LAMDAHIGHXZ),       //11
                new SqlParameter("@LAMDAHIGHPD",  SDS.LAMDAHIGHPD),       //11
                new SqlParameter("@LOWPD",        SDS.LOWPD),
                new SqlParameter("@HIGHPD",       SDS.HIGHPD),            //11
                new SqlParameter("@ZHPD",         SDS.ZHPD),
                new SqlParameter("@JCRQ",         SDS.JCRQ),
                new SqlParameter("@WD",           SDS.WD),
                new SqlParameter("@SD",           SDS.SD),
                new SqlParameter("@DQY",          SDS.DQY),         //16
                new SqlParameter("@SBMC",         SDS.SBMC),
                new SqlParameter("@SBXH",         SDS.SBXH),
                new SqlParameter("@SBZZC",        SDS.SBZZC),
                new SqlParameter("@ZSJXH",        SDS.ZSJXH),
                new SqlParameter("@ZSJBH",        SDS.ZSJBH),           //21
                new SqlParameter("@ZSJZZC",       SDS.ZSJZZC),
                new SqlParameter("@FXYXH",        SDS.FXYXH),
                new SqlParameter("@FXYBH",        SDS.FXYBH),
                new SqlParameter("@FXYZZC",       SDS.FXYZZC),            //47

                new SqlParameter("@COLOWPD",      SDS.COLOWPD),
                new SqlParameter("@HCLOWPD",      SDS.HCLOWPD),
                new SqlParameter("@ZSLOW",        SDS.ZSLOW),           //21
                new SqlParameter("@JYWDLOW",      SDS.JYWDLOW),
                new SqlParameter("@COHIGHPD",     SDS.COHIGHPD),
                new SqlParameter("@HCHIGHPD",     SDS.HCHIGHPD),
                new SqlParameter("@ZSHIGH",       SDS.ZSHIGH),            //21
                new SqlParameter("@JYWDHIGH",     SDS.JYWDHIGH),
                new SqlParameter("@SHY",          SDS.SHY),
                new SqlParameter("@SYNCHDATE",    SDS.SYNCHDATE),
                new SqlParameter("@YW",           SDS.YW),        //21
                new SqlParameter("@GLKQXSSX",     SDS.GLKQXSSX),
                new SqlParameter("@GLKQXSXX",     SDS.GLKQXSXX),
                new SqlParameter("@JCKSSJ",       SDS.JCKSSJ),
                new SqlParameter("@JCJSSJ",       SDS.JCJSSJ),
                new SqlParameter("@CO2HIGH",      SDS.CO2HIGH),
                new SqlParameter("@O2HIGH",       SDS.O2HIGH),
                new SqlParameter("@CO2LOW",       SDS.CO2LOW),
                new SqlParameter("@O2LOW",        SDS.O2LOW),
                new SqlParameter("@COLOWXXZ",     SDS.COLOWXXZ),
                new SqlParameter("@COHIGHXXZ",    SDS.COHIGHXXZ),
                new SqlParameter("@COLOWXYZ",     SDS.COLOWXYZ),
                new SqlParameter("@COHIGHXYZ",    SDS.COHIGHXYZ),
                new SqlParameter("@CO2LOWXYZ",    SDS.CO2LOWXYZ),
                new SqlParameter("@CO2HIGHXYZ",   SDS.CO2HIGHXYZ),
                new SqlParameter("@HCLOWXYZ",     SDS.HCLOWXYZ),
                new SqlParameter("@HCHIGHXYZ",    SDS.HCHIGHXYZ)
                //47
            };
            try
            {
                if (Have_SDS(SDS.CLID))
                {
                    if (DBHelperSQL.Execute(sqlu, spr) > 0)
                    {
                        return(2);
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    if (DBHelperSQL.Execute(sqli, spr) > 0)
                    {
                        return(1);
                    }
                    else
                    {
                        return(0);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(SYS.Model.JCXXXB model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update JCXXXB set");
            //strSql.Append("JCXBH=@JCXBH,");
            strSql.Append(" GYJSJIP=@GYJSJIP,");
            strSql.Append("JCXMC=@JCXMC,");
            strSql.Append("JCFFLX=@JCFFLX,");
            strSql.Append("DPCGJBH=@DPCGJBH,");
            strSql.Append("FQFXYBH=@FQFXYBH,");
            strSql.Append("BTGYDJBH=@BTGYDJBH,");
            strSql.Append("WYZSBBH=@WYZSBBH,");
            strSql.Append("QTLLFXYBH=@QTLLFXYBH,");
            strSql.Append("LEDDPBH=@LEDDPBH,");
            strSql.Append("LEDPZ=@LEDPZ,");
            strSql.Append("XH=@XH,");
            strSql.Append("RZBH=@RZBH,");
            strSql.Append("ZZCS=@ZZCS,");
            strSql.Append("LLJBH=@LLJBH,");
            strSql.Append("DPCGJPZ=@DPCGJPZ,");
            strSql.Append("FQFXYPZ=@FQFXYPZ,");
            strSql.Append("BTGYDJPZ=@BTGYDJPZ,");
            strSql.Append("LLJPZ=@LLJPZ,");
            strSql.Append("PCBH=@PCBH,");
            strSql.Append("HJZBH=@HJZBH ");
            //strSql.Append("LJSYS=@LJSYS");//更新时不改变累计试验数
            strSql.Append(" where JCXBH=@JCXBH");
            //strSql.Append("values (@JCXBH,@GYJSJIP,@JCXMC,@JCFFLX,@DPCGJBH,@FQFXYBH,@BTGYDJBH,@WYZSBBH,@QTLLFXYBH,@LEDDPBH,@XH,@RZBH,@ZZCS,@LLJBH,@LJSYS)");
            SqlParameter[] parameters =
            {
                //new SqlParameter("@JCXBH", SqlDbType.VarChar,32),
                new SqlParameter("@GYJSJIP",   SqlDbType.VarChar, 16),
                new SqlParameter("@JCXMC",     SqlDbType.VarChar, 64),
                new SqlParameter("@JCFFLX",    SqlDbType.Int,      4),
                new SqlParameter("@DPCGJBH",   SqlDbType.Int,      4),
                new SqlParameter("@FQFXYBH",   SqlDbType.Int,      4),
                new SqlParameter("@BTGYDJBH",  SqlDbType.Int,      4),
                new SqlParameter("@WYZSBBH",   SqlDbType.Int,      4),
                new SqlParameter("@QTLLFXYBH", SqlDbType.Int,      4),
                new SqlParameter("@LEDDPBH",   SqlDbType.Int,      4),
                new SqlParameter("@LEDPZ",     SqlDbType.VarChar, 32),
                new SqlParameter("@XH",        SqlDbType.VarChar, 32),
                new SqlParameter("@RZBH",      SqlDbType.VarChar, 64),
                new SqlParameter("@ZZCS",      SqlDbType.VarChar, 64),
                new SqlParameter("@LLJBH",     SqlDbType.Int,      4),
                new SqlParameter("@DPCGJPZ",   SqlDbType.VarChar, 64),
                new SqlParameter("@FQFXYPZ",   SqlDbType.VarChar, 64),
                new SqlParameter("@BTGYDJPZ",  SqlDbType.VarChar, 64),
                new SqlParameter("@LLJPZ",     SqlDbType.VarChar, 64),
                new SqlParameter("@PCBH",      SqlDbType.Int,      4),
                new SqlParameter("@HJZBH",     SqlDbType.Int,      4),
                //new SqlParameter("@LJSYS", SqlDbType.Int,4),
                new SqlParameter("@JCXBH",     SqlDbType.VarChar, 32)
            };
            //parameters[0].Value = model.JCXBH;
            parameters[0].Value  = model.GYJSJIP;
            parameters[1].Value  = model.JCXMC;
            parameters[2].Value  = model.JCFFLX;
            parameters[3].Value  = model.DPCGJBH;
            parameters[4].Value  = model.FQFXYBH;
            parameters[5].Value  = model.BTGYDJBH;
            parameters[6].Value  = model.WYZSBBH;
            parameters[7].Value  = model.QTLLFXYBH;
            parameters[8].Value  = model.LEDDPBH;
            parameters[9].Value  = model.LEDPZ;
            parameters[10].Value = model.XH;
            parameters[11].Value = model.RZBH;
            parameters[12].Value = model.ZZCS;
            parameters[13].Value = model.LLJBH;
            parameters[14].Value = model.DPCGJPZ;
            parameters[15].Value = model.FQFXYPZ;
            parameters[16].Value = model.BTGYDJPZ;
            parameters[17].Value = model.LLJPZ;
            parameters[18].Value = model.PCBH;
            parameters[19].Value = model.HJZBH;
            //parameters[14].Value = model.LJSYS;
            parameters[20].Value = model.JCXBH;
            try
            {
                int rows = DBHelperSQL.Execute(strSql.ToString(), parameters);
                if (rows > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }