Пример #1
0
        //private void btnFinishPacking_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        DialogResult dr = MessageBox.Show(this,"Do you want to finish the Activity","Confirmation",MessageBoxButtons.YesNo);

        //        if(dr== DialogResult.Yes)
        //        {

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

        //        objBatchActivity.BatchActStatus = BatchActivity.Status.Finished;

        //        objBatchActivity_DL.Update(objBatchActivity);


        //        }

        //        Load_Activity();

        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show(ex.Message.ToString());
        //    }
        //}


        private void btnSendtoPacking_Click(object sender, EventArgs e)
        {
            try
            {
                int       theCount  = 0;
                DataTable dtReports = objQCReport_DL.Get_IsPackingQCPass(dgvActivityz.CurrentRow.Cells["BatchID"].Value.ToString(), Convert.ToInt32(QCReport.ReportStatus.Accept), "Packing");

                theCount = objFinishProduct_DL.Get_SecondaryProductList(dgvActivityz.CurrentRow.Cells["PrimaryFinishProduct"].Value.ToString()).Rows.Count;

                if (dtReports.Rows.Count > 0)
                {
                    if (theCount > 0)
                    {
                        objBatchActivity.BatchActStatus = BatchActivity.Status.SecondaryPacking;
                    }
                    else
                    {
                        objBatchActivity.BatchActStatus = BatchActivity.Status.Finished;
                    }

                    objBatchActivity_DL.Update(objBatchActivity);
                    objBatch_DL.Update_BatchPackingCost(objBatchActivity.BatchActID);

                    Load_Activity();
                }
                else
                {
                    MessageBox.Show(this, "Packing QC is Not Passed", "Can not Proceed", MessageBoxButtons.OK);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Пример #2
0
        private void txtFinalQty_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (DataValidation.IsNumericNumber(txtFinalQty.Text))
                    {
                        objBatchActivity.StopQty = Convert.ToInt32(txtFinalQty.Text);

                        if (objBatchActivity.MainActivity.MainActivityTitle == "Packing_Secondary")
                        {
                            objBatchActivity.BatchActStatus = BatchActivity.Status.SecondaryPacking_Finish;
                        }
                        else
                        {
                            objBatchActivity.BatchActStatus = BatchActivity.Status.Finished;
                        }

                        long x = objBatchActivity_DL.Update(objBatchActivity);
                    }
                    else
                    {
                        MessageBox.Show(this, "Please Enter a Valid Qty", "Wrong Attempt", MessageBoxButtons.OK);
                    }

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Пример #3
0
        private void btnFinishPacking_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dr = MessageBox.Show(this, "Do you want to finish the Activity", "Confirmation", MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    objBatchActivity = objBatchActivity_DL.GetByID(Convert.ToInt32(dgvActivity.CurrentRow.Cells["BatchActID"].Value));

                    objBatchActivity.BatchActStatus = BatchActivity.Status.Finished;

                    objBatchActivity_DL.Update(objBatchActivity);
                }

                Load_Activity();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Пример #4
0
        private void txtFinalQty_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    objBatchActivity.StopQty        = Convert.ToDecimal(txtFinalQty.Text);
                    objBatchActivity.BatchActStatus = BatchActivity.Status.Finished;

                    long x = objBatchActivity_DL.Update(objBatchActivity);

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Пример #5
0
        private void btnFinishActivity_Click(object sender, EventArgs e)
        {
            DialogResult theResult = MessageBox.Show(this, "Have you finish recording all the details of the actitivy", "Confirmation", MessageBoxButtons.YesNo);


            if (theResult == System.Windows.Forms.DialogResult.Yes)
            {
                if (objBatchActivity.BatchActID != 0)
                {
                    int y = objBatch_DL.Get_NotWeighingChecked_Count(objBatchActivity.Batch.BatchID);

                    if (y == 0)
                    {
                        objBatchActivity.BatchActStatus = BatchActivity.Status.Finished;
                        objBatchActivity.StopQty        = 0;

                        long x = objBatchActivity_DL.Update(objBatchActivity);

                        Load_Batch_List();

                        if (dt.Rows.Count > 0)
                        {
                            DataGridViewCellEventArgs er = new DataGridViewCellEventArgs(1, 0);

                            dgvBatcList_CellClick(sender, er);
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "One or More Item is Not Weighing Checked or Not Weighed", "Wrong Attempt", MessageBoxButtons.OK);
                    }
                }
                else
                {
                    MessageBox.Show("Please select a Activity");
                }
            }
        }