Example #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Utils.startUp(this);

            this.iFrame_sx.NavigateTo = "sceltaRuoloNew.aspx";

            if (!this.IsPostBack)
            {
                int numDelega = DelegheManager.VerificaDelega(this);


                string autoList = ConfigSettings.getKey("AUTO_TO_DO_LIST");

                if ((autoList != null) && (Utils.isNumeric(autoList)) && numDelega < 1)
                {
                    if (autoList.Equals("1"))
                    {
                        this.iFrame_dx.NavigateTo = "waitingpage.htm";
                    }
                    else
                    {
                        this.iFrame_dx.NavigateTo = "blank_page.htm";
                    }
                }
                else
                {
                    if ((numDelega > 0) && (Session["ESERCITADELEGA"] == null))
                    {
                        string messaggio = InitMessageXml.getInstance().getMessage("ESERCITA_DELEGA");
                        msg_delega.Confirm(messaggio);
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// GESTIONE DELLA SESSIONE:
        ///  -----------------------------------------------------------------------------
        ///  sia il tool di amministrazione sia Docspa si trovano sotto lo stesso progetto
        ///  quindi hanno in comune il presente Global.asax .
        ///
        ///  Esiste una sessione denominata "AppWA" che all'accesso del tool di amm.ne
        ///  viene impostata a "ADMIN"; all'accesso di Docspa viene impostata a "DOCSPA".
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Session_End(object sender, EventArgs e)
        {
            try
            {
                // Reperimento infoutente dalla sessione
                var infoUtente = UserManager.getInfoUtente(Session);
                if (infoUtente != null)
                {
                    if (infoUtente.delegato != null)
                    {
                        if (DelegheManager.DismettiDelega(infoUtente))
                        {
                            infoUtente = infoUtente.delegato;
                        }
                    }
                }

                var appKey = string.Empty;

                if (Session["AppWA"] != null)
                {
                    appKey = Session["AppWA"].ToString();
                }

                if (string.IsNullOrEmpty(appKey))
                {
                    return;
                }

                switch (appKey)
                {
                case "DOCSPA":
                    UserManager.logoff(infoUtente, Session.SessionID);
                    break;

                case "ADMIN":
                    var userdata = new SessionManager().getUserAmmSession();
                    if (userdata != null)
                    {
                        UserManager.logoffAdmin(userdata);
                    }
                    break;

                default:
                    UserManager.logoff(Session);
                    break;
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex.Message);
                _logger.ErrorFormat("Stacktrace :\r\n{0}", ex.StackTrace);

                if (ex.InnerException != null)
                {
                    _logger.Error(ex.InnerException.Message);
                    _logger.ErrorFormat("Stacktrace :\r\n{0}", ex.InnerException.StackTrace);
                }
            }
        }