示例#1
0
        public static RSReportsDataset GetDepots(string terminalCode)
        {
            //
            RSReportsDataset       depots = new RSReportsDataset();
            RSReportsServiceClient client = new RSReportsServiceClient();

            try {
                DataSet ds = client.GetDepots();
                if (ds != null)
                {
                    depots.Merge(ds);
                    for (int i = 0; i < depots.DepotTable.Rows.Count; i++)
                    {
                        string orderClass = depots.DepotTable[i].RS_OrderClass;
                        if (!(terminalCode.Length == 0 || orderClass == terminalCode))
                        {
                            depots.DepotTable[i].Delete();
                        }
                    }
                    depots.DepotTable.AcceptChanges();
                }
                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(depots);
        }
示例#2
0
        public static bool CanLoadScanAudit(DateTime routeDate, string routeClass)
        {
            bool ret = false;

            if (DateTime.Compare(routeDate, DateTime.Today) < 0)
            {
                RSReportsDataset scans = GetScanAudits(routeDate, routeClass);
                ret = scans.ScanAuditTable.Rows.Count == 0;
            }
            return(ret);
        }
示例#3
0
        public static bool CanLoadPickups(DateTime pickupDate, string routeClass)
        {
            bool ret = false;

            if (DateTime.Compare(pickupDate, DateTime.Today) <= 0)
            {
                RSReportsDataset pickups = GetPickups(pickupDate, routeClass);
                ret = pickups.PickupTable.Rows.Count == 0;
            }
            return(ret);
        }
示例#4
0
        public static bool UpdateScanAudits(RSReportsDataset scans)
        {
            //
            bool ret = false;

            if (scans.HasChanges())
            {
                RSReportsDataset _scans = (RSReportsDataset)scans.GetChanges(DataRowState.Modified);
                for (int i = 0; i < _scans.ScanAuditTable.Rows.Count; i++)
                {
                    RSReportsDataset.ScanAuditTableRow scan = _scans.ScanAuditTable[i];
                    bool changed = UpdateScanAudit(scan);
                }
                scans.AcceptChanges();
            }
            ret = true;
            return(ret);
        }
示例#5
0
        public static bool UpdatePickups(RSReportsDataset pickups)
        {
            //
            bool ret = false;

            if (pickups.HasChanges())
            {
                RSReportsDataset _pickups = (RSReportsDataset)pickups.GetChanges(DataRowState.Modified);
                for (int i = 0; i < _pickups.PickupTable.Rows.Count; i++)
                {
                    RSReportsDataset.PickupTableRow pickup = _pickups.PickupTable[i];
                    bool changed = UpdatePickup(pickup);
                }
                pickups.AcceptChanges();
            }
            ret = true;
            return(ret);
        }
示例#6
0
        public static RSReportsDataset GetUpdateUsers(string routeClass)
        {
            //
            RSReportsDataset       users  = new RSReportsDataset();
            RSReportsServiceClient client = new RSReportsServiceClient();

            try {
                DataSet ds = client.GetUpdateUsers(routeClass);
                if (ds != null)
                {
                    users.Merge(ds);
                }
                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(users);
        }
示例#7
0
        public static RSReportsDataset GetOrderTypes()
        {
            //
            RSReportsDataset       types  = new RSReportsDataset();
            RSReportsServiceClient client = new RSReportsServiceClient();

            try {
                DataSet ds = client.GetOrderTypes();
                if (ds != null)
                {
                    types.Merge(ds);
                }
                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(types);
        }
示例#8
0
        public static RSReportsDataset GetScanAuditDrivers(DateTime routeDate, string routeClass)
        {
            //
            RSReportsDataset drivers = new RSReportsDataset();

            try {
                RSReportsDataset _scans = GetScanAudits(routeDate, routeClass);
                for (int i = 0; i < _scans.ScanAuditTable.Rows.Count; i++)
                {
                    string driver = _scans.ScanAuditTable[i].Driver;
                    if (drivers.DriverTable.Select("NAME='" + driver + "'").Length == 0)
                    {
                        drivers.DriverTable.AddDriverTableRow(driver, "", 0);
                    }
                }
                drivers.AcceptChanges();
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(drivers);
        }
示例#9
0
        public static RSReportsDataset GetScanAudits(DateTime routeDate, string routeClass, string driverName)
        {
            //
            RSReportsDataset scans = null;

            try {
                scans = new RSReportsDataset();
                RSReportsDataset _scans = GetScanAudits(routeDate, routeClass);
                if (driverName != "All")
                {
                    scans.Merge(_scans.ScanAuditTable.Select("Driver ='" + driverName + "'"));
                }
                else
                {
                    scans.Merge(_scans);
                }
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(scans);
        }
示例#10
0
        public static RSReportsDataset GetScanAudits(DateTime routeDate, string routeClass)
        {
            //
            RSReportsDataset       scans  = new RSReportsDataset();
            RSReportsServiceClient client = new RSReportsServiceClient();

            try {
                DataSet ds = client.ReadScanAudits(routeDate, routeClass);
                if (ds != null)
                {
                    scans.Merge(ds);
                }
                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(scans);
        }