예제 #1
0
        // GET: Adm
        public ActionResult Index()
        {
            HttpCookie myCookie = Request.Cookies["Loja"];

            ViewBag.Clientes = PessoaLojaDAO.ListarTodasClientes(Int32.Parse(myCookie.Values["lojaId"]));
            ViewBag.Carros   = CarrosDAO.ListarTodos(Int32.Parse(myCookie.Values["lojaId"]));
            ViewBag.Pistas   = PistasDAO.ListarTodas(Int32.Parse(myCookie.Values["lojaId"]));
            ViewBag.Corridas = CorridaDAO.ProcurarbyAtivo(Int32.Parse(myCookie.Values["lojaId"]));
            //fazer um details
            // ViewBag.Composicao=ComposicaoDAO.ListarTodos();
            ViewBag.CarroPessoa = CarroPessoaDao.ListarTodos(Int32.Parse(myCookie.Values["lojaId"]));
            ViewBag.Horario     = HorarioPistaDAO.ListarTodos(Int32.Parse(myCookie.Values["lojaId"]));

            return(View());
        }
예제 #2
0
        // GET: Home
        public ActionResult Index(int?id)
        {
            HttpCookie myCookie = Request.Cookies["Loja"];
            string     url      = "http://servicos.cptec.inpe.br/XML/cidade/7dias/227/previsao.xml";

            WebClient client = new WebClient();

            string resultado = client.DownloadString(@url);
            // byte[] bytes = Encoding.Default.GetBytes(resultado);
            XmlSerializer serializer = new XmlSerializer(typeof(Tempo));

            using (StringReader reader = new StringReader(resultado))
            {
                Tempo p = (Tempo)serializer.Deserialize(reader);
                UtilidadeXML.Tratar(p);
                ViewBag.Tempo = p;
            }


            if (id == null)
            {
                return(View(HorarioPistaDAO.ListarTodos(Int32.Parse(myCookie.Values["lojaId"]))));
            }
            DateTime data = DateTime.Today.Date;

            switch (id)
            {
            case 0:
                data = DateTime.Today.Date;

                break;

            case 1:
                data = DateTime.Today.Date.AddDays(1);

                break;

            case 2:
                data = DateTime.Today.Date.AddDays(2);

                break;

            case 3:
                data = DateTime.Today.Date.AddDays(3);

                break;

            case 4:
                data = DateTime.Today.Date.AddDays(4);

                break;

            case 5:
                data = DateTime.Today.Date.AddDays(5);

                break;

            case 6:
                data = DateTime.Today.Date.AddDays(6);

                break;
            }
            return(View(HorarioPistaDAO.ProcurarbyData(data, Int32.Parse(myCookie.Values["lojaId"]))));
        }
예제 #3
0
        // GET: HorarioPistas
        public ActionResult Index()
        {
            HttpCookie myCookie = Request.Cookies["Loja"];

            return(View(HorarioPistaDAO.ListarTodos(Int32.Parse(myCookie.Values["lojaId"]))));
        }