Ejemplo n.º 1
0
        public static void SaveAvailabilityVerification(PUNAcknowledgementInformation acknowledgement)//, AuditTrailWrapper auditTrail)
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.SaveAvailabilityVerification(acknowledgement);
                //if (!auditTrail.Save())
                //    throw new Exception("Failed to save audit trail!");
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
Ejemplo n.º 2
0
        void PUNADataEditor_Ok(object sender, EventArgs e)
        {
            try
            {
                PUNAcknowledgementInformation puna = (PUNAcknowledgementInformation)PUNADataEditor.DataSource;
                PUNWrapper.AcknowledgePickupNotice(puna);//, new AuditTrailWrapper("Initiate PUN Process",
                //new object[][]{new object[]{pickupNotice.PUNAInformation, puna}}));

                PageDataTransfer reportTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ReportViewerForm.aspx");
                reportTransfer.TransferData["TransactionId"]    = puna.TransactionId;
                reportTransfer.TransferData["IsGINTransaction"] = false;
                reportTransfer.TransferData["RequestedReport"]  = "rptPUNTrackingReport";
                reportTransfer.TransferData["ReturnPage"]       = transferedData.GetTransferedData("ReturnPage");
                reportTransfer.PersistToSession();
                ScriptManager.RegisterStartupScript(this,
                                                    this.GetType(),
                                                    "ShowReport",
                                                    "<script type=\"text/javascript\">" +
                                                    string.Format("javascript:window.open(\"ReportViewerForm.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) +
                                                    string.Format("location.href = '{0}';", transferedData.GetTransferedData("ReturnPage")) +
                                                    "</script>",
                                                    false);

                GINProcessWrapper.RemoveGINProcessInformation();
            }
            catch (Exception ex)
            {
                errorDisplayer.ShowErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 3
0
        public SqlTransaction AcknowledgePickupNotice(PUNAcknowledgementInformation acknowledgement)
        {
            if (!acknowledgement.PickupNoticeAgentVerified)
            {
                throw new Exception("Please confirm pickup notice agent has been verified.");
            }
            if (acknowledgement.ClientId == Guid.Empty)
            {
                throw new Exception("This pickup notice is issued to unknown client and couldnot be processed.");
            }
            if (acknowledgement.CommodityGradeId == Guid.Empty)
            {
                throw new Exception("The commodity grade in this pickup notice is unknown.");
            }
            acknowledgement.PledgedWeight  = acknowledgement.Weight;
            PickupNoticeInformation.Status = (int)PUNStatusType.BeingIssued;
            Dictionary <string, object> contextParameters = new Dictionary <string, object>();

            contextParameters.Add("CurrentUser", new Guid(SystemLookup.LookupSource.GetLookup("CurrentUser")["Id"]));
            try
            {
                return(PersistenceTransactionFactory.CreatePersistenceTransaction().Persist(
                           new Queue <object>(new object[] { PickupNoticeInformation, acknowledgement }), contextParameters));
            }
            catch (Exception ex)
            {
                throw new Exception("Your acknowledgement couldn't be saved to the database");
            }
        }
Ejemplo n.º 4
0
        public static void AcknowledgePickupNotice(PUNAcknowledgementInformation puna)//, AuditTrailWrapper auditTrail)
        {
            IPickupNotice                 pun         = GetPUN(true);
            AuditTrailWrapper             auditTrail  = new AuditTrailWrapper(AuditTrailWrapper.PUNInitiation, "PUN Process");
            PUNAcknowledgementInformation originalPUN = new PUNAcknowledgementInformation();

            originalPUN.Copy(pun.PUNAInformation);
            auditTrail.AddChange(new object[][] { new object[] { originalPUN, puna, AuditTrailWrapper.NewRecord } });
            SqlTransaction transaction   = null;
            string         transactionId = null;

            try
            {
                transaction   = pun.AcknowledgePickupNotice(puna);
                transactionId = StartPUNWorkflow();
                if (transactionId != string.Empty)
                {
                    puna.TransactionId = transactionId;
                    pun.AcknowledgePickupNotice(puna, transaction);
                    if (!WarehouseTrackingNoBLL.Save(transactionId, transaction))
                    {
                        GINProcessWrapper.RemoveWorkflowTask(transactionId);
                        throw new Exception("Failed to start PUN Transaction");
                    }
                }
                else
                {
                    throw new Exception("Failed to start PUN Transaction");
                }
                if (!auditTrail.Save())
                {
                    throw new Exception("Failed to save audit trail");
                }
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if ((transactionId != null) && (transactionId != string.Empty))
                    {
                        GINProcessWrapper.RemoveWorkflowTask(transactionId);
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                finally
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                throw ex;
            }
        }
Ejemplo n.º 5
0
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     try
     {
         PUNAcknowledgementInformation acknowledgement         = (PUNAcknowledgementInformation)PUNADataEditor.DataSource;
         PUNAcknowledgementInformation originalAcknowledgement = ginProcess.GINProcessInformation.PUNAcknowledgement;
         //AuditTrailWrapper auditTrail = new AuditTrailWrapper("Inverntory Verification",
         //    new object[][]{new object[]{originalAcknowledgement, acknowledgement}});
         GINProcessWrapper.SaveAvailabilityVerification(acknowledgement);//, auditTrail);
         GINProcessWrapper.CompleteAvailabilityVerification();
         GINProcessWrapper.RemoveGINProcessInformation();
         transferedData.Return();
     }
     catch (Exception ex)
     {
         Utility.LogException(ex);
         errorDisplayer.ShowErrorMessage(ex.Message);
     }
 }
Ejemplo n.º 6
0
        public SqlTransaction SaveAvailabilityVerification(PUNAcknowledgementInformation punaInformation)
        {
            IPickupNotice originalPUN = new PickupNoticeBLL(currentGINProcess.GINProcessInformation.PickupNoticeId);
            //ConfirmNoConcurrency(PUNAInformation);
            SqlTransaction transaction = currentGINProcess.SaveAvailabilityVerification(punaInformation);

            try
            {
                AuditTrailWrapper atw = new AuditTrailWrapper(AuditTrailWrapper.PUNInitiation,
                                                              new object[][] { new object[] { originalPUN.PUNAInformation, punaInformation, AuditTrailWrapper.ExistingRecord } }, "PUN Process");
                if (!atw.Save())
                {
                    transaction.Rollback();
                    throw new Exception("Failed to save audit trail!");
                }
            }
            catch (Exception ex)
            {
                transaction.Rollback();
                throw ex;
            }
            return(transaction);
        }
Ejemplo n.º 7
0
 public void ValidateAvailabilityConfirmation(PUNAcknowledgementInformation punaInformation)
 {
     currentGINProcess.ValidateAvailabilityConfirmation(punaInformation);
 }