コード例 #1
0
ファイル: CustomersGateway.cs プロジェクト: jpheary/Argix10
        public TerminalDataset GetTerminals(string agentNumber)
        {
            //Returns a list of terminals
            TerminalDataset  terminals = new TerminalDataset();
            CRMServiceClient client    = new CRMServiceClient();

            try {
                TerminalDataset ts = new TerminalDataset();
                DataSet         ds = client.GetTerminals();
                client.Close();

                if (ds.Tables["TerminalTable"] != null && ds.Tables["TerminalTable"].Rows.Count > 0)
                {
                    ts.Merge(ds);
                }
                if (agentNumber == null)
                {
                    terminals.TerminalTable.AddTerminalTableRow(0, "", "All", "");
                    terminals.Merge(ts);
                }
                else
                {
                    terminals.Merge(ts.TerminalTable.Select("AgentID='" + agentNumber + "'"));
                }
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminals);
        }
コード例 #2
0
ファイル: TsortGateway.cs プロジェクト: jpheary/Argix10
        public TerminalDataset GetTerminals()
        {
            //Get a list of Argix terminals
            TerminalDataset    terminals = new TerminalDataset();
            TsortServiceClient client    = new TsortServiceClient();

            try {
                DataSet ds = client.GetTerminals();
                if (ds != null)
                {
                    TerminalDataset ts = new TerminalDataset();
                    ts.Merge(ds);
                    if (HttpContext.Current.User.Identity.Name != "jheary")
                    {
                        string codes = ConfigurationManager.AppSettings["Terminals"];
                        for (int i = ts.TerminalTable.Rows.Count - 1; i >= 0; i--)
                        {
                            if (!codes.Contains(ts.TerminalTable[i].Number))
                            {
                                ts.TerminalTable[i].Delete();
                            }
                        }
                    }
                    terminals.Merge(ts);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminals);
        }
コード例 #3
0
ファイル: FreightGateway.cs プロジェクト: jpheary/Argix10
        public TerminalDataset GetTerminals(int terminalID)
        {
            //Returns a list of terminals
            TerminalDataset        terminals = new TerminalDataset();
            TLViewerService2Client client    = new TLViewerService2Client();

            try {
                DataSet ds = client.GetTerminals2();
                if (ds != null)
                {
                    TerminalDataset ts = new TerminalDataset();
                    ts.Merge(ds);
                    for (int i = 0; i < ts.TerminalTable.Rows.Count; i++)
                    {
                        TerminalDataset.TerminalTableRow t = ts.TerminalTable[i];
                        if (terminalID == 0 || t.TerminalID == terminalID)
                        {
                            terminals.TerminalTable.LoadDataRow(t.ItemArray, true);
                        }
                    }
                }
                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(terminals);
        }
コード例 #4
0
        public TerminalDataset GetTerminals()
        {
            //Get a list of Argix terminals
            TerminalDataset    terminals = new TerminalDataset();
            TsortServiceClient client    = new TsortServiceClient();

            try {
                DataSet ds = client.GetTerminals();
                if (ds != null)
                {
                    TerminalDataset ts = new TerminalDataset();
                    if (HttpContext.Current.User.Identity.Name.ToLower() == "chicago")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "29", "CHICAGO", "0", "0", "0", "01", 1);
                    }
                    else if (HttpContext.Current.User.Identity.Name.ToLower() == "columbus")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "65", "COLUMBUS", "0", "0", "0", "01", 1);
                    }
                    else if (HttpContext.Current.User.Identity.Name.ToLower() == "dallas")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "55", "DALLAS", "0", "0", "0", "01", 1);
                    }
                    else if (HttpContext.Current.User.Identity.Name.ToLower() == "losangeles")
                    {
                        ts.TerminalTable.AddTerminalTableRow(0, "11", "LOS ANGELES", "0", "0", "0", "01", 1);
                    }
                    else
                    {
                        ts.Merge(ds);
                        if (HttpContext.Current.User.Identity.Name != "jheary")
                        {
                            string codes = ConfigurationManager.AppSettings["Terminals"];
                            for (int i = ts.TerminalTable.Rows.Count - 1; i >= 0; i--)
                            {
                                if (!codes.Contains(ts.TerminalTable[i].Number))
                                {
                                    ts.TerminalTable[i].Delete();
                                }
                            }
                        }
                    }
                    terminals.Merge(ts);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminals);
        }
コード例 #5
0
ファイル: TsortGateway.cs プロジェクト: jpheary/Argix10
        public TerminalDataset GetTerminals()
        {
            //Get a list of Argix terminals
            TerminalDataset            terminals = new TerminalDataset();
            FreightAssignServiceClient client    = new FreightAssignServiceClient();

            try {
                DataSet ds = client.GetTerminals();
                if (ds != null)
                {
                    terminals.Merge(ds);
                }
                client.Close();
            }
            catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); }
            catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); }
            catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); }
            return(terminals);
        }
コード例 #6
0
ファイル: EnterpriseGateway.cs プロジェクト: jpheary/Argix10
        public DataSet GetTerminals()
        {
            //Get a list of Argix terminals
            TerminalDataset terminals = null;

            try {
                terminals = new TerminalDataset();
                DataSet ds = FillDataset(USP_TERMINALS, TBL_TERMINALS, new object[] { });
                if (ds.Tables[TBL_TERMINALS].Rows.Count > 0)
                {
                    TerminalDataset _terminals = new TerminalDataset();
                    _terminals.Merge(ds);
                    terminals.Merge(_terminals.TerminalTable.Select("", "Description ASC"));
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected exception creating Argix terminal list.", ex); }
            return(terminals);
        }