protected void Page_Load(object sender, EventArgs e)
    {
        Auth.CheckPermission("DATI", "ORE");

        // recupera oggetto con variabili di sessione
        CurrentSession = (TRSession)Session["CurrentSession"];

        //      Modo di default è insert, se richiamata con id va in change / display
        if (IsPostBack)
        {
            return;
        }

        //      in caso di update recupera il valore del progetto e attività
        if (Request.QueryString["hours_id"] != null)
        {
            Get_record(Request.QueryString["hours_id"]);

            //              disabilita form in caso di cutoff
            Label LBdate = (Label)FVore.FindControl("LBdate");

            if (Convert.ToDateTime(LBdate.Text) < CurrentSession.dCutoffDate)
            {
                FVore.ChangeMode(FormViewMode.ReadOnly);
            }
            else
            {
                FVore.ChangeMode(FormViewMode.Edit);
            }
        }
        else // insert
        {
            FVore.ChangeMode(FormViewMode.Insert);

            Label LBdate = (Label)FVore.FindControl("LBdate");
            LBdate.Text = Request.QueryString["date"];

            Label LBperson = (Label)FVore.FindControl("LBperson");
            LBperson.Text = (string)CurrentSession.UserName;
        }
    }