public void VehicleModelFileHasData() { var dataFile = _path + @"/modelsbymake.xml"; var models = MakesModels.GetVehicleModels(dataFile); Assert.IsNotNull(models, "Data file of vehicle model should has data"); }
public void VehicleMakeFileHasData() { var dataFile = _path + @"/makes.xml"; var makes = MakesModels.GetVehicleMakes(dataFile); Assert.IsNotNull(makes, "Data file of vehicle make should has data"); }
public List <VehicleModel> GetVehicleModelByMakeID(int makeID) { if (makeID > 0) { _models = MakesModels.GetVehicleModels(_path + @"/modelsbymake.xml"); return(_models.Where(m => m.MakeID == makeID).ToList()); } return(new List <VehicleModel>()); }
public ActionResult RenderForm() { string strMakes = ConfigurationManager.AppSettings["fileMakes"]; string strModels = ConfigurationManager.AppSettings["fileModels"]; string xmlMakesPath = Server.MapPath("~/App_Data/" + strMakes); string xmlModelsPath = Server.MapPath("~/App_Data/" + strModels); MyModel model = new MyModel(); try { model.lstMakes = MakesModels.getMakes(xmlMakesPath); model.lstModels = MakesModels.getMakeModels(xmlModelsPath); } catch (Exception e) { return(View("Error")); } return(PartialView("_Form", model)); }
public List <VehicleMake> GetVehicleMakes() { _makes = MakesModels.GetVehicleMakes(_path + @"/makes.xml"); return(_makes); }