示例#1
0
        protected bool IsValidSDataConnection(bool isUsingHttps, string sDataUrl, string userId, string password)
        {
            List <JT_Technician> technicians = null;

            lock (_locker)
            {
                System.Diagnostics.Debug.WriteLine("Testing sData connection by querying for technicians.");

                try
                {
                    SDataClient sdataClient = new SDataClient(isUsingHttps, sDataUrl, userId, password);

                    technicians = sdataClient.GetData <JT_Technician>(string.Empty, string.Empty);

                    System.Diagnostics.Debug.WriteLine("Test call to sData returned " + technicians.Count.ToString() + " technicians.");
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("Exception was caught!");
                    System.Diagnostics.Debug.WriteLine(ex.Message);

                    // dch rkl 12/07/2016 Log Error
                    ErrorReporting errorReporting = new ErrorReporting();
                    errorReporting.sendException(ex, "TechDashboard.TechDashboardDB_AppSettings.IsValidSDataConnection");
                }
            }

            return((technicians != null) && (technicians.Count > 0));
        }
示例#2
0
        public List <T> GetErpDataFromSData <T>(string filterType, string filterText)
        {
            if (_sDataClient == null)
            {
                _sDataClient = new SDataClient(this);
            }

            List <T> items = _sDataClient.GetData <T>(filterType, filterText);

            return(items);
        }