コード例 #1
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData = new PageDataTransfer(Request.Path);

            GINDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckLeftCompound", "GIN");
            GINDataEditor.IsNew  = false;

            GINDataEditor.Ok     += new EventHandler(GINDataEditor_Ok);
            GINDataEditor.Cancel += new EventHandler(GINDataEditor_Cancel);
            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                GINDataEditor.Lookup = ginProcess.LookupSource;

                GINDataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public static void SaveScaling(Guid truckId)
        {
            IGINProcess ginProcess = GetGINProcess(true);

            if (!PostGINEditRequest(ginProcess, truckId))
            {
                SqlTransaction transaction = null;
                try
                {
                    transaction = ginProcess.SaveScaling(truckId);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    try
                    {
                        if (transaction != null)
                        {
                            transaction.Rollback();
                        }
                    }
                    catch (Exception ex2)
                    {
                        throw ex2;
                    }
                    throw ex;
                }
            }
        }
コード例 #3
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData = new PageDataTransfer(Request.Path);

            PUNADataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("VerifyGINAvailability", "PUNAcknowledgement");
            PUNADataEditor.IsNew  = false;

            //PUNADataEditor.Ok += new EventHandler(PUNADataEditor_Ok);
            //PUNADataEditor.Cancel += new EventHandler(PUNADataEditor_Cancel);
            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                PUNADataEditor.Lookup = ginProcess.LookupSource;

                PUNADataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData             = new PageDataTransfer(Request.Path);
            GINDataEditor.Driver       = GINViewConfigurationReader.GetViewConfiguration("GenerateGIN", "GIN");
            GeneralDataEditor.Driver   = GINViewConfigurationReader.GetViewConfiguration("GenerateGIN", "General");
            CommodityDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("GenerateGIN", "CommoditySpecifics");
            ProcessDataEditor.Driver   = GINViewConfigurationReader.GetViewConfiguration("GenerateGIN", "ProcessSpecifics");
            TransportDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("GenerateGIN", "TransportSpecifics");
            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                GINDataEditor.Lookup       = ginProcess.LookupSource;
                GeneralDataEditor.Lookup   = ginProcess.LookupSource;
                CommodityDataEditor.Lookup = ginProcess.LookupSource;
                ProcessDataEditor.Lookup   = ginProcess.LookupSource;
                TransportDataEditor.Lookup = ginProcess.LookupSource;

                GINDataEditor.Setup();
                GeneralDataEditor.Setup();
                CommodityDataEditor.Setup();
                ProcessDataEditor.Setup();
                TransportDataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
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;
            }
        }
コード例 #6
0
        public static void SaveTruckInformation(Guid truckId)//, AuditTrailWrapper auditTrail)
        {
            IGINProcess ginProcess = GetGINProcess(true);

            if (!PostGINEditRequest(ginProcess, truckId))//, auditTrail))
            {
                SqlTransaction transaction = null;
                try
                {
                    transaction = ginProcess.SaveTruckInformation(truckId);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    try
                    {
                        if (transaction != null)
                        {
                            transaction.Rollback();
                        }
                    }
                    catch (Exception ex2)
                    {
                        throw ex2;
                    }
                    throw ex;
                }
            }
        }
コード例 #7
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData = new PageDataTransfer(Request.Path);

            GINGridViewer1.Driver  = TruckGridViewDriver;
            GINDataEditor1.Driver  = GINViewConfigurationReader.GetViewConfiguration("GINProcess", "PUNSummary");
            GINDataEditor2.Driver  = GINViewConfigurationReader.GetViewConfiguration("GINProcess", "Truck");
            GINDataEditor2.Ok     += new EventHandler(GINDataEditor2_Ok);
            GINDataEditor2.Cancel += new EventHandler(GINDataEditor2_Cancel);
            btnAddTruck.Visible    = ((WorkflowTaskType)transferedData.GetTransferedData("WorkflowTask") == WorkflowTaskType.LoadTruck) &&
                                     ((transferedData.GetTransferedData("IsGINTransaction") == null) ||
                                      (bool)(transferedData.GetTransferedData("IsGINTransaction")));
            try
            {
                ginProcess                = GINProcessWrapper.GetGINProcess(IsPostBack);
                GINGridViewer1.Lookup     = ginProcess.LookupSource;
                GINDataEditor1.Lookup     = ginProcess.LookupSource;
                GINDataEditor2.Lookup     = ginProcess.LookupSource;
                GINGridViewer1.DataSource = ginProcess.GINProcessInformation.Trucks;
                GINDataEditor1.Setup();
                GINDataEditor2.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #8
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData         = new PageDataTransfer(Request.Path);
            TruckLoadEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("EditTruckLoading", "TruckLoad");
            StackDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("EditTruckLoading", "Stack");
            StackGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("EditTruckLoading", "StackGrid");


            StackDataEditor.Ok     += new EventHandler(StackDataEditor_Ok);
            StackDataEditor.Cancel += new EventHandler(StackDataEditor_Cancel);

            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                TruckLoadEditor.Lookup = ginProcess.LookupSource;
                StackDataEditor.Lookup = ginProcess.LookupSource;
                StackGridViewer.Lookup = ginProcess.LookupSource;

                TruckLoadEditor.Setup();
                StackDataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #9
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;
            }
        }
コード例 #10
0
        public static void GINGenerated(Guid truckId)
        {
            //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckWeighing);
            IGINProcess ginProcess = GetGINProcess(true);
            //GINInfo originalGin = new GINInfo();
            //originalGin.Copy(ginProcess.GINProcessInformation.Trucks[0].GIN);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.GINGenerated(truckId);
                //auditTrail.AddChange(originalGin, ginProcess.GINProcessInformation.Trucks[0].GIN);
                //if (!auditTrail.Save())
                //    throw new Exception("Failed to save audit trail!");
                CompleteWorkflowTask(ginProcess.GINProcessInformation.Trucks[0].TransactionId);
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
コード例 #11
0
        public static void CompleteScaling(Guid truckId)
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.CompleteScaling(truckId);
                TruckRegistrationInfo truckReistration = new TruckRegistrationInfo()
                {
                    GINTruck = ginProcess.GINProcessInformation.Trucks.Find(t => t.TruckId == truckId)
                };
                TruckWeight trackWeight = truckReistration.TruckWeight;
                trackWeight.Id = Guid.NewGuid();
                trackWeight.Save(transaction);
                CompleteWorkflowTask(ginProcess.GINProcessInformation.Trucks[0].TransactionId);
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
コード例 #12
0
        public static void CompleteAvailabilityVerification()
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                GINProcessInfo originalGinProcessInfo = new GINProcessInfo();
                originalGinProcessInfo.Copy(ginProcess.GINProcessInformation);
                transaction = ginProcess.CompleteAvailabilityVerification();
                //AuditTrailWrapper auditTrail = new AuditTrailWrapper("Inventory Verification",
                //    new object[][]{new object[]{originalGinProcessInfo, ginProcess.GINProcessInformation}});
                //if (!auditTrail.Save())
                //    throw new Exception("Failed to save audit trail!");
                CompleteWorkflowTask(ginProcess.GINProcessInformation.TransactionId);
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
コード例 #13
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;
            }
        }
コード例 #14
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData = new PageDataTransfer(Request.Path);

            PUNADataEditor.Driver    = GINViewConfigurationReader.GetViewConfiguration("TruckRegistration", "PUNAcknowledgement");
            DriverDataEditor.Driver  = GINViewConfigurationReader.GetViewConfiguration("TruckRegistration", "RegisteredTruck");
            TruckDataEditor.Driver   = GINViewConfigurationReader.GetViewConfiguration("TruckRegistration", "TruckData");
            TrailerDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckRegistration", "TrailerData");
            TruckGridViewer.Driver   = GINViewConfigurationReader.GetViewConfiguration("TruckRegistration", "RegisteredTruckGrid");
            PUNADataEditor.IsNew     = false;
            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                PUNADataEditor.Lookup    = ginProcess.LookupSource;
                TruckDataEditor.Lookup   = ginProcess.LookupSource;
                DriverDataEditor.Lookup  = ginProcess.LookupSource;
                TrailerDataEditor.Lookup = ginProcess.LookupSource;
                TruckGridViewer.Lookup   = ginProcess.LookupSource;

                PUNADataEditor.Setup();
                TruckDataEditor.Setup();
                DriverDataEditor.Setup();
                TrailerDataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #15
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData                = new PageDataTransfer(Request.Path);
            TruckDataEditor.Driver        = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "Truck");
            TruckLoadEditor.Driver        = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "TruckLoad");
            StackGridViewer.Driver        = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "StackGrid");
            TruckWeightEditor.Driver      = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "TruckWeight");
            ReturnedBagsGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "ReturnedBagsGrid");

            ProposedTruckDataEditor.Driver        = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "Truck");
            ProposedTruckLoadEditor.Driver        = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "TruckLoad");
            ProposedStackGridViewer.Driver        = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "StackGrid");
            ProposedTruckWeightEditor.Driver      = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "TruckWeight");
            ProposedReturnedBagsGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("ApproveGINEditRequest", "ReturnedBagsGrid");

            TruckDataEditor.IsNew   = false;
            TruckLoadEditor.IsNew   = false;
            TruckWeightEditor.IsNew = false;

            ProposedTruckDataEditor.IsNew   = false;
            ProposedTruckLoadEditor.IsNew   = false;
            ProposedTruckWeightEditor.IsNew = false;

            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                TruckDataEditor.Lookup        = ginProcess.LookupSource;
                TruckLoadEditor.Lookup        = ginProcess.LookupSource;
                StackGridViewer.Lookup        = ginProcess.LookupSource;
                TruckWeightEditor.Lookup      = ginProcess.LookupSource;
                ReturnedBagsGridViewer.Lookup = ginProcess.LookupSource;

                ProposedTruckDataEditor.Lookup        = ginProcess.LookupSource;
                ProposedTruckLoadEditor.Lookup        = ginProcess.LookupSource;
                ProposedStackGridViewer.Lookup        = ginProcess.LookupSource;
                ProposedTruckWeightEditor.Lookup      = ginProcess.LookupSource;
                ProposedReturnedBagsGridViewer.Lookup = ginProcess.LookupSource;

                TruckDataEditor.Setup();
                TruckLoadEditor.Setup();
                TruckWeightEditor.Setup();

                ProposedTruckDataEditor.Setup();
                ProposedTruckLoadEditor.Setup();
                ProposedTruckWeightEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #16
0
        public static void ClosePun()
        {
            IGINProcess ginProcess = GetGINProcess(true);
            bool        bPunClosed = (ginProcess.GINProcessInformation.RemainingWeight <= 0);

            if (bPunClosed)
            {
                CompleteWorkflowTask(ginProcess.GINProcessInformation.TransactionId);
            }
        }
コード例 #17
0
        public static void CompleteLoading(Guid truckId)
        {
            //check if page being processed outside a workflow context
            PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path);

            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckLoading, "GIN Process");
                //GINInfo originalGIN = new GINInfo();
                //originalGIN.Copy(ginProcess.GINProcessInformation.Trucks[0].GIN);
                transaction = ginProcess.CompleteLoading(truckId);
                GINTruckInfo theTruck = ginProcess.GINProcessInformation.Trucks.Find(trk => trk.TruckId == truckId);
                foreach (var loadedStack in theTruck.Load.Stacks)
                {
                    InventoryServices.GetInventoryService().LoadFromStack(loadedStack.StackId, loadedStack.Bags, 0, transaction);
                    auditTrail.AddChange(
                        new TruckLoadInfo(),
                        new TruckLoadInfo(loadedStack.TruckId, theTruck.Load.DateLoaded, theTruck.Load.BagType, string.Empty),
                        AuditTrailWrapper.NewRecord);
                    if (!auditTrail.Save())
                    {
                        throw new Exception("Unable to log audit trail");
                    }
                }
                //auditTrail.AddChange(originalGIN, ginProcess.GINProcessInformation.Trucks[0].GIN);
                //if (!auditTrail.Save())
                //    throw new Exception("Failed to save audit trail!");
                CompleteWorkflowTask(ginProcess.GINProcessInformation.Trucks[0].TransactionId);
                //CompleteWorkflowTask(ginProcess.GINProcessInformation.Trucks[0].TransactionId);
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
コード例 #18
0
        public static bool PostGINEditRequest(IGINProcess ginProcess, Guid truckId)//, AuditTrailWrapper auditTrail)
        {
            GINProcessInfo ginProcessInformation = ginProcess.GINProcessInformation;
            var            editedTruck           = (from truck in ginProcessInformation.Trucks
                                                    where truck.TruckId == truckId
                                                    select truck).FirstOrDefault();

            if (editedTruck.GIN.Status == (int)GINStatusType.GINApproved)
            {
                StringBuilder sb     = new StringBuilder();
                TextWriter    writer = new StringWriter(sb);
                XmlSerializer s      = new XmlSerializer(typeof(GINProcessInfo));
                s.Serialize(writer, ginProcessInformation);
                GINEditingRequest request = new GINEditingRequest()
                {
                    DeliveryReceivedId = ginProcessInformation.GINProcessId,
                    TargetPage         = HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath.Substring(2),
                    ProposedChange     = sb.ToString(),
                    OldTransactionId   = editedTruck.TransactionId
                };
                SqlTransaction transaction = null;
                try
                {
                    request.TransactionId = StartWorkflowTask(new Guid("18FC27D4-5905-4A21-84CC-719601FBAC70"));
                    transaction           = ginProcess.SaveGINEditingRequest(request);
                    transaction.Commit();
                    return(true);
                }
                catch (Exception ex)
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                    if (request != null)
                    {
                        RemoveWorkflowTask(request.TransactionId);
                    }
                    throw ex;
                }
            }
            else
            {
                return(false);
            }
        }
コード例 #19
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();

            transferedData                = new PageDataTransfer(Request.Path);
            GINDataEditor.Driver          = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "GIN");
            TruckWeightEditor.Driver      = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "TruckWeight");
            GINIssuanceEditor.Driver      = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "GINIssuance");
            ReturnedBagsDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "ReturnedBags");
            ReturnedBagsGridViewer.Driver = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "ReturnedBagsGrid");
            AddedBagsDataEditor.Driver    = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "AddedBags");
            AddedBagsGridViewer.Driver    = GINViewConfigurationReader.GetViewConfiguration("TruckScaling", "AddedBagsGrid");

            GINDataEditor.IsNew     = false;
            TruckWeightEditor.IsNew = false;
            GINIssuanceEditor.IsNew = false;

            ReturnedBagsDataEditor.Ok     += new EventHandler(ReturnedBagsDataEditor_Ok);
            ReturnedBagsDataEditor.Cancel += new EventHandler(ReturnedBagsDataEditor_Cancel);
            AddedBagsDataEditor.Ok        += new EventHandler(AddedBagsDataEditor_Ok);
            AddedBagsDataEditor.Cancel    += new EventHandler(AddedBagsDataEditor_Cancel);

            try
            {
                ginProcess                    = GINProcessWrapper.GetGINProcess(IsPostBack);
                GINDataEditor.Lookup          = ginProcess.LookupSource;
                TruckWeightEditor.Lookup      = ginProcess.LookupSource;
                GINIssuanceEditor.Lookup      = ginProcess.LookupSource;
                ReturnedBagsDataEditor.Lookup = ginProcess.LookupSource;
                ReturnedBagsGridViewer.Lookup = ginProcess.LookupSource;
                AddedBagsDataEditor.Lookup    = ginProcess.LookupSource;
                AddedBagsGridViewer.Lookup    = ginProcess.LookupSource;

                GINDataEditor.Setup();
                TruckWeightEditor.Setup();
                GINIssuanceEditor.Setup();
                ReturnedBagsDataEditor.Setup();
                AddedBagsDataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #20
0
        public static void ApproveGINEditRequest()
        {
            IGINProcess       originalGinProcess = GetGINProcess(true);
            PageDataTransfer  transferedData     = new PageDataTransfer(HttpContext.Current.Request.Path);
            GINEditingRequest request            = (GINEditingRequest)transferedData.GetTransferedData("GINEditingRequest");
            XmlSerializer     s = new XmlSerializer(typeof(GINProcessInfo));
            GINProcessInfo    ginProcessInformation = (GINProcessInfo)s.Deserialize(new StringReader(request.ProposedChange));

            ginProcessInformation.Trucks[0].TransactionId = request.TransactionId;
            ginProcessInformation.Trucks[0].Status        = (int)GINStatusType.GINGenerated;
            IGINProcess ginProcess = new GINAuditController();

            ginProcess.GINProcessInformation = ginProcessInformation;
            SqlTransaction transaction = null;

            try
            {
                switch (request.TargetPage)
                {
                case "EditTruckInformation.aspx":
                    transaction = ginProcess.SaveTruckInformation(ginProcessInformation.Trucks[0].TruckId);
                    break;

                case "EditTruckLoading.aspx":
                    transaction = ginProcess.SaveLoading(ginProcessInformation.Trucks[0].TruckId);
                    break;

                case "EditTruckScaling.aspx":
                    transaction = ginProcess.SaveScaling(ginProcessInformation.Trucks[0].TruckId);
                    break;
                }
                transaction.Commit();
                CompleteWorkflowTask(request.TransactionId);
            }
            catch (Exception ex)
            {
                if (transaction != null)
                {
                    transaction.Rollback();
                }
                throw ex;
            }
        }
コード例 #21
0
        public static void NotifyGIN(Guid truckId)
        {
            IGINProcess    ginProcess     = GetGINProcess(true);
            ILookupSource  lookup         = ginProcess.LookupSource;
            GINProcessInfo ginProcessInfo = ginProcess.GINProcessInformation;
            GINTruckInfo   truck          = (from trk in ginProcessInfo.Trucks where trk.TruckId == truckId select trk).Single();

            ECXCD.WR wr = new WarehouseApplication.ECXCD.WR();
            wr.SaveGIN(
                truck.GIN.GINId,
                truck.GIN.GINNo,
                ginProcessInfo.PickupNoticeId,
                Convert.ToDouble(truck.GIN.GrossWeight),
                Convert.ToDouble(truck.GIN.NetWeight),
                Convert.ToDouble(truck.GIN.Quantity),
                truck.GIN.DateIssued,
                truck.GIN.SignedByClient,
                truck.GIN.DateApproved,
                truck.GIN.ApprovedBy,
                truck.Load.Remark + Environment.NewLine + truck.Weight.Remark,
                lookup.GetLookup("GINStatus")[truck.GIN.Status]);
        }
コード例 #22
0
        public static void AbortPun()
        {
            IGINProcess             ginProcess  = GetGINProcess(true);
            IPickupNotice           pun         = new PickupNoticeBLL(ginProcess.GINProcessInformation.PickupNoticeId);
            PickupNoticeInformation puni        = new PickupNoticeInformation();
            SqlTransaction          transaction = null;

            try
            {
                puni.Copy(pun.PickupNoticeInformation);
                transaction = pun.Aborted();
                CompleteWorkflowTask(ginProcess.GINProcessInformation.TransactionId);
                transaction.Commit();
                AuditTrailWrapper punAudit = new AuditTrailWrapper(AuditTrailWrapper.PUNAbortion,
                                                                   new object[][] { new object[] { puni, pun.PickupNoticeInformation } }, "PUN Abortion");
                if (!punAudit.Save())
                {
                    throw new Exception("Failed to save audit trail!");
                }
                UpdatePUNStatus(
                    pun.PickupNoticeInformation.PickupNoticeId,
                    pun.LookupSource.GetLookup("Status")[pun.PickupNoticeInformation.Status]);
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
コード例 #23
0
        public static void GINApproved(Guid truckId)
        {
            IGINProcess    ginProcess  = GetGINProcess(true);
            SqlTransaction transaction = null;

            try
            {
                transaction = ginProcess.GINApproved(truckId);
                NotifyGIN(truckId);
                CompleteWorkflowTask(ginProcess.GINProcessInformation.Trucks[0].TransactionId);

                if (ginProcess.GINProcessInformation.RemainingWeight <= 0)
                {
                    IPickupNotice           pun  = new PickupNoticeBLL(ginProcess.GINProcessInformation.PickupNoticeId);
                    PickupNoticeInformation puni = new PickupNoticeInformation();
                    puni.Copy(pun.PickupNoticeInformation);
                    pun.GINIssued(transaction);
                    UpdatePUNStatus(
                        pun.PickupNoticeInformation.PickupNoticeId,
                        pun.LookupSource.GetLookup("Status")[pun.PickupNoticeInformation.Status]);
                }
                transaction.Commit();
            }
            catch (Exception ex)
            {
                try
                {
                    if (transaction != null)
                    {
                        transaction.Rollback();
                    }
                }
                catch (Exception ex2)
                {
                    throw ex2;
                }
                throw ex;
            }
        }
コード例 #24
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            transferedData = new PageDataTransfer(Request.Path);
            ginProcess     = GINProcessWrapper.GetGINProcess(IsPostBack);

            SampleDataEditor.Driver         = GINViewConfigurationReader.GetViewConfiguration("GINSamplingResults", "Sample");
            SamplingResultDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("GINSamplingResults", "SamplingResult");
            SamplerGridViewer.Driver        = GINViewConfigurationReader.GetViewConfiguration("GINSamplingResults", "Sampler");

            SampleDataEditor.Lookup         = ginProcess.LookupSource;
            SamplingResultDataEditor.Lookup = ginProcess.LookupSource;
            SamplerGridViewer.Lookup        = ginProcess.LookupSource;

            SampleDataEditor.IsNew = false;

            SamplingResultDataEditor.Ok     += new EventHandler(SamplingResultDataEditor_Ok);
            SamplingResultDataEditor.Cancel += new EventHandler(SamplingResultDataEditor_Cancel);

            SampleDataEditor.Setup();
            SamplingResultDataEditor.Setup();
        }
コード例 #25
0
        protected override void OnInit(EventArgs e)
        {
            errorDisplayer = new ErrorMessageDisplayer(lblMessage);
            errorDisplayer.ClearErrorMessage();
            base.OnInit(e);
            transferedData = new PageDataTransfer(Request.Path);

            GINDataEditor.Driver = GINViewConfigurationReader.GetViewConfiguration("ClientAcknowledgeGIN", "GIN");

            try
            {
                ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack);

                GINDataEditor.Lookup = ginProcess.LookupSource;

                GINDataEditor.Setup();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #26
0
        public static ActiveReport GetReport()
        {
            ActiveReport     report          = null;
            PageDataTransfer transferedData  = new PageDataTransfer(HttpContext.Current.Request.Path);
            string           requestedReport = (string)(transferedData.GetTransferedData("RequestedReport"));
            IGINProcess      ginProcess      = null;

            switch (requestedReport)
            {
            case "rptGINReport":
                ginProcess = GINProcessWrapper.GetGINProcess(false);
                ILookupSource lookupSource = ginProcess.LookupSource;
                report            = new Reports.rptGINReport();
                report.DataSource = new GINReportDataCollection(ginProcess.GetGINReport(ginProcess.GINProcessInformation.Trucks[0].TruckId), lookupSource);
                return(report);

            case "rptPUNTrackingReport":
                ginProcess        = GINProcessWrapper.GetGINProcess(false);
                report            = new Reports.rptPUNTrackingReport();
                report.DataSource = new TrackingReportDataCollection(ginProcess.PUNTrackingReportData);
                return(report);

            case "rptGINTrackingReport":
                report = new Reports.rptGINTrackingReport();
                GINTrackingReportDataCollection gtrDataSource = new GINTrackingReportDataCollection();
                gtrDataSource.AddList((List <GINTrackingReportData>)transferedData.GetTransferedData("GINTrackingReportData"));
                report.DataSource = gtrDataSource;
                return(report);

            case "rptPUNReport":
                report = new Reports.rptPUNReport();
                PUNReportDataCollection puDataSource = new PUNReportDataCollection((PUNReportData)transferedData.GetTransferedData("PUNReportData"));
                report.DataSource = puDataSource;
                return(report);
            }
            return(null);
        }
コード例 #27
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;
            }
        }
コード例 #28
0
 public GINAuditController(string transactionId, bool isGinTransaction)
 {
     currentGINProcess = new GINProcessBLL(transactionId, isGinTransaction);
 }
コード例 #29
0
 public GINAuditController(string transactionId)
 {
     currentGINProcess = new GINProcessBLL(transactionId);
 }
コード例 #30
0
 public GINAuditController(Guid ginProcessId)
 {
     currentGINProcess = new GINProcessBLL(ginProcessId);
 }