Пример #1
0
 private void dataGridView1_selectionChanged(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         if (dataGridView1.SelectedRows.Count == 1)
         {
             ToolStripMenuItem_Check.Enabled = true;
             toolStripMenuItem_Print.Enabled = true;
             selectID = new string[1024];
             for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
             {
                 selectID[i] = dataGridView1.SelectedRows[i].Cells["检测编号"].Value.ToString();
             }
             bjcl         = bjclxx.GetModel_by_jcclph(dataGridView1.SelectedRows[0].Cells["车牌号"].Value.ToString());
             jcffSelected = dataGridView1.SelectedRows[0].Cells["检测方法"].Value.ToString();
         }
         else if (dataGridView1.SelectedRows.Count > 1)
         {
             ToolStripMenuItem_Check.Enabled = false;
             toolStripMenuItem_Print.Enabled = false;
             selectID = new string[1024];
             for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
             {
                 selectID[i] = dataGridView1.SelectedRows[i].Cells["检测编号"].Value.ToString();
             }
         }
         else
         {
             ToolStripMenuItem_Check.Enabled = false;
             toolStripMenuItem_Print.Enabled = false;
             selectID = new string[1024];
             for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
             {
                 selectID[i] = dataGridView1.SelectedRows[i].Cells["检测编号"].Value.ToString();
             }
         }
     }
     else
     {
         selectID = new string[1024];
         for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
         {
             selectID[i] = dataGridView1.SelectedRows[i].Cells["检测编号"].Value.ToString();
         }
     }
 }
Пример #2
0
        /// <summary>
        /// 得到一个准备检测车辆的对象实体
        /// </summary>
        public BJCLXXB GetBjCarModel(string ip)
        {
            StringBuilder strSql = new StringBuilder();
            string        sql    = "select  top 1 JCBH,PZLX,JCCLPH,CLXHBH,JCCS,CCRQ,FDJH,CJH,CZ,CZDH,CZDZ,LCBDS,HBBZ,SYQK,JCBJ,JCZT from BJCLXXB where JCBH=(select min(JCBH)  from BJCLXXB where JCBJ in (select JCXBH from JCXXXB where GYJSJIP=" + "'" + ip + "'))";

            BJCLXXB   model = new BJCLXXB();
            DataTable ds    = DBHelperSQL.GetDataTable(sql);

            if (ds.Rows.Count > 0)
            {
                if (ds.Rows[0]["JCBH"] != null && ds.Rows[0]["JCBH"].ToString() != "")
                {
                    model.JCBH = ds.Rows[0]["JCBH"].ToString();
                }
                if (ds.Rows[0]["PZLX"] != null && ds.Rows[0]["PZLX"].ToString() != "")
                {
                    model.PZLX = ds.Rows[0]["PZLX"].ToString();
                }
                if (ds.Rows[0]["JCCLPH"] != null && ds.Rows[0]["JCCLPH"].ToString() != "")
                {
                    model.JCCLPH = ds.Rows[0]["JCCLPH"].ToString();
                }
                if (ds.Rows[0]["CLXHBH"] != null && ds.Rows[0]["CLXHBH"].ToString() != "")
                {
                    model.CLXHBH = ds.Rows[0]["CLXHBH"].ToString();
                }
                if (ds.Rows[0]["JCCS"] != null && ds.Rows[0]["JCCS"].ToString() != "")
                {
                    model.JCCS = int.Parse(ds.Rows[0]["JCCS"].ToString());
                }
                if (ds.Rows[0]["LSH"] != null && ds.Rows[0]["JCCS"].ToString() != "")
                {
                    model.LSH = int.Parse(ds.Rows[0]["LSH"].ToString());
                }
                if (ds.Rows[0]["CCRQ"] != null && ds.Rows[0]["CCRQ"].ToString() != "")
                {
                    model.CCRQ = DateTime.Parse(ds.Rows[0]["CCRQ"].ToString());
                }
                if (ds.Rows[0]["FDJH"] != null && ds.Rows[0]["FDJH"].ToString() != "")
                {
                    model.FDJH = ds.Rows[0]["FDJH"].ToString();
                }
                if (ds.Rows[0]["CJH"] != null && ds.Rows[0]["CJH"].ToString() != "")
                {
                    model.CJH = ds.Rows[0]["CJH"].ToString();
                }
                if (ds.Rows[0]["CZ"] != null && ds.Rows[0]["CZ"].ToString() != "")
                {
                    model.CZ = ds.Rows[0]["CZ"].ToString();
                }
                if (ds.Rows[0]["CZDH"] != null && ds.Rows[0]["CZDH"].ToString() != "")
                {
                    model.CZDH = ds.Rows[0]["CZDH"].ToString();
                }
                if (ds.Rows[0]["CZDZ"] != null && ds.Rows[0]["CZDZ"].ToString() != "")
                {
                    model.CZDZ = ds.Rows[0]["CZDZ"].ToString();
                }
                if (ds.Rows[0]["LCBDS"] != null && ds.Rows[0]["LCBDS"].ToString() != "")
                {
                    model.LCBDS = int.Parse(ds.Rows[0]["LCBDS"].ToString());
                }
                if (ds.Rows[0]["HBBZ"] != null && ds.Rows[0]["HBBZ"].ToString() != "")
                {
                    model.HBBZ = ds.Rows[0]["HBBZ"].ToString();
                }
                if (ds.Rows[0]["SYQK"] != null && ds.Rows[0]["SYQK"].ToString() != "")
                {
                    model.SYQK = ds.Rows[0]["SYQK"].ToString();
                }
                if (ds.Rows[0]["JCBJ"] != null && ds.Rows[0]["JCBJ"].ToString() != "")
                {
                    model.JCBJ = ds.Rows[0]["JCBJ"].ToString();
                }
                if (ds.Rows[0]["JCZT"] != null && ds.Rows[0]["JCZT"].ToString() != "")
                {
                    model.JCZT = ds.Rows[0]["JCZT"].ToString();
                }
                if (ds.Rows[0]["QRJCFF"] != null && ds.Rows[0]["QRJCFF"].ToString() != "")
                {
                    model.QRJCFF = ds.Rows[0]["QRJCFF"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BJCLXXB GetModel(string JCBH)
        {
            string sql = "select * from BJCLXXB where JCBH=@jcbh";

            SqlParameter[] spr =
            {
                new SqlParameter("@jcbh", JCBH)
                // new SqlParameter("@jccs",JCCS),
            };
            DataTable dt        = null;
            BJCLXXB   bjc_model = new BJCLXXB();

            try
            {
                dt = DBHelperSQL.GetDataTable(sql, CommandType.Text, spr);
                if (dt.Rows.Count > 0)
                {
                    bjc_model.JCBH   = dt.Rows[0]["JCBH"].ToString();
                    bjc_model.PZLX   = dt.Rows[0]["PZLX"].ToString();
                    bjc_model.JCCLPH = dt.Rows[0]["JCCLPH"].ToString();
                    bjc_model.CLXHBH = dt.Rows[0]["CLXHBH"].ToString();
                    if (dt.Rows[0]["JCCS"].ToString().Trim() == "")
                    {
                        bjc_model.JCCS = 0;
                    }
                    else
                    {
                        bjc_model.JCCS = Convert.ToInt32(dt.Rows[0]["JCCS"].ToString());
                    }
                    //bjc_model.JCCS = Convert.ToInt32(dt.Rows[0]["JCCS"].ToString());
                    //bjc_model.LSH = Convert.ToInt32(dt.Rows[0]["LSH"].ToString());
                    bjc_model.CCRQ = (DateTime)dt.Rows[0]["CCRQ"];
                    bjc_model.DJRQ = (DateTime)dt.Rows[0]["DJRQ"];
                    bjc_model.FDJH = dt.Rows[0]["FDJH"].ToString();
                    bjc_model.CJH  = dt.Rows[0]["CJH"].ToString();
                    bjc_model.CZ   = dt.Rows[0]["CZ"].ToString();
                    bjc_model.CZDH = dt.Rows[0]["CZDH"].ToString();
                    bjc_model.CZDZ = dt.Rows[0]["CZDZ"].ToString();
                    if (dt.Rows[0]["LCBDS"].ToString().Trim() == "")
                    {
                        bjc_model.LCBDS = 0;
                    }
                    else
                    {
                        bjc_model.LCBDS = Convert.ToInt32(dt.Rows[0]["LCBDS"].ToString());
                    }
                    //bjc_model.LCBDS = Convert.ToInt32(dt.Rows[0]["LCBDS"].ToString());
                    bjc_model.HBBZ    = dt.Rows[0]["HBBZ"].ToString();
                    bjc_model.SYQK    = dt.Rows[0]["SYQK"].ToString();
                    bjc_model.JCBJ    = dt.Rows[0]["JCBJ"].ToString();
                    bjc_model.JCZT    = dt.Rows[0]["JCZT"].ToString();
                    bjc_model.QRJCFF  = dt.Rows[0]["QRJCFF"].ToString();
                    bjc_model.RYLX    = dt.Rows[0]["RYLX"].ToString();
                    bjc_model.GYFF    = dt.Rows[0]["GYFF"].ToString();
                    bjc_model.BSXLX   = dt.Rows[0]["BSXLX"].ToString();
                    bjc_model.CLLX    = dt.Rows[0]["CLLX"].ToString();
                    bjc_model.ZBZL    = dt.Rows[0]["ZBZL"].ToString();
                    bjc_model.ZDZZL   = dt.Rows[0]["ZDZZL"].ToString();
                    bjc_model.FDJPL   = dt.Rows[0]["FDJPL"].ToString();
                    bjc_model.FDJSCS  = dt.Rows[0]["FDJSCS"].ToString();
                    bjc_model.JCZH    = dt.Rows[0]["JCZH"].ToString();
                    bjc_model.DCZZ    = dt.Rows[0]["DCZZ"].ToString();
                    bjc_model.FDJEDGL = dt.Rows[0]["FDJEDGL"].ToString();
                    bjc_model.FDJEDZS = dt.Rows[0]["FDJEDZS"].ToString();
                    if (dt.Rows[0]["PQGSL"].ToString().Trim() == "")
                    {
                        bjc_model.PQGSL = 0;
                    }
                    else
                    {
                        bjc_model.PQGSL = Convert.ToInt32(dt.Rows[0]["PQGSL"].ToString());
                    }
                    bjc_model.PFBZ = dt.Rows[0]["PFBZ"].ToString();
                    bjc_model.ZZCS = dt.Rows[0]["ZZCS"].ToString();
                    if (dt.Rows[0]["QGS"].ToString().Trim() == "")
                    {
                        bjc_model.QGS = 0;
                    }
                    else
                    {
                        bjc_model.QGS = Convert.ToInt32(dt.Rows[0]["QGS"].ToString());
                    }
                    //bjc_model.QGS = Convert.ToInt32(dt.Rows[0]["QGS"].ToString());
                    bjc_model.QDXS  = dt.Rows[0]["QDXS"].ToString();
                    bjc_model.QDLQY = dt.Rows[0]["QDLQY"].ToString();
                    bjc_model.JCYH  = dt.Rows[0]["JCYH"].ToString();
                    if (dt.Rows[0]["DWS"].ToString().Trim() == "")
                    {
                        bjc_model.DWS = 0;
                    }
                    else
                    {
                        bjc_model.DWS = Convert.ToInt32(dt.Rows[0]["DWS"].ToString());
                    }
                    if (dt.Rows[0]["HDZK"].ToString().Trim() == "")
                    {
                        bjc_model.HDZK = 0;
                    }
                    else
                    {
                        bjc_model.HDZK = Convert.ToInt32(dt.Rows[0]["HDZK"].ToString());
                    }
                    if (dt.Rows[0]["JCRQ"].ToString().Trim() == "")
                    {
                        bjc_model.JCRQ = DateTime.Parse("1900-1-1");
                    }
                    else
                    {
                        bjc_model.JCRQ = (DateTime)dt.Rows[0]["JCRQ"];
                    }
                    bjc_model.JQXS = dt.Rows[0]["JQXS"].ToString();
                    //bjc_model.DWS = Convert.ToInt32(dt.Rows[0]["DWS"].ToString());
                    //bjc_model.HDZK = Convert.ToInt32(dt.Rows[0]["HDZK"].ToString());
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(bjc_model);
        }
Пример #4
0
        private bool check_IsRight(out SYS.Model.BJCLXXB model)
        {
            model = new BJCLXXB();
            if (textBoxPlateNumber.Text == "" || comboBoxMobileType.Text == "" || textBoxFarameNumber.Text == "" || textBoxWeight.Text == "" ||
                textBoxMostWeight.Text == "" || comboBoxFuelType.Text == "" || comboBoxFuelSupplyType.Text == "" || comboBoxGreenFlag.Text == "" || dateEditRegisterData.Text == "")
            {
                return(false);
            }
            else
            {
                DateTime dt      = DateTime.Now;
                string   nowtime = dt.ToString().Replace("/", "").Replace(" ", "").Replace(":", "").Trim();
                model.JCBH = nowtime;                                                         //用注册的时间做为被检车辆的编号,检测完了再重新定义检测编号存储到相应的数据库中
                //model.JCBH = jczNumber + "-" + jcxxxb.JCXBH.ToString() + "-" + jcxxxb.LJSYS.ToString();
                model.PZLX   = comboBoxMobileColor.Text;                                      //牌照颜色
                model.JCCLPH = textBoxPlateNumber.Text;                                       //牌照号码
                model.CLXHBH = textBoxMobileNumber.Text;                                      //车辆型号
                model.JCCS   = 0;                                                             //检测次数
                //model.LSH=;//
                model.CCRQ = Convert.ToDateTime(dateEditProductDate.Text.Replace('/', '-'));  //生产日期
                model.DJRQ = Convert.ToDateTime(dateEditRegisterData.Text.Replace('/', '-')); //登记日期
                model.FDJH = textBoxEngineNumber.Text;                                        //发动机号
                model.CJH  = textBoxFarameNumber.Text;                                        //车架号
                model.CZ   = textBoxOwnerName.Text;                                           //车主
                model.CZDH = textBoxOwnerTel.Text;                                            //车主电话
                model.CZDZ = textBoxOwnerAdd.Text;                                            //车主地址
                if (textBoxOdometer.Text != "")
                {
                    model.LCBDS = Convert.ToInt32(textBoxOdometer.Text);//里程表读数
                }
                else
                {
                    model.LCBDS = 0;
                }
                model.HBBZ = comboBoxGreenFlag.Text; //环保标志
                model.SYQK = comboBoxInUse.Text;     //使用情况
                if (comboBox_detectLine.Text.Trim() == "" || comboBox_detectLine.Text.Trim() == "本线检测")
                {
                    model.JCBJ = CarWait.jcxxxb.JCXBH.ToString();//默认为本线检测
                }//检测线号
                else if (comboBox_detectLine.Text.Trim() == "优先")
                {
                    model.JCBJ = "-1";
                }

                model.JCZT    = "请上测功机检测";         //检测状态
                model.QRJCFF  = comboBoxJcff.Text; //检测方法
                model.RYLX    = comboBoxFuelType.Text;
                model.GYFF    = comboBoxFuelSupplyType.Text;
                model.BSXLX   = comboBoxGearbox.Text;
                model.CLLX    = comboBoxMobileType.Text;
                model.ZBZL    = textBoxWeight.Text;
                model.ZDZZL   = textBoxMostWeight.Text;
                model.FDJPL   = textBoxEnginePlacement.Text;
                model.FDJSCS  = textBoxEngineManufacture.Text;
                model.JCZH    = CarWait.jczNumber;
                model.DCZZ    = textBoxAxleLoad.Text;
                model.FDJEDGL = textBoxEnginePower.Text;
                model.FDJEDZS = textBoxEngineSpeed.Text;
                if (textBoxPipeCount.Text != "")
                {
                    model.PQGSL = Convert.ToInt32(textBoxPipeCount.Text);
                }
                else
                {
                    model.PQGSL = 0;
                }
                model.PFBZ = "地方标准";
                model.ZZCS = textBoxMobileManufacture.Text;
                if (comboBoxCylinderCount.Text != "")
                {
                    model.QGS = Convert.ToInt32(comboBoxCylinderCount.Text);
                }
                else
                {
                    model.QGS = 0;
                }
                model.QDXS  = comboBoxDriveStyle.Text;
                model.QDLQY = textBoxPneumaticWheel.Text;
                model.JCYH  = textBoxInspectorNumber.Text;
                if (textBoxGearCount.Text != "")
                {
                    model.DWS = Convert.ToInt32(textBoxGearCount.Text);
                }
                else
                {
                    model.DWS = 0;
                }
                if (textBoxHdzk.Text != "")
                {
                    model.HDZK = Convert.ToInt32(textBoxHdzk.Text);
                }
                else
                {
                    model.HDZK = 0;
                }
                //model.JQXS = comboBoxJqxs.Text;
                return(true);
            }
        }