Example #1
0
        public static List <Make> getMakes(string xmlMakesPath)
        {
            string      strIgnoredMakes = "EEE";
            string      xmlRootMakes    = "makes";
            List <Make> lstMakes        = new List <Make>();

            try {
                lstMakes = XMLUtility.ToObjects <Make>(xmlMakesPath, xmlRootMakes);
                lstMakes = lstMakes.Except(lstMakes.Where(a => a.id == strIgnoredMakes || a.id == null)).ToList();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstMakes);
        }
Example #2
0
        public static List <MakeModels> getMakeModels(string xmlModelsPath)
        {
            string            strIgnoredModles = "INVALID";
            string            xmlRootModels    = "modelsbymake";
            List <MakeModels> lstMakeModels    = new List <MakeModels>();

            try
            {
                lstMakeModels = XMLUtility.ToObjects <MakeModels>(xmlModelsPath, xmlRootModels);
                lstMakeModels = lstMakeModels.Except(lstMakeModels.Where(a => a.id == strIgnoredModles || a.id == null)).ToList();

                foreach (MakeModels item in lstMakeModels)
                {
                    item.Models = item.Models.Where(a => a.id != null).ToList();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(lstMakeModels);
        }