예제 #1
0
        public static bool UpdateScanAudit(RSReportsDataset.ScanAuditTableRow audit)
        {
            //
            bool updated = false;
            RSReportsServiceClient client = new RSReportsServiceClient();

            try {
                ScanAudit sa = new ScanAudit();
                sa.RecordID           = audit.RecordID;
                sa.Arrive             = !audit.IsArriveNull() ? audit.Arrive : "";
                sa.Bell               = !audit.IsBellNull() ? audit.Bell : "";
                sa.DeliveryStart      = !audit.IsDelStartNull() ? audit.DelStart : "";
                sa.DeliveryEnd        = !audit.IsDelEndNull() ? audit.DelEnd : "";
                sa.Departure          = !audit.IsDepartNull() ? audit.Depart : "";
                sa.TimeEntryBy        = !audit.IsTimeEntryByNull() ? audit.TimeEntryBy : "";
                sa.OnTimeIssue        = !audit.IsOnTimeIssueNull() ? audit.OnTimeIssue : "";
                sa.AdditionalComments = !audit.IsAdditCommentsNull() ? audit.AdditComments : "";
                updated               = client.UpdateScanAudit(sa);
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <RoadshowFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(updated);
        }
예제 #2
0
        public static bool UpdateScanAudit(ScanAudit scan)
        {
            //
            bool ret = false;

            try {
                _Client = new RoadshowServiceClient();
                ret     = _Client.UpdateScanAudit(scan);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("UpdateScanAudit() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("UpdateScanAudit() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("UpdateScanAudit() communication error.", ce); }
            return(ret);
        }
예제 #3
0
        public bool UpdateScanAudit(ScanAudit scan)
        {
            //
            bool ret = false;

            try {
                ret = executeNonQuery(USP_SCANAUDIT_UPDATE, new object[] {
                    scan.RecordID, scan.Arrive, scan.Bell, scan.DelStart, scan.DelEnd, scan.Depart, scan.TimeEntryBy, scan.OnTimeIssue, scan.AdditComments
                });
                ret = true;
            }
            catch (Exception ex) { throw new FaultException <RoadshowFault>(new RoadshowFault(new ApplicationException("Unexpected error while updating scan audits.", ex))); }

            return(ret);
        }
예제 #4
0
        public bool UpdateScanAudit(ScanAudit scan)
        {
            //
            bool ret = false;

            try {
                ret = new DataService().ExecuteNonQuery(SQL_CONNID, USP_SCANAUDIT_UPDATE, new object[] {
                    scan.RecordID,
                    scan.Arrive, scan.Bell, scan.DeliveryStart, scan.DeliveryEnd, scan.Departure,
                    scan.TimeEntryBy, scan.OnTimeIssue, scan.AdditionalComments
                });
                ret = true;
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(ret);
        }
예제 #5
0
        public bool UpdateScanAudit(ScanAudit audit)
        {
            //
            bool updated = false;

            try {
                //Apply simple business rules

                //Create the TransactionScope to execute the commands, guaranteeing that both commands can commit or roll back as a single unit of work
                using (TransactionScope scope = new TransactionScope()) {
                    //
                    updated = new RoadshowGateway().UpdateScanAudit(audit);

                    //Commits the transaction; if an exception is thrown, Complete is not called and the transaction is rolled back
                    scope.Complete();
                }
            }
            catch (ApplicationException aex) { throw new FaultException <RoadshowFault>(new RoadshowFault(aex.Message), "Gateway Error"); }
            catch (Exception ex) { throw new FaultException <RoadshowFault>(new RoadshowFault(ex.Message), "Unexpected Error"); }
            return(updated);
        }