Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 KB | None | 0 0
  1. using Podium.Models;
  2. using Podium.Models.viewmodels;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Mvc;
  8.  
  9. namespace Podium.Controllers
  10. {
  11.     public class LutaController : Controller
  12.     {
  13.         // GET: Luta
  14.         public ActionResult Index()
  15.         {
  16.             ApplicationDbContext context = new ApplicationDbContext();
  17.             List<CompetidoresViewModel> competidores = context.Database.SqlQuery<CompetidoresViewModel>("SP_CHAVES").ToList();
  18.            
  19.             CompetidoresViewModel[] chave = new CompetidoresViewModel[8];
  20.  
  21.             chave[0] = competidores.ElementAt(0);
  22.             chave[1] = competidores.ElementAt(4);
  23.             chave[2] = competidores.ElementAt(1);
  24.             chave[3] = competidores.ElementAt(6);
  25.             chave[4] = competidores.ElementAt(2);
  26.             chave[5] = competidores.ElementAt(5);
  27.             chave[6] = competidores.ElementAt(3);
  28.             chave[7] = competidores.ElementAt(7);
  29.             chave[8] = competidores.ElementAt(8);
  30.             chave[9] = competidores.ElementAt(12);
  31.             chave[10] = competidores.ElementAt(9);
  32.             chave[11] = competidores.ElementAt(14);
  33.             chave[12] = competidores.ElementAt(10);
  34.             chave[13] = competidores.ElementAt(13);
  35.             chave[14] = competidores.ElementAt(11);
  36.             chave[15] = competidores.ElementAt(15);
  37.            
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.             ViewBag.chave = chave;
  45.  
  46.             return View();
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement