Exemplo n.º 1
0
        private void button6_Click(object sender, EventArgs e)
        {
            string sql;

            if (comboBox1.SelectedIndex < 0 & textBox1.Text.ToString().Trim() != "" & textBox2.Text.ToString().Trim() != "" & textBox3.Text.ToString().Trim() != "")
            {
                sql = "select * from JDSoft_MES_Problem where 提出时间 like '%" + textBox1.Text.ToString().Trim() + "%' and 解决时间 like '%" + textBox2.Text.ToString().Trim() +
                      "%' and 关闭时间 like '%" + textBox3.Text.ToString().Trim() + "%'";
            }
            else if (comboBox1.SelectedIndex < 0 & textBox1.Text.ToString().Trim() == "" & textBox2.Text.ToString().Trim() != "" & textBox3.Text.ToString().Trim() != "")
            {
                sql = "select * from JDSoft_MES_Problem where 解决时间 like '%" + textBox2.Text.ToString().Trim() +
                      "%' and 关闭时间 like '%" + textBox3.Text.ToString().Trim() + "%'";
            }
            else if (comboBox1.SelectedIndex < 0 & textBox1.Text.ToString().Trim() == "" & textBox2.Text.ToString().Trim() == "" & textBox3.Text.ToString().Trim() != "")
            {
                sql = "select * from JDSoft_MES_Problem where 关闭时间 like '%" + textBox3.Text.ToString().Trim() + "%'";
            }
            else if (comboBox1.SelectedIndex < 0 & textBox1.Text.ToString().Trim() == "" & textBox2.Text.ToString().Trim() == "" & textBox3.Text.ToString().Trim() == "")
            {
                sql = "select * from JDSoft_MES_Problem";
            }
            else
            {
                sql = "select * from JDSoft_MES_Problem where 解决状态 like '%" + comboBox1.Items[comboBox1.SelectedIndex].ToString() +
                      "%' and 提出时间 like '%" + textBox1.Text.ToString().Trim() + "%' and 解决时间 like '%" + textBox2.Text.ToString().Trim() +
                      "%' and 关闭时间 like '%" + textBox3.Text.ToString().Trim() + "%'";
            }

            DataTable rows = ConnectSQL.Reader(sql);

            dataGridView1.DataSource = rows;
        }
Exemplo n.º 2
0
        private void button5_Click(object sender, EventArgs e) //刷新
        {
            string    sql  = "select * from JDSoft_MES_Problem;";
            DataTable rows = ConnectSQL.Reader(sql);

            dataGridView1.DataSource = rows;
        }
Exemplo n.º 3
0
        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            tabControl1.Visible = false; //显示合成脚本菜单
            tabControl2.Visible = false;
            tabControl3.Visible = false;
            tabControl4.Visible = true;
            tabControl5.Visible = false;
            tabControl4.Dock    = DockStyle.Fill;//填充窗体

            string    sql  = "select * from JDSoft_MES_Problem;";
            DataTable rows = ConnectSQL.Reader(sql);

            dataGridView1.DataSource = rows;
        }