Пример #1
0
        private void btn增加物资验收记录_Click(object sender, EventArgs e)
        {
            物资验收记录 form = new 物资验收记录(mainform);

            form.Show();
            if (dataGridView1.Rows.Count > 0)
            {
                dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.Count - 1;
            }
        }
Пример #2
0
 void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         int    id   = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value);
         物资验收记录 form = new 物资验收记录(mainform, id);
         form.Owner = this;
         form.ShowDialog();
     }
 }
Пример #3
0
        private void btn提交审核_Click(object sender, EventArgs e)
        {
            String n;

            if (!checkOuterData(out n))
            {
                MessageBox.Show("请填写完整的信息: " + n, "提示");
                return;
            }


            SqlDataAdapter    da;
            SqlCommandBuilder cb;
            DataTable         dt;



            da = new SqlDataAdapter("select * from 待审核 where 表名='不合格品处理记录' and 对应ID=" + dtOuter.Rows[0]["ID"], mySystem.Parameter.conn);
            cb = new SqlCommandBuilder(da);

            dt = new DataTable("temp");
            da.Fill(dt);
            DataRow dr = dt.NewRow();

            dr["表名"]   = "不合格品处理记录";
            dr["对应ID"] = dtOuter.Rows[0]["ID"];
            dt.Rows.Add(dr);
            da.Update(dt);


            dtOuter.Rows[0]["现场应急处理措施审核员"] = "__待审核";

            _formState      = Parameter.FormState.待审核;
            btn提交审核.Enabled = false;
            daOuter.Update((DataTable)bsOuter.DataSource);
            btn保存.PerformClick();
            setFormState();
            setEnableReadOnly();


            setControlFalse();

            // 判断是否要生产请验单等
            int tmpID = Convert.ToInt32(dtOuter.Rows[0]["物资验收记录ID"]);

            da = new SqlDataAdapter("select * from 不合格品处理记录 where 物资验收记录ID=" + tmpID, mySystem.Parameter.conn);
            dt = new DataTable("temp");
            foreach (DataRow nndr in dt.Rows)
            {
                if (nndr["现场应急处理措施审核员"].ToString() == "")
                {
                    return;
                }
            }
            MessageBox.Show("本物资验收单下的所有物料均检验完毕,正在生成物资请验单、取样记录、检验台账!");
            物资验收记录 form = new 物资验收记录(mainform, tmpID);

            form.create请验单();
            form.create取样记录();
            form.insert检验台账();
            form.insert库存台帐();
        }
Пример #4
0
        void tsi_Click(object sender, EventArgs e)
        {
            SqlDataAdapter da;
            DataTable      dt;

            if (this.Name == sender.ToString())
            {
                return;
            }
            int id;

            if (this.Name == "物资验收记录")
            {
                id = Convert.ToInt32(dtOuter.Rows[0]["ID"]);
            }
            else
            {
                id = Convert.ToInt32(dtOuter.Rows[0]["物资验收记录ID"]);
            }
            try
            {
                switch (sender.ToString())
                {
                case "物资验收记录":
                    物资验收记录 form1 = new 物资验收记录(mainform, id);
                    form1.Show();
                    break;

                case "物资请验单":
                    da = new SqlDataAdapter("select * from 物资请验单 where 物资验收记录ID=" + id, mySystem.Parameter.conn);
                    dt = new DataTable();
                    da.Fill(dt);
                    物资请验单 form2 = new 物资请验单(mainform, Convert.ToInt32(dt.Rows[0]["ID"]));
                    form2.Show();
                    break;

                case "检验记录":
                    da = new SqlDataAdapter("select * from 检验记录 where 物资验收记录ID=" + id, mySystem.Parameter.conn);
                    dt = new DataTable();
                    da.Fill(dt);
                    if (dt.Rows.Count == 0)
                    {
                        MessageBox.Show("没有关联的检验记录");
                    }
                    foreach (DataRow dr in dt.Rows)
                    {
                        (new  验记录(mainform, Convert.ToInt32(dr["ID"]))).Show();                                //form3.Show();
                    }
                    break;

                case "取样记录":
                    da = new SqlDataAdapter("select * from 取样记录 where 物资验收记录ID=" + id, mySystem.Parameter.conn);
                    dt = new DataTable();
                    da.Fill(dt);
                    取样记录 form4 = new 取样记录(mainform, Convert.ToInt32(dt.Rows[0]["ID"]));
                    form4.Show();
                    break;
                }
            }
            catch
            {
                MessageBox.Show("关联失败,请检查是否有相应数据");
            }
            //MessageBox.Show(this.Name + "\n" + sender.ToString());
        }