Example #1
0
        private void btnEditBatch_Click(object sender, EventArgs e)
        {
            if (DataValidation.Is3DecimalPointNumber(txtPackingQty.Text))
            {
                try
                {
                    BatchActivity objBatchActivity = new BatchActivity();


                    objBatchActivity = objBatchActivity_DL.GetByID(Convert.ToInt32(dgvActivity.CurrentRow.Cells["BatchActID"].Value));

                    //if (objBatchActivity.BatchActStatus == BatchActivity.Status.Start)
                    //{
                    objBatchActivity.EndProductCode = cmbFinishedProduct.SelectedValue.ToString();
                    objBatchActivity.StartQty       = Convert.ToDecimal(txtPackingQty.Text);
                    objBatchActivity.StopQty        = Convert.ToDecimal(txtOutputQty.Text);

                    objBatchActivity_DL.Update_All(objBatchActivity);


                    Load_Activity();
                    //}
                    //else
                    //{
                    //    MessageBox.Show(this, "This Activity Can not be Edited", "Wrong Attempt", MessageBoxButtons.OK);
                    //}
                }
                catch (Exception)
                {
                    MessageBox.Show(this, "Error occured while loading Labour Details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                MessageBox.Show(this, "please enter valid Quantity Details", "MRP System", MessageBoxButtons.OK);
            }
        }
Example #2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (DataValidation.Is3DecimalPointNumber(txtInputQty.Text) && DataValidation.Is3DecimalPointNumber(txtOutputQty.Text))
            {
                try
                {
                    objBatchActivity.EndProductCode = cmbOutputCode.SelectedValue.ToString();
                    objBatchActivity.StartQty       = Convert.ToDecimal(txtInputQty.Text);
                    objBatchActivity.StopQty        = Convert.ToDecimal(txtOutputQty.Text);

                    objBatchActivity_DL.Update_All(objBatchActivity);

                    Load_SecondaryActivityList();
                }
                catch (Exception)
                {
                    MessageBox.Show(this, "Error occured while loading Labour Details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            else
            {
                MessageBox.Show(this, "please enter valid Quantity Details", "MRP System", MessageBoxButtons.OK);
            }
        }