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 toolStripButton1_Click(object sender, EventArgs e) { ProductionNew.ProductionReqAddRepair frm = new ProductionReqAddRepair( 1,DgvItem.CurrentRow.Cells["OldProductionId"].Value.ToString(), 0 ); frm.ShowDialog(); }
private void toolStripButton5_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count < 1) return; if (dataGridView1.CurrentRow.Cells["ProductionTypeId"].Value.ToString() == "0" && dataGridView1.CurrentRow.Cells["ProductionImpStatusName"].Value.ToString() == "ปกติ") { ProductionNew.ProductionReqAddRepair frm = new ProductionReqAddRepair( dataGridView1.CurrentRow.Cells["NewLotId"].Value.ToString(), dataGridView1.CurrentRow.Cells["ProductionDrawId"].Value.ToString(), 0 );//เรียกหน้าใบเบิกซ่อม frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { ClearGrid(); LoadHead("where h.productiontypeid = 2"); LoadDetail(); LoadWeight(); } } else { MetroFramework.MetroMessageBox.Show(this, "ข้อมูลที่เลือก ไม่สามารถเบิกเพิ่มได้ กรุณาเลือกรายการให้ถูกต้อง", "ผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Error); } }