示例#1
0
        public static ClassCodeDS GetClassCodes()
        {
            //Get class codes
            ClassCodeDS codes = null;

            try {
                codes = new ClassCodeDS();
                FileInfo fi = new FileInfo(CLSCODE_XMLFILE);
                if (fi.Exists)
                {
                    codes.ReadXml(CLSCODE_XMLFILE);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Error while reading class codes.", ex); }
            return(codes);
        }
示例#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);
        }