Beispiel #1
0
        public int Update_RPD(BatchPackingMR obj, MTN.Status MTNState, MTN.Type MTNType, MTN.ItemType MTNItemType, string EnteredBy)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@BatchID", obj.BatchID),
                    new SqlParameter("@BatchUsed", obj.BatchUsed),
                    new SqlParameter("@BatchDamaged", obj.BatchDamaged),
                    new SqlParameter("@BatchReturned", obj.BatchReturned),
                    new SqlParameter("@State", obj.State),
                    new SqlParameter("@MTNStatus", Convert.ToInt32(MTNState)),
                    new SqlParameter("@MTNType", Convert.ToInt32(MTNType)),
                    new SqlParameter("@MTNItemType", Convert.ToInt32(MTNItemType)),
                    new SqlParameter("@EnteredBy", EnteredBy),
                    new SqlParameter("@IssuedBy", Convert.ToInt32(MTNType)),
                    new SqlParameter("@StartQty", obj.StartQty),
                    new SqlParameter("@ID", obj.ID)
                };

                return(Execute.RunSP_RowsEffected(Connection, "SPUPDATE_BatchPackingMR_RPD", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Beispiel #2
0
        private void cmbMRNO_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                BatchPackingMR obj           = new BatchPackingMR();
                MRMaterial     objMRMaterial = new MRMaterial();

                Material objMaterial = new Material();

                obj = objBatchPackingMR_DL.Get(Convert.ToInt64(cmbMRNO.SelectedValue));


                objMaterial   = objMaterial_DL.Get(obj.MaterialCode);
                lblUnit1.Text = objMaterial.MatUnit.UnitCode;
                lblUnit2.Text = objMaterial.MatUnit.UnitCode;
                lblUnit3.Text = objMaterial.MatUnit.UnitCode;


                txtQunatityReceived.Text = obj.StartQty.ToString();

                //  txtDamagedQty.Text = obj.BatchDamaged.ToString();
                // txtBatchReturned.Text = obj.BatchReturned.ToString();
                // txtBatchUsed.Text = obj.BatchUsed.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #3
0
        private void btnFinalize_Click(object sender, EventArgs e)
        {
            if (DataValidation.Is3DecimalPointNumber(txtDamagedQty.Text) && DataValidation.Is3DecimalPointNumber(txtBatchUsed.Text))
            {
                try
                {
                    BatchPackingMR   obj = new BatchPackingMR();
                    BatchActivity    objBatchActivity    = new BatchActivity();
                    BatchActivity_DL objBatchActivity_DL = new BatchActivity_DL(ConnectionStringClass.GetConnection());

                    obj = objBatchPackingMR_DL.Get(Convert.ToInt64(cmbMRNO.SelectedValue));

                    objBatchActivity = objBatchActivity_DL.GetByID(Convert.ToInt32(txtPackingBatch.Text));

                    if ((objBatchActivity.BatchActStatus == BatchActivity.Status.Finished) | (objBatchActivity.BatchActStatus == BatchActivity.Status.SecondaryPacking_Finish) | (objBatchActivity.BatchActStatus == BatchActivity.Status.Transferred))
                    {
                        MessageBox.Show("Activity is Already Finished");
                    }
                    else
                    {
                        if (obj.StartQty >= Convert.ToDecimal(txtDamagedQty.Text) + Convert.ToDecimal(txtBatchReturned.Text) + Convert.ToDecimal(txtBatchUsed.Text))
                        {
                            obj.BatchID        = BatchID;
                            obj.BatchDamaged   = Convert.ToDecimal(txtDamagedQty.Text);
                            obj.BatchReturned  = Convert.ToDecimal(txtBatchReturned.Text);
                            obj.BatchUsed      = Convert.ToDecimal(txtBatchUsed.Text);
                            obj.State          = 1;
                            obj.BatchPackingID = Convert.ToInt64(txtPackingBatch.Text);


                            objBatchPackingMR_DL.Update(obj, MTN.Status.Initial, MTN.Type.Reject, MTN.ItemType.Material, CurrentUser.EmployeeID);
                        }
                        else
                        {
                            MessageBox.Show("Invalid Qty");
                        }
                    }

                    Load_MRList();

                    cmbMRNO_SelectedIndexChanged(sender, e);

                    txtBatchReturned.Text = "";
                    txtBatchUsed.Text     = "";
                    txtDamagedQty.Text    = "";

                    txtBatchUsed.Select();
                    loadSectionData();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            else
            {
                MessageBox.Show(this, "please enter valid quantity", "MRP System", MessageBoxButtons.OK);
            }
        }
Beispiel #4
0
        private void cmbMRNO_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                obj = objBatchPackingMR_DL.Get(Convert.ToInt64(cmbMRNO.SelectedValue));


                txtQunatityReceived.Text = obj.StartQty.ToString();

                //  txtDamagedQty.Text = obj.BatchDamaged.ToString();
                // txtBatchReturned.Text = obj.BatchReturned.ToString();
                // txtBatchUsed.Text = obj.BatchUsed.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #5
0
        private void btnFinalize_Click(object sender, EventArgs e)
        {
            try
            {
                BatchPackingMR obj = new BatchPackingMR();

                obj = objBatchPackingMR_DL.Get(Convert.ToInt64(cmbMRNO.SelectedValue));


                if (obj.StartQty >= Convert.ToDecimal(txtDamagedQty.Text) + Convert.ToDecimal(txtBatchReturned.Text) + Convert.ToDecimal(txtBatchUsed.Text))
                {
                    obj.BatchID       = BatchID;
                    obj.BatchDamaged  = Convert.ToDecimal(txtDamagedQty.Text);
                    obj.BatchReturned = Convert.ToDecimal(txtBatchReturned.Text);
                    obj.BatchUsed     = Convert.ToDecimal(txtBatchUsed.Text);
                    obj.State         = 1;


                    objBatchPackingMR_DL.Update_RPD(obj, MTN.Status.Initial, MTN.Type.Reject, MTN.ItemType.Material, CurrentUser.EmployeeID);
                }
                else
                {
                    MessageBox.Show("Invalid Qty");
                }



                Load_MRList();

                cmbMRNO_SelectedIndexChanged(sender, e);

                txtBatchReturned.Text = "";
                txtBatchUsed.Text     = "";
                txtDamagedQty.Text    = "";

                txtBatchUsed.Select();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #6
0
        public String Add(BatchPackingMR obj)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@BatchNo", obj.BatchID),
                    new SqlParameter("@MRNO", obj.MRNO),
                    new SqlParameter("@BatchUsed", obj.BatchUsed),
                    new SqlParameter("@BatchDamaged", obj.BatchDamaged),
                    new SqlParameter("@BatchReturned", obj.BatchReturned),
                    new SqlParameter("@MRState", obj.State),
                    new SqlParameter("@IssuedBy", obj.IssuedBy),
                    new SqlParameter("@IssuedDate", obj.IssuedDate),
                    new SqlParameter("@BulkPrint", obj.BulkPrint)
                };

                return(Execute.RunSP_Output_String(Connection, "SPADD_BatchPackingMR", paramList));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
Beispiel #7
0
        public BatchPackingMR Get(long ID)
        {
            try
            {
                SqlParameter[] paramList = new SqlParameter[] {
                    new SqlParameter("@ID", ID)
                };


                DataTable dt = Execute.RunSP_DataTable(Connection, "SPGET_BatchPackingMR_ByID", paramList);

                BatchPackingMR obj = new BatchPackingMR();

                if (dt.Rows.Count != 0)
                {
                    obj.BatchDamaged = Convert.ToDecimal(dt.Rows[0]["BatchDamaged"]);
                    if (dt.Rows[0]["BatchNO"] != DBNull.Value)
                    {
                        obj.BatchID = Convert.ToString(dt.Rows[0]["BatchNO"]);
                    }
                    obj.BatchReturned = Convert.ToDecimal(dt.Rows[0]["BatchReturned"]);
                    obj.BatchUsed     = Convert.ToDecimal(dt.Rows[0]["BatchUsed"]);
                    obj.ID            = Convert.ToInt64(dt.Rows[0]["ID"]);
                    obj.State         = Convert.ToInt32(dt.Rows[0]["State"]);
                    obj.MRNO          = Convert.ToInt64(dt.Rows[0]["MRNO"]);
                    obj.MaterialCode  = Convert.ToString(dt.Rows[0]["MaterialCode"]);
                    obj.StartQty      = Convert.ToDecimal(dt.Rows[0]["StartQty"]);
                }

                return(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }