Ejemplo n.º 1
0
        public ActionResult Index()
        {
            if (Session["IsLoggedIn"] == null)
            {
                Session["IsLoggedIn"] = "false";
            }

            MySQLDatabase sql = new MySQLDatabase();

            sql.ConnectToServer();
            if (Request.QueryString["month"] != null)
            {
                if (Request.QueryString["month"].ToString() == "-1")
                {
                    Globals.month = Globals.month - 1;
                }
                if (Request.QueryString["month"].ToString() == "1")
                {
                    Globals.month = Globals.month + 1;
                }
            }
            else
            {
                int month2 = Globals.date.Month;
                Globals.month = month2;
            }
            // GoogleAPI eventGetter = new GoogleAPI();
            MySQLDatabase eventGetter = new MySQLDatabase();

            Events events = new Events();

            events = eventGetter.GetEventsByMonth(Globals.month);
            ViewBag.currentMonth = Globals.month;
            ViewBag.events       = events;
            return(View());
        }