Esempio n. 1
0
        public System.Data.SqlClient.SqlTransaction SaveGIN(Guid truckId)
        {
            IGINProcess    originalGIN = new GINProcessBLL(currentGINProcess.GINProcessInformation.TransactionId);
            SqlTransaction transaction = currentGINProcess.SaveGIN(truckId);
            //ConfirmNoConcurrency(GIN)
            var ginChanges = (from oGIN in originalGIN.GINProcessInformation.Trucks
                              join cGIN in currentGINProcess.GINProcessInformation.Trucks
                              on oGIN.TruckId equals cGIN.TruckId
                              where oGIN.TruckId == truckId
                              select new object[] { oGIN, cGIN, AuditTrailWrapper.ExistingRecord });

            try
            {
                AuditTrailWrapper atw = new AuditTrailWrapper(AuditTrailWrapper.TruckLoading, ginChanges.ToArray(), "GIN Process");


                if (!atw.Save())
                {
                    transaction.Rollback();
                    throw new Exception("Failed to save audit trail!");
                }
            }
            catch (Exception ex)
            {
                transaction.Rollback();
                throw ex;
            }
            return(transaction);
        }
Esempio n. 2
0
        public static void TruckLeftCompound(Guid truckId)
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.SaveGIN(truckId);
                CompleteWorkflowTask(ginProcess.GINProcessInformation.Trucks[0].TransactionId);
                ClosePun();
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
Esempio n. 3
0
        public static void SaveGIN(Guid truckId)//, AuditTrailWrapper auditTrail)
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.SaveGIN(truckId);
                //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;
            }
        }