Пример #1
0
        /// <summary>
        /// 生产问题图片
        /// </summary>
        private void LoadPDPic()
        {
            PictureBox[] pb;
            ArrayList    JpgList   = new ArrayList();
            ArrayList    pdnumList = new ArrayList();
            DataTable    dtTime;
            // 检测路径是否存在
            //MessageBox.Show(floCoding);
            string strPDnum = @"SELECT PDtime FROM [YouliData].[dbo].[PDnotes] WHERE PDcoding='" + floPDCoding + "' AND PDover ='F'";

            dtTime = SQLHelper2.GetDataSet(strPDnum).Tables[0];
            for (int i = 0; i < dtTime.Rows.Count; i++)
            {
                pdnumList.Add(dtTime.Rows[i][0].ToString());
            }
            //MessageBox.Show(pdnumList[0].ToString());
            for (int i = 0; i < pdnumList.Count; i++)
            {
                //通过查找当前页面的txtflocoding 找不到值
                // string imagePath = @"C:\Users\Administrator\Desktop\优力资料云享版";

                string imagePath = @"\\192.168.1.104\Youli_Server\ProblemFile\PDnote" + "\\" + pdnumList[i].ToString() + "\\" + " " + floPDCoding + "\\";
                //MessageBox.Show(imagePath);
                //  OpenFileDialog openFileDialog = new OpenFileDialog();
                //  openFileDialog.InitialDirectory = imagePath;
                //if(openFileDialog.ShowDialog() == DialogResult.OK)
                //  {

                //  }
                if (Directory.Exists(imagePath))
                {
                    DirectoryInfo dir = new DirectoryInfo(@"\\192.168.1.104\Youli_Server\ProblemFile\PDnote" + "\\" + pdnumList[i].ToString() + "\\" + " " + floPDCoding);

                    foreach (var file in dir.GetFiles("*.jpg"))
                    {
                        //MessageBox.Show(file.FullName);
                        JpgList.Add(file.FullName);
                    }
                }
                else
                {
                    // MessageBox.Show("读取图片路径出错");
                }
            }
            pb = new PictureBox[JpgList.Count];
            for (int j = 0; j < JpgList.Count; j++)
            {
                pb[j]             = new System.Windows.Forms.PictureBox();
                pb[j].BorderStyle = BorderStyle.FixedSingle;
                pb[j].SizeMode    = PictureBoxSizeMode.StretchImage;
                pb[j].Image       = Image.FromFile(JpgList[j].ToString());
                pb[j].Size        = new System.Drawing.Size(370, 280);
                flowLayoutPanel2.Controls.Add(pb[j]);
            }
            // MessageBox.Show(JpgList.Count.ToString());
        }
Пример #2
0
        private void LoadTableQCnotes()
        {
            string strnotes      = @"SELECT * FROM [dbo].[QCnotes] WHERE QCcoding = (SELECT flo_coding FROM [YouliData].[dbo].[flow] WHERE flo_num = '" + editValue + "' )  AND QCover ='F'";
            string strnotesCount = @"SELECT count(*) FROM [dbo].[QCnotes] WHERE QCcoding = (SELECT flo_coding FROM [YouliData].[dbo].[flow] WHERE flo_num = '" + editValue + "' )  AND QCover ='F'";

            //MessageBox.Show(txtflocoding.Text);
            //string strnotes = @"SELECT * FROM [dbo].[QCnotes] WHERE QCcoding = '"+this.txtflocoding.Text.Trim()+"'  AND QCover ='F'";
            if (SQLHelper2.GetSingleResult(strnotesCount).ToString() != "0")
            {
                dgvQCnotes.AutoGenerateColumns = false;
                dgvQCnotes.DataSource          = SQLHelper2.GetDataSet(strnotes).Tables[0];
                floQCCoding = dgvQCnotes.Rows[0].Cells[2].Value.ToString();
            }
        }
Пример #3
0
        private void loading()
        {
            string Sqlstr = "SELECT * FROM flow WHERE flo_num = '" + this.editValue + "'";

            dt = SQLHelper2.GetDataSet(Sqlstr).Tables[0];
            #region 读取sql数据存入txt文本框

            txtflotime.Text        = dt.Rows[0]["flo_time"].ToString();
            txtflostate.Text       = dt.Rows[0]["flo_state"].ToString();
            txtfloclient.Text      = dt.Rows[0]["flo_client"].ToString();
            txtflofactory.Text     = dt.Rows[0]["flo_factory"].ToString();
            txtfloline.Text        = dt.Rows[0]["flo_line"].ToString();
            txtflonum.Text         = dt.Rows[0]["flo_num"].ToString();
            txtflorecord.Text      = dt.Rows[0]["flo_record"].ToString();
            txtflocoding.Text      = dt.Rows[0]["flo_coding"].ToString();
            txtflocilentID.Text    = dt.Rows[0]["flo_cilentID"].ToString();
            txtflomodel.Text       = dt.Rows[0]["flo_model"].ToString();
            txtflologo.Text        = dt.Rows[0]["flo_logo"].ToString();
            txtfloproname.Text     = dt.Rows[0]["flo_proname"].ToString();
            txtflorange.Text       = dt.Rows[0]["flo_range"].ToString();
            txtflounit.Text        = dt.Rows[0]["flo_unit"].ToString();
            txtfloreunit.Text      = dt.Rows[0]["flo_reunit"].ToString();
            txtflomemunit.Text     = dt.Rows[0]["flo_memunit"].ToString();
            txtfloframes.Text      = dt.Rows[0]["flo_frames"].ToString();
            txtflobackcolor.Text   = dt.Rows[0]["flo_backcolor"].ToString();
            txtfloclosetime.Text   = dt.Rows[0]["flo_closetime"].ToString();
            txtflobacktime.Text    = dt.Rows[0]["flo_backtime"].ToString();
            txtflorevise.Text      = dt.Rows[0]["flo_revise"].ToString();
            txtflocleRange.Text    = dt.Rows[0]["flo_cleRange"].ToString();
            txtflocleShutdown.Text = dt.Rows[0]["flo_cleShutdown"].ToString();
            txtflogravity.Text     = dt.Rows[0]["flo_gravity"].ToString();
            txtflolevFacSet.Text   = dt.Rows[0]["flo_levFacSet"].ToString();
            txtflocell.Text        = dt.Rows[0]["flo_cell"].ToString();
            txtfloplastic.Text     = dt.Rows[0]["flo_plastic"].ToString();
            txtfloquantity.Text    = dt.Rows[0]["flo_quantity"].ToString();
            txtflodelivery.Text    = dt.Rows[0]["flo_delivery"].ToString();
            txtfloencase.Text      = dt.Rows[0]["flo_encase"].ToString();
            txtflobox.Text         = dt.Rows[0]["flo_box"].ToString();
            txtfloask.Text         = dt.Rows[0]["flo_ask"].ToString();
            txtflowback.Text       = dt.Rows[0]["flo_back"].ToString();
            if (dt.Rows[0]["flo_pic"].ToString() == "1")
            {
                chkflopic.Checked = true;
            }
            txtflomodibom1.Text = dt.Rows[0]["flo_modibom1"].ToString();
            txtflomodibom2.Text = dt.Rows[0]["flo_modibom2"].ToString();
            if (dt.Rows[0]["flo_bomVerify"].ToString() == "1")
            {
                chkflobomVerify.Checked = true;
            }
            txtflostarv.Text     = dt.Rows[0]["flo_starv"].ToString();
            txtfloonline.Text    = dt.Rows[0]["flo_online"].ToString();
            txtflooliquan.Text   = dt.Rows[0]["flo_oliquan"].ToString();
            txtfloelequan.Text   = dt.Rows[0]["flo_elequan"].ToString();
            txtfloelsequan.Text  = dt.Rows[0]["flo_elsequan"].ToString();
            txtflofacAlter.Text  = dt.Rows[0]["flo_facAlter"].ToString();
            txtflofristMake.Text = dt.Rows[0]["flo_fristMake"].ToString();
            txtflofristChk.Text  = dt.Rows[0]["flo_fristChk"].ToString();
            txtfloProSum.Text    = dt.Rows[0]["flo_ProSum"].ToString();

            txtflospotChk.Text = dt.Rows[0]["flo_spotChk"].ToString();
            if (dt.Rows[0]["flo_out"].ToString() == "Y")
            {
                chkout.Checked = true;
            }
            if (dt.Rows[0]["flo_finish"].ToString() == "Y")
            {
                checkBox1.Checked = true;
            }
            if (dt.Rows[0]["flo_finishTo"].ToString() == "Y")
            {
                chkfinish.Checked = true;
            }
            #endregion
        }