Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 private void toolStripButton3_Click(object sender, EventArgs e)
 {
     if (dataGridView1.Rows.Count < 1) return;
         if (dataGridView1.CurrentRow.Cells["ProductionStatusId"].Value.ToString() == "0" &&
             dataGridView1.CurrentRow.Cells["ProductionTypeId"].Value.ToString() == "0" &&
             dataGridView1.CurrentRow.Cells["ProductionImpStatusName"].Value.ToString() == "ปกติ")
         {
             ProductionNew.ProductionReqAddPlus frm = new ProductionReqAddPlus(
                 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 = 1");
                 LoadDetail();
                 LoadWeight();
             }
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this,"ข้อมูลที่เลือก ไม่สามารถเบิกเพิ่มได้ กรุณาเลือกรายการให้ถูกต้อง","ผิดพลาด",MessageBoxButtons.OK,MessageBoxIcon.Error);
         }
 }