コード例 #1
0
ファイル: FreightGateway.cs プロジェクト: jpheary/Argix10
        public DataView GetTLDetail(int terminalID, string tlNumber, string sortBy)
        {
            //Get TL detail for the specified TL#
            TLDataset tls  = new TLDataset();
            DataView  view = tls.TLTable.DefaultView;
            TLViewerService2Client client = new TLViewerService2Client();

            try {
                DataSet ds = client.GetTLDetail2(terminalID, tlNumber);
                if (ds != null)
                {
                    tls.Merge(ds);

                    if (sortBy.Trim().Length == 0)
                    {
                        sortBy = "ClientNumber";
                    }
                    view.Sort = sortBy;
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException <TLViewerFault> tle) { client.Abort(); throw new ApplicationException(tle.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(view);
        }
コード例 #2
0
ファイル: FreightGateway.cs プロジェクト: jpheary/Argix10
        public static FreightDataset GetTLDetail(int terminalID, string tlNumber)
        {
            //Get TL detail for the specified TL#
            FreightDataset         tls    = new FreightDataset();
            TLViewerService2Client client = new TLViewerService2Client();

            try {
                DataSet ds = client.GetTLDetail2(terminalID, tlNumber);
                if (ds != null && ds.Tables["TLTable"] != null && ds.Tables["TLTable"].Rows.Count > 0)
                {
                    tls.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message, te); }
            catch (FaultException <TLViewerFault> tle) { client.Abort(); throw new ApplicationException(tle.Detail.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message, fe); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message, ce); }
            return(tls);
        }