示例#1
0
文件: OptionInfo.cs 项目: icprog/MES
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            Bll.T_ZJInfo t_ZJInfo = new Bll.T_ZJInfo();
            DataTable    dt       = t_ZJInfo.GetZJPartConfigCode(allPic[4]);

            Model.CheckResult.ZJPartConfigCode = dt.Rows[0]["ZJPartConfigCode"].ToString();
            Model.CheckResult.ZJPartConfigName = dt.Rows[0]["ZJPartConfigName"].ToString();

            showResult();
            //showBigPic(Pic1);
            clearDetail();
        }
示例#2
0
文件: OptionInfo.cs 项目: icprog/MES
        public void GetAllPics()
        {
            Bll.T_ZJInfo t_ZJInfo = new Bll.T_ZJInfo();
            DataTable    dt       = t_ZJInfo.GetZJPartConfig();

            WebClient wc = new WebClient();


            foreach (DataRow item in dt.Rows)
            {
                allPic.Add(item["ImagePath"].ToString());
                allName.Add(item["ZJPartConfigName"].ToString());
            }


            for (int i = 0; i < allPic.Count; i++)
            {
                if (!System.IO.File.Exists(i.ToString()))
                {
                    wc.DownloadFile(allPic[i], i.ToString());
                }
            }

            if (allPic.Count == 1)
            {
                this.pictureBox1.Image = Image.FromFile("0");
                Pic1 = "0";
                this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part1.Text           = allName[0];

                this.pictureBox2.Hide();
                this.pictureBox3.Hide();
                this.pictureBox4.Hide();
                this.pictureBox5.Hide();
            }
            else if (allPic.Count == 2)
            {
                this.pictureBox1.Image = Image.FromFile("0");
                Pic1 = "0";
                this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part1.Text           = allName[0];

                this.pictureBox2.Image = Image.FromFile("1");
                Pic2 = "1";
                this.pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part2.Text           = allName[1];

                this.pictureBox3.Hide();
                this.pictureBox4.Hide();
                this.pictureBox5.Hide();
            }

            else if (allPic.Count == 3)
            {
                this.pictureBox1.Image = Image.FromFile("0");
                Pic1 = "0";
                this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part1.Text           = allName[0];

                this.pictureBox2.Image = Image.FromFile("1");
                Pic2 = "1";
                this.pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part2.Text           = allName[1];

                this.pictureBox3.Image = Image.FromFile("2");
                Pic3 = "2";
                this.pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part3.Text           = allName[2];

                this.pictureBox4.Hide();
                this.pictureBox5.Hide();
            }
            else if (allPic.Count == 4)
            {
                this.pictureBox1.Image = Image.FromFile("0");
                Pic1 = "0";
                this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part1.Text           = allName[0];

                this.pictureBox2.Image = Image.FromFile("1");
                Pic2 = "1";
                this.pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part2.Text           = allName[1];

                this.pictureBox3.Image = Image.FromFile("2");
                Pic3 = "2";
                this.pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part3.Text           = allName[2];

                this.pictureBox4.Image = Image.FromFile("3");
                Pic4 = "3";
                this.pictureBox4.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part4.Text           = allName[3];

                this.pictureBox5.Hide();
            }

            else if (allPic.Count == 5)
            {
                this.pictureBox1.Image = Image.FromFile("0");
                Pic1 = "0";
                this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part1.Text           = allName[0];

                this.pictureBox2.Image = Image.FromFile("1");
                Pic2 = "1";
                this.pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part2.Text           = allName[1];

                this.pictureBox3.Image = Image.FromFile("2");
                Pic3 = "2";
                this.pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part3.Text           = allName[2];

                this.pictureBox4.Image = Image.FromFile("3");
                Pic4 = "3";
                this.pictureBox4.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part4.Text           = allName[3];

                this.pictureBox5.Image = Image.FromFile("4");
                Pic5 = "4";
                this.pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
                this.part5.Text           = allName[4];
            }

            wc.Dispose();
        }