public sidesVM(int classid) { Sides = new List<List<classsides>>(); classsidesDAO sidesDAO = new classsidesDAO(); List<classsides> curSides = new List<classsides>(); foreach (var side in sidesDAO.getSidesById(classid)) { classsides singleSide = side; if (curSides.Count == 0 || curSides[0].side != singleSide.side) { if (curSides.Count != 0) { Sides.Add(curSides); } curSides = new List<classsides>(); } curSides.Add(singleSide); singleSide = new classsides(); } Sides.Add(curSides); partsDAO partsDao = new partsDAO(); vehicleAccessories = partsDao.getNonRelatingAccessories(classid).ToList(); }
public ActionResult Area(int id, string side, string modifier) { string valid = isValid(id); if (valid == null) { return RedirectToAction("Home", "Account"); } var className = _DAOFactory.ClassesDAO.getByName(_DAOFactory.EstimateVehicleDAO.getById(id).vehicleclass); classsides blownUpSide = new classsides(); blownUpSide.classid = className.classid; blownUpSide.side = side; blownUpSide.modifier = modifier; blownUpSide = _DAOFactory.ClassSidesDAO.getBySide(blownUpSide); if (blownUpSide == null) { return RedirectToAction("Sides", new { id = id }); } if (blownUpSide.imgmap != null) { blownUpSide.imgmap = blownUpSide.imgmap.Replace("[id]", id.ToString()); } return View(blownUpSide); }