예제 #1
0
        public DataView GetAgentSummary(int terminalID, string sortBy)
        {
            //Get an agent summary view for the specified terminal
            TLDataset tls  = new TLDataset();
            DataView  view = tls.TLTable.DefaultView;
            TLViewerService2Client client = new TLViewerService2Client();

            try {
                DataSet ds = client.GetAgentSummary2(terminalID);
                if (ds != null)
                {
                    tls.Merge(ds);
                    if (sortBy.Trim().Length == 0)
                    {
                        sortBy = "AgentNumber";
                    }
                    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
        public DataView GetTLView(int terminalID, string sortBy)
        {
            //Get a view of TLs for the specified terminal
            TLDataset tls  = new TLDataset();
            DataView  view = tls.TLTable.DefaultView;
            TLViewerService2Client client = new TLViewerService2Client();

            try {
                if (terminalID > 0)
                {
                    DataSet ds = client.GetTLView2(terminalID);
                    if (ds != null)
                    {
                        tls.Merge(ds);
                        for (int i = 0; i < tls.TLTable.Rows.Count; i++)
                        {
                            tls.TLTable[i].TerminalID = terminalID;
                        }
                        if (sortBy.Trim().Length == 0)
                        {
                            sortBy = "TLNumber";
                        }
                        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);
        }
예제 #3
0
        public TLDataset FindTL(string terminal, string TLNumber)
        {
            //
            TLDataset tls = new TLDataset();

            try {
                DataSet ds = FillDataset(USP_TLS_FIND, TBL_TLS, new object[] { terminal, TLNumber });
                if (ds.Tables[TBL_TLS] != null)
                {
                    tls.Merge(ds);
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected exception finding TL.", ex); }
            return(tls);
        }
예제 #4
0
        public TLDataset GetTLs(string terminal, DateTime startDate, DateTime endDate)
        {
            //Event handler for change in selected terminal
            TLDataset tls = new TLDataset();

            try {
                DataSet ds = FillDataset(USP_TLS, TBL_TLS, new object[] { terminal, startDate.ToString("yyyy-MM-dd"), endDate.ToString("yyyy-MM-dd") });
                if (ds.Tables[TBL_TLS] != null)
                {
                    tls.Merge(ds);
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected exception creating TL list.", ex); }
            return(tls);
        }