private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (whe != "") { toolStripButton12_Click_1(sender, e); return; } if (dataGridView1.CurrentRow.Cells["ProductionTypeId"].Value.ToString() == "0" && dataGridView1.CurrentRow.Cells["confirmName"].Value.ToString() == "รออนุมัติ") { ProductionNew.ProductionReqAdd frm = new ProductionReqAdd(dataGridView1.CurrentRow.Cells[0].Value.ToString()); frm.ShowDialog();//เรียกหน้าเบิกผลิต } else if (dataGridView1.CurrentRow.Cells["ProductionTypeId"].Value.ToString() == "1" && dataGridView1.CurrentRow.Cells["confirmName"].Value.ToString() == "รออนุมัติ") { ProductionNew.ProductionReqAddPlus frm = new ProductionReqAddPlus(dataGridView1.CurrentRow.Cells[0].Value.ToString(),1); frm.ShowDialog();//เรียกหน้าเบิกเพิ่ม } else if (dataGridView1.CurrentRow.Cells["ProductionTypeId"].Value.ToString() == "2" && dataGridView1.CurrentRow.Cells["confirmName"].Value.ToString() == "รออนุมัติ") { ProductionNew.ProductionReqAddRepair frm = new ProductionReqAddRepair(dataGridView1.CurrentRow.Cells[0].Value.ToString(), 1); frm.ShowDialog();//เรียกหน้าเบิกซ่อม } else { MetroFramework.MetroMessageBox.Show(this, "ใบเบิกนี้ถูกอนุมัติแล้ว ไม่สามารถแก้ไขได้", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void reqAdd_Click(object sender, EventArgs e) { ProductionNew.ProductionReqAdd frm = new ProductionReqAdd(); frm.WindowState = FormWindowState.Maximized; frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { ClearGrid(); LoadHead("where h.productiontypeid = 0"); LoadDetail(); LoadWeight(); } }