Esempio n. 1
0
        private void btnStartPacking_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dr = MessageBox.Show(this, "Do you want to add a new Packing Batch to  " + objBatch.BatchID + "  from  " + cmbFinishedProduct.SelectedValue.ToString(), "Confirmation", MessageBoxButtons.YesNo);
                long         i;

                if (dr == DialogResult.Yes)
                {
                    i = objBatchActivity_DL.Add_Packing(objBatch.BatchID, Convert.ToInt32(Batch.Status.Packing), objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, cmbFinishedProduct.SelectedValue.ToString(), Convert.ToDecimal(txtPackingQty.Text), CurrentUser.EmployeeID, "Normal");


                    if (i == 0)
                    {
                        MessageBox.Show(this, "Quantity you are trying to packing is not a realistic Value", "Wrong Attempt", MessageBoxButtons.OK);
                    }
                    else
                    {
                        Load_Batch_List();
                        Load_Activity();
                    }
                }


                txtPackingQty.Text = "";
                cmbFinishedProduct.Select();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 2
0
        private void btnStartPacking_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrWhiteSpace(txtPackingQty.Text) && DataValidation.Is3DecimalPointNumber(txtPackingQty.Text))
                {
                    DialogResult dr = MessageBox.Show(this, "Do you want to add a new Packing Batch to  " + objBatch.BatchID + "  from  " + cmbFinishedProduct.SelectedValue.ToString(), "Confirmation", MessageBoxButtons.YesNo);
                    long         i;

                    if (dr == DialogResult.Yes)
                    {
                        if (chkOutsource.Checked == false)
                        {
                            i = objBatchActivity_DL.Add_Packing(objBatch.BatchID, Convert.ToInt32(Batch.Status.Packing), objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, cmbFinishedProduct.SelectedValue.ToString(), Convert.ToDecimal(txtPackingQty.Text), CurrentUser.EmployeeID, "Normal");
                        }
                        else
                        {
                            i = objBatchActivity_DL.Add_Packing(objBatch.BatchID, Convert.ToInt32(Batch.Status.Packing), objBatch.StandardBatch.STDBatchBasicProduct.BasicProductCode, cmbFinishedProduct.SelectedValue.ToString(), Convert.ToDecimal(txtPackingQty.Text), CurrentUser.EmployeeID, "Outsource");
                        }


                        if (i == 0)
                        {
                            MessageBox.Show(this, "Quantity you are trying to packing is not a realistic Value", "Wrong Attempt", MessageBoxButtons.OK);
                        }
                        else
                        {
                            Load_Batch_List();
                            Load_Activity();
                        }
                    }


                    txtPackingQty.Text = "";
                    cmbFinishedProduct.Select();
                }
                else
                {
                    MessageBox.Show(this, "please enter valid input quantity", "MRP System", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }