Esempio n. 1
0
 private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView2.Columns[0].Name != "ProductionWaitDetailid") return;//รหัสรายการรอตรวจ
     //if (dataGridView2.CurrentRow.Cells["ProductionWaitStatusName"].Value.ToString() == "รอตรวจ" || dataGridView2.CurrentRow.Cells["ProductionWaitStatusName"].Value.ToString() == "ตรวจแล้วบางส่วน")
     //{
         ProductionNew.frmCheckingWait ck = new frmCheckingWait(
             dataGridView2.Rows[e.RowIndex].Cells[0].Value.ToString(),//รหัสตรวจนับอวนดี
             dataGridView2.Rows[e.RowIndex].Cells[2].Value.ToString(),//รหัสสินค้า
             dataGridView2.Rows[e.RowIndex].Cells[3].Value.ToString(),//ชื่อสินค้า
             dataGridView2.Rows[e.RowIndex].Cells[5].Value.ToString(),//หน่วยขาย
             dataGridView2.Rows[e.RowIndex].Cells[1].Value.ToString(),//รหัสตรวจนับ
             dataGridView2.Rows[e.RowIndex].Cells["cate"].Value.ToString()//cate
             );//เรียกหน้ารอตรวจ
         ck.ShowDialog();
         if (ck.DialogResult == DialogResult.OK)
         {
             loadChecking();
         }
     //}
 }
Esempio n. 2
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     if (dataGridView2.Rows.Count < 1) return;
     if (dataGridView2.Columns[0].Name != "ProductionWaitDetailid") return;
     if (dataGridView2.CurrentRow.Cells["ProductionWaitStatusName"].Value.ToString() == "รอตรวจ" || dataGridView2.CurrentRow.Cells["ProductionWaitStatusName"].Value.ToString() == "ตรวจแล้วบางส่วน")
         {
             ProductionNew.frmCheckingWait ck = new frmCheckingWait(
                 dataGridView2.CurrentRow.Cells[0].Value.ToString(),//รหัสตรวจนับอวนดี
                 dataGridView2.CurrentRow.Cells[2].Value.ToString(),//รหัสสินค้า
                 dataGridView2.CurrentRow.Cells[3].Value.ToString(),//ชื่อสินค้า
                 dataGridView2.CurrentRow.Cells[5].Value.ToString(),//หน่วยขาย
                 dataGridView2.CurrentRow.Cells[1].Value.ToString(),//รหัสตรวจนับ
                 dataGridView2.CurrentRow.Cells["cate"].Value.ToString());//cate
             ck.ShowDialog();//เรียกหน้าตรวจรับสินค้า
             if (ck.DialogResult == DialogResult.OK)
             {
                 loadChecking();
             }
         }
 }
Esempio n. 3
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (whe != "")
            {
                toolStripButton10_Click(sender, e);
                return;
            }

            string sqlselect = "select ProductionWaitStatusId from productionwaithead where ProductionWaitId = '" + dataGridView1.CurrentRow.Cells["ProductionWaitId"].Value.ToString() + "' ";
            int value = Convert.ToInt16 (Class.DBConnString.clsDB.QueryExecuteScalarNonAlert(sqlselect));
            if (value != 2)
            {
                if (dataGridView1.Columns[0].Name != "ProductionWaitId")
                {
                    if (dataGridView1.CurrentRow.Cells["ConfirmName"].Value.ToString() == "อนุมัติ") return;
                    ProductionNew.frmCheckingWait ck = new frmCheckingWait(dataGridView1.CurrentRow.Cells[1].Value.ToString());//เรียกหน้า สินค้ารอตรวจ
                    ck.ShowDialog();
                    if (ck.DialogResult == DialogResult.OK)
                    {
                        loadChecking();
                    }
                }
                else
                {
                    String n = "0";
                    if (dataGridView1.Rows[e.RowIndex].Cells["ProductionWaitStatusName"].Value.ToString() == "รอตรวจ" &&
                        dataGridView1.Rows[e.RowIndex].Cells["productionrcstatusname"].Value.ToString() == "ปกติ")
                    {
                        n = "1";
                    }
                    ProductionNew.ProductionChecking pc = new ProductionChecking(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(), n);//เรียกหน้าตรวจสอบคุณภาพสินค้า
                    pc.ShowDialog();
                    if (pc.DialogResult == DialogResult.OK)
                    {
                        loadFirst(" where p.ProductionWaitStatusid in(0,1) and p.ProductionRcStatusid in(0)  ");
                    }
                }
            }
            else
            {
                ProductionNew.ProductionChecking2 pc = new ProductionChecking2(dataGridView1.Rows[e.RowIndex].Cells["ProductionWaitId"].Value.ToString());//เรียกหน้าตรวจสอบคุณภาพสินค้า
                pc.ShowDialog();
                if (pc.DialogResult == DialogResult.OK)
                {
                    loadFirst(" where p.ProductionWaitStatusid =2 and p.ProductionRcStatusid in(0)  ");
                }
            }
        }