Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        horarios     = new List <string>();
        horariosTime = new List <TimeSpan>();

        foreach (string hor in Enum.GetNames(typeof(Horarios.HorariosPUCRS)))
        {
            horariosTime.Add(Horarios.ParseToDateTime(hor).TimeOfDay);
            horarios.Add(hor.ToString());
        }
        if (!IsPostBack)
        {
            if (Roles.GetUsersInRole("Admin").Length == 0)
            {
                Server.Transfer("~/Default/CadastrarAdmin.aspx");
            }
            if (User.Identity.IsAuthenticated == true)
            {
                Server.Transfer("~/Default/PaginaInicial.aspx");
            }

            //ACESSOS
            Acesso    a = new Acesso(Guid.NewGuid(), DateTime.Now);
            AcessosBO controladorAcessos = new AcessosBO();
            //controladorAcessos.InserirAcesso(a);


            Timer1_Tick(null, null);
        }

        //lblDataHora.Text = DateTime.Now.ToString();
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Roles.GetUsersInRole("Admin").Length == 0)
            {
                Server.Transfer("~/Default/CadastrarAdmin.aspx");
            }
            if (User.Identity.IsAuthenticated == true)
            {
                Server.Transfer("~/Default/PaginaInicial.aspx");
            }

            //ACESSOS
            Acesso    a = new Acesso(Guid.NewGuid(), DateTime.Now);
            AcessosBO controladorAcessos = new AcessosBO();
            controladorAcessos.InserirAcesso(a);
        }
    }