public ActionResult Index(FormCollection collection) { IEnumerable <Position> listPos = null; try { SessionInitialize(); PositionCAD cadPos = new PositionCAD(); PositionCEN cen = new PositionCEN(cadPos); IList <PositionEN> listPosEn = cen.ReadAll(0, -1); string orden = collection["hdnOrden"].ToString(); switch (orden) { case "N": listPosEn = listPosEn.OrderBy(p => p.Latitude).ToList(); break; case "P": listPosEn = listPosEn.OrderBy(p => p.Longitude).ToList(); break; case "Q": listPosEn = listPosEn.OrderBy(p => p.Altitude).ToList(); break; default: listPosEn = listPosEn.OrderBy(p => p.Latitude).ToList(); break; } listPos = new AssemblerPosition().ConvertListENToModel(listPosEn).ToList(); SessionClose(); } catch (Exception ex) { TempData["resultado"] = Resources.textos.modelEmpty; TempData["ok"] = "warning"; } ViewBag.menu = "Positions"; return(View(listPos)); }
// GET: DashBoard/Positions public ActionResult Index() { IEnumerable <Position> listPos = null; try { SessionInitialize(); PositionCAD cadPos = new PositionCAD(); PositionCEN cen = new PositionCEN(cadPos); IList <PositionEN> listPosEn = cen.ReadAll(0, -1); listPos = new AssemblerPosition().ConvertListENToModel(listPosEn).ToList(); SessionClose(); } catch (Exception ex) { TempData["resultado"] = Resources.textos.modelEmpty; TempData["ok"] = "warning"; } ViewBag.menu = "Positions"; return(View(listPos)); }