protected void Page_Load(object sender, EventArgs e)
 {
     Empresa = (Session["Empresas"] as Entidades.Empresas);
     Usuario = (Session["Usuario"] as Entidades.Usuarios);
     if (!RepositorioUsuarios.UsuarioEsAdministrador(Usuario))
     {
         Response.Redirect("~/default.aspx");
         return;
     }
     if (!Page.IsPostBack)
     {
         FechaTextBox.Text = DateTime.Now.ToFormatDate();
         int id = Request.QueryString["UsuarioId"].ToInt();
         if (id > 0 && PerteneceALaEmpresa(Usuario.Empresa))
         {
             RepositorioUsuarios repositorio = new RepositorioUsuarios();
             var Usuario = repositorio.Buscar(id);
             if (Usuario.EsNulo() || !PerteneceALaEmpresa(Usuario.UsuarioId))
             {
                 Utils.Alerta(this, TipoTitulo.Informacion, TiposMensajes.RegistroNoEncontrado, IconType.info);
             }
             else
             {
                 LlenarCampos(Usuario);
             }
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     Empresa = (Session["Empresas"] as Entidades.Empresas);
     Usuario = (Session["Usuario"] as Entidades.Usuarios);
     if (!RepositorioUsuarios.UsuarioEsAdministrador(Usuario))
     {
         Response.Redirect("~/default.aspx");
         return;
     }
     if (!Page.IsPostBack)
     {
         FechaDesdeTextBox.Text = DateTime.Now.ToFormatDate();
         FechaHastaTextBox.Text = DateTime.Now.ToFormatDate();
     }
 }