Example #1
0
        private void Finddata()
        {
            DataTable    dt = new DataTable();
            YuanyuDBTemp db = new YuanyuDBTemp();

            switch (formSort)
            {
            case 1:
                dt = db.SelectBitumenDetachData(cmbYear.Text, cmbMonth.Text, cmbProductName.Text, cmbProductmodel.Text);
                dataGridView1.DataSource              = dt;
                dataGridView1.Columns["id"].Visible   = false;
                dataGridView1.Columns["ekId"].Visible = false;
                dataGridView1.Columns["enId"].Visible = false;
                dataGridView1.Columns["ecId"].Visible = false;
                dataGridView1.Columns["eiId"].Visible = false;
                dataGridView1.Columns["pId"].Visible  = false;
                //dataGridView1.Columns["自动还是手工"].Visible = false;
                dataGridView1.Columns["自动还是手工"].ReadOnly = true;
                break;

            case 2:
                dt = db.SelectAlterBitumenDetachData(cmbYear.Text, cmbMonth.Text, cmbProductName.Text, cmbProductmodel.Text);
                dataGridView1.DataSource              = dt;
                dataGridView1.Columns["id"].Visible   = false;
                dataGridView1.Columns["ekId"].Visible = false;
                dataGridView1.Columns["enId"].Visible = false;
                dataGridView1.Columns["ecId"].Visible = false;
                dataGridView1.Columns["eiId"].Visible = false;
                dataGridView1.Columns["pId"].Visible  = false;
                //dataGridView1.Columns["自动还是手工"].Visible = false;
                dataGridView1.Columns["自动还是手工"].ReadOnly = true;
                break;

            case 3:
                dt = db.SelectMixBitumenDetachData(cmbYear.Text, cmbMonth.Text, cmbProductName.Text, cmbProductmodel.Text);
                dataGridView1.DataSource              = dt;
                dataGridView1.Columns["id"].Visible   = false;
                dataGridView1.Columns["ekId"].Visible = false;
                dataGridView1.Columns["enId"].Visible = false;
                dataGridView1.Columns["ecId"].Visible = false;
                dataGridView1.Columns["eiId"].Visible = false;
                dataGridView1.Columns["pId"].Visible  = false;
                //dataGridView1.Columns["自动还是手工"].Visible = false;
                dataGridView1.Columns["自动还是手工"].ReadOnly = true;
                break;
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("是否确认分滩数据!!", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                YuanyuDBTemp dbLayer = new YuanyuDBTemp();
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if ((dataGridView1.Rows[i].Cells["Column1"].Value != null) && (dataGridView1.Rows[i].Cells["Column1"].Value.Equals(true)))
                    {
                        DataRow row = recDataTable.NewRow();
                        row["pId"]  = dataGridView1.Rows[i].Cells["pId"].Value.ToString();
                        row["设备编号"] = dataGridView1.Rows[i].Cells["设备编号"].Value.ToString();
                        row["工时"]   = dataGridView1.Rows[i].Cells["工时"].Value.ToString();
                        row["eiId"] = dbLayer.getEiId(row["设备编号"].ToString());

                        recDataTable.Rows.Add(row);
                    }
                }
                this.DialogResult = DialogResult.OK;
            }
        }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            FrmDetachOption form = new FrmDetachOption();

            form.Year  = cmbYear.Text;
            form.Month = cmbMonth.Text;
            YuanyuDBTemp db         = new YuanyuDBTemp();
            bool         isSelected = false;

            switch (formSort)
            {
            case 1:
                form.FormSort = 1;
                form.ShowDialog();
                //YuanyuDBTemp db = new YuanyuDBTemp();
                if (form.RecDataTable.Rows.Count > 0)
                {
                    if (db.ExBitumenDetachData(dataGridView1, form.RecDataTable, isSelected))
                    {
                        MessageBox.Show("分滩成功");
                    }
                    else
                    {
                        MessageBox.Show("分滩失败");
                    }
                }
                else
                {
                    MessageBox.Show("请选择要分滩的产品!!");
                }
                Finddata();
                break;

            case 2:
                form.FormSort = 2;
                form.ShowDialog();
                //YuanyuDBTemp db = new YuanyuDBTemp();
                if (form.RecDataTable.Rows.Count > 0)
                {
                    if (db.ExAlterBitumenDetachData(dataGridView1, form.RecDataTable, isSelected))
                    {
                        MessageBox.Show("分滩成功");
                    }
                    else
                    {
                        MessageBox.Show("分滩失败");
                    }
                }
                else
                {
                    MessageBox.Show("请选择要分滩的产品!!");
                }
                Finddata();
                break;

            case 3:
                form.FormSort = 3;
                form.ShowDialog();
                //YuanyuDBTemp db = new YuanyuDBTemp();
                if (form.RecDataTable.Rows.Count > 0)
                {
                    if (db.ExMixBitumenDetachData(dataGridView1, form.RecDataTable, isSelected))
                    {
                        MessageBox.Show("分滩成功");
                    }
                    else
                    {
                        MessageBox.Show("分滩失败");
                    }
                }
                else
                {
                    MessageBox.Show("请选择要分滩的产品!!");
                }
                Finddata();
                break;
            }
        }