private void selectFormularMacth()
        {
            if (!IsPeaple)
            {
                String q = "";
                Double t = 0;
                foreach (DataGridViewRow r in dataGridView1.Rows)
                {
                    if (r.Cells["Id"].Value.ToString() == dataGridView1.CurrentRow.Cells["Id"].Value.ToString())
                    {
                        t += Convert.ToDouble((r.Cells["Quantity"].Value.ToString() == "") ? "0" : r.Cells["Quantity"].Value.ToString());
                    }
                }
                ProductionNew.dialogReqReceive dr = new dialogReqReceive(empid, st, t.ToString(), dataGridView1.CurrentRow.Cells["Id"].Value.ToString(),1);
                dr.ShowDialog();
                if (dr.DialogResult == DialogResult.OK)
                {
                    dataGridView1.CurrentRow.Cells[2].Value = dr.dataGridView1.CurrentRow.Cells[7].Value;
                    dataGridView1.CurrentRow.Cells[4].Value = dr.dataGridView1.CurrentRow.Cells[1].Value;
                }
            }
            else if (st == "1")
            {
                String q = "";
                Double t = 0;
                foreach (DataGridViewRow i in dataGridView1.Rows)
                {
                    if (i.Cells["Id"].Value.ToString() == dataGridView1.CurrentRow.Cells["Id"].Value.ToString())
                    {
                        t += Convert.ToDouble((i.Cells["Quantity"].Value.ToString() == "") ? "0" : i.Cells["Quantity"].Value.ToString());
                    }
                }
                ProductionNew.DialogPeapleRepair r = new DialogPeapleRepair(empid, t.ToString());

                r.ShowDialog();
                if (r.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    dataGridView1.CurrentRow.Cells["QuantityReceive"].Value = r.dataGridView1.CurrentRow.Cells["QuantityBalance"].Value;
                    dataGridView1.CurrentRow.Cells["Id"].Value = r.dataGridView1.CurrentRow.Cells["RepairDetailId"].Value;
                }
            }
        }
 private void selectFormularMacth()
 {
     ProductionNew.dialogReqReceive dr = new dialogReqReceive(Class.Function.GetTextId(textBox3.Text), "0", "0", textBox9.Text,1);
     dr.ShowDialog();
     if (dr.DialogResult == DialogResult.OK)
     {
         Qty = Convert.ToDouble(dr.dataGridView1.CurrentRow.Cells[6].Value.ToString());
         FmId = dr.dataGridView1.CurrentRow.Cells[8].Value.ToString();
         textBox10.Text = dr.dataGridView1.CurrentRow.Cells[3].Value.ToString();
         textBox9.Text = dr.dataGridView1.CurrentRow.Cells[1].Value.ToString();
         LotId = dr.dataGridView1.CurrentRow.Cells[0].Value.ToString();
     }
 }
        private void selectFormularMacth()
        {
            int cutType = getCutType();

            ProductionNew.dialogReqReceive dr = new dialogReqReceive(Class.Function.GetTextId(textBox3.Text), "0", textBox12.Text, textBox9.Text,cutType );
            dr.ShowDialog();
            if (dr.DialogResult == DialogResult.OK)
            {
                Qty = (dr.dataGridView1.CurrentRow.Cells[7].Value.ToDouble());//จำนวน
                FmId = dr.dataGridView1.CurrentRow.Cells[9].Value.IsNullAsEmpty();//รหัสสูตรผลิต
                textBox10.Text = dr.dataGridView1.CurrentRow.Cells[4].Value.IsNullAsEmpty();//ชื่อสูตรผลิต
                textBox9.Text = dr.dataGridView1.CurrentRow.Cells[1].Value.IsNullAsEmpty();//รหัสเบิก
                LotId = dr.dataGridView1.CurrentRow.Cells[0].Value.IsNullAsEmpty();//รหัสงาน
                textBox12.Text = "0";
                //String sql = "select m.mid,m.mname,(Cast(d.mquantity * " + Qty + " as decimal(10,2))) as mquantity," +
                //    "(select u.unitsalename from unitsale u where u.unitsaleid = m.munit) as munit " +
                //    "from productionmaterial m inner join productionformulardetail d" +
                //    " on d.mid = m.mid where d.FmId = '" + FmId + "'";//ดึงข้อมูลวัตถุดิบ
                //dataGridView1.DataSource = Class.DBConnString.clsDB.QueryDataTable(sql);
                //dataGridView1.Columns[0].HeaderText = "รหัสวัตถุดิบ";
                //dataGridView1.Columns[1].HeaderText = "ชื่อวัตถุดิบ";
                //dataGridView1.Columns[1].Width = 200;
                //dataGridView1.Columns[2].HeaderText = "จำนวน";
                //dataGridView1.Columns[3].HeaderText = "หน่วย";
                FmIdTemp = FmId;
                OutstandingIdTemp = LotId;
            }
        }