Beispiel #1
0
        public static ClassCodes GetClassCodes()
        {
            //
            ClassCodes codes = null;

            try {
                codes = _Client.GetClassCodes();
            }
            catch (FaultException fe) { throw new ApplicationException("GetClassCodes() service error.", fe); }
            catch (TimeoutException te) { throw new ApplicationException("GetClassCodes() timeout error.", te); }
            catch (CommunicationException ce) { throw new ApplicationException("GetClassCodes() communication error.", ce); }
            return(codes);
        }
Beispiel #2
0
        public ClassCodes GetClassCodes()
        {
            //Get class codes
            ClassCodes codes = null;

            try {
                codes = new ClassCodes();
                FileInfo fi = new FileInfo(System.Web.Hosting.HostingEnvironment.MapPath(CLSCODE_XMLFILE));
                if (fi.Exists)
                {
                    ClassCodeDS _codes = new ClassCodeDS();
                    _codes.ReadXml(System.Web.Hosting.HostingEnvironment.MapPath(CLSCODE_XMLFILE));
                    for (int i = 0; i < _codes.ClassCodeTable.Rows.Count; i++)
                    {
                        ClassCode code = new ClassCode(_codes.ClassCodeTable[i].Class, _codes.ClassCodeTable[i].Description);
                        codes.Add(code);
                    }
                }
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(codes);
        }