示例#1
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.F1)
            {
                frmBatchMaterial objForm = new frmBatchMaterial(objBatch.BatchID);
                objForm.ShowDialog(this);
            }


            if (keyData == Keys.F2)
            {
                frmBatchPackingMR objForm = new frmBatchPackingMR(objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, objBatch.BatchID, CurrentUser, Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value));
                objForm.ShowDialog(this);
            }

            if (keyData == Keys.F3)
            {
                if (dgvActivity.CurrentRow != null)
                {
                    frmBatchPacking_DamagedGoods objForm = new frmBatchPacking_DamagedGoods(Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value), "Primary");
                    objForm.ShowDialog(this);
                }
                else
                {
                    MessageBox.Show("Please select a Packing Batch");
                }
            }

            return(base.ProcessCmdKey(ref msg, keyData));

            // Call the base class
            return(base.ProcessCmdKey(ref msg, keyData));
        }
示例#2
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.F1)
            {
                frmBatchMaterial objForm = new frmBatchMaterial(objBatch.BatchID);
                objForm.ShowDialog(this);
            }


            if (keyData == Keys.F2)
            {
                if ((objBatch.BatchType == "Rework") | (objBatch.BatchType == "Repack"))
                {
                    string x = objBatch_DL.Get_BasicProduct_Rework(objBatch.BatchID);
                    if (dgvActivity.Rows.Count > 0)
                    {
                        if (Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value) != 0)
                        {
                            frmBatchPackingMR objForm = new frmBatchPackingMR(x, objBatch.BatchID, CurrentUser, Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value));
                            objForm.ShowDialog(this);
                        }
                        else
                        {
                            MessageBox.Show("Please select a Packing Batch");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please select a Packing Batch");
                    }
                }
                else
                {
                    if (dgvActivity.Rows.Count > 0)
                    {
                        if (Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value) != 0)
                        {
                            frmBatchPackingMR objForm = new frmBatchPackingMR(objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, objBatch.BatchID, CurrentUser, Convert.ToInt64(dgvActivity.CurrentRow.Cells["BatchActID"].Value));

                            objForm.ShowDialog(this);
                        }
                        else
                        {
                            MessageBox.Show("Please select a Packing Batch");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please select a Packing Batch");
                    }
                }
            }

            return(base.ProcessCmdKey(ref msg, keyData));

            // Call the base class
            return(base.ProcessCmdKey(ref msg, keyData));
        }