public IActionResult AddObstacle(int id, string str, int obs = -1, string Search = "") { var data = new ObstaclesList(); data.str = str; data.id = id; data.Search = Search; data.calc = 1; if (obs != -1) { data.obs = 1; } else { data.obs = 0; } if (Search == "") { data.Obstacles = _context.Obstacles.Where(a => a.IsDeleted != 1).OrderByDescending(a => a.ObstacleId).ToList(); } else { data.Obstacles = _context.Obstacles.Where(a => a.IsDeleted != 1).Where(a => a.Name.Contains(Search) || a.AdditionalDescription.Contains(Search)).OrderBy(a => a.ObstacleId).OrderByDescending(a => a.Name).ToList(); } return(View(data)); }
public MapManagementShould() { var obstaclesList = new List <Axis> { new Axis(0, 1), new Axis(5, 0) }; var obstacle = new ObstaclesList(obstaclesList); var startNavigateWithObstacle = new Navigate(Compass.N, 0, 0, obstacle); _marsRoverWithObstacleOnXZeroYOne = new MarsRover(startNavigateWithObstacle); }
public IActionResult AddObstacle(ObstaclesList data) { return(RedirectToAction("AddObstacle", "Main", new { id = data.id, str = data.str, Search = data.Search })); }