Пример #1
0
        public System.Data.SqlClient.SqlTransaction AbortGINProcess()
        {
            IGINProcess    originalGIN = new GINProcessBLL(currentGINProcess.GINProcessInformation.TransactionId);
            SqlTransaction transaction = currentGINProcess.AbortGINProcess();

            try
            {
                AuditTrailWrapper atw = new AuditTrailWrapper(AuditTrailWrapper.GINAbortion, "PUN Process");
                atw.AddChange(originalGIN.GINProcessInformation, currentGINProcess.GINProcessInformation, AuditTrailWrapper.ExistingRecord);

                if (!atw.Save())
                {
                    transaction.Rollback();
                    throw new Exception("Failed to save audit trail!");
                }
            }
            catch (Exception ex)
            {
                transaction.Rollback();
                throw ex;
            }
            return(transaction);
        }
Пример #2
0
        public static void RejectGINProcess()
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.AbortGINProcess();
                IPickupNotice pun = new PickupNoticeBLL(ginProcess.GINProcessInformation.PickupNoticeId);
                UpdatePUNStatus(
                    pun.PickupNoticeInformation.PickupNoticeId,
                    pun.LookupSource.GetLookup("Status")[pun.PickupNoticeInformation.Status]);
                CompleteWorkflowTask(ginProcess.GINProcessInformation.TransactionId);
                transaction.Commit();
            }
            catch (Exception ex)
            {
                if (transaction != null)
                {
                    transaction.Rollback();
                }
                throw ex;
            }
        }