Beispiel #1
0
        protected void SearchCodProject()
        {
            Session.Remove("fascicoli");
            WSConservazioneLocale.Fascicolo[] projectList = ConservazioneManager.GetFascicoloDaCodiceNoSecurity(this.txtCodFascicolo.Text, this.infoUtente.idAmministrazione, true);

            if (projectList == null || projectList.Length == 0)
            {
                txtCodFascicolo.Text  = string.Empty;
                txtDescFascicolo.Text = string.Empty;
                this.id_Fasc.Value    = string.Empty;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Nessun fascicolo trovato con questo codice');", true);
            }
            else
            {
                if (projectList.Length == 1)
                {
                    txtCodFascicolo.Text  = projectList[0].codice;
                    txtDescFascicolo.Text = projectList[0].descrizione;
                    this.id_Fasc.Value    = projectList[0].systemID;
                }
                else
                {
                    HttpContext.Current.Session["fascicoli"] = projectList as WSConservazioneLocale.Fascicolo[];

                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "OpenSceltaFascicoli();", true);
                    txtCodFascicolo.Text  = string.Empty;
                    txtDescFascicolo.Text = string.Empty;
                    this.id_Fasc.Value    = string.Empty;
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="idIstanza"></param>
        /// <param name="idSupporto"></param>
        protected virtual void FetchStoriaVerifiche(string idIstanza, string idSupporto)
        {
            WSConservazioneLocale.InfoSupporto[] verifiche = ConservazioneManager.getReportVerificheSupporto(idIstanza, idSupporto, this._infoUtente);

            this.grdStoriaVerifiche.DataSource = verifiche;
            this.grdStoriaVerifiche.DataBind();
        }
Beispiel #3
0
        /// <summary>
        /// Caricamento dati dei supporti
        /// </summary>
        protected virtual void FetchSupporti()
        {
            string filters = this.GetFilters();

            WSConservazioneLocale.InfoSupporto[] supporti = ConservazioneManager.getInfoSupporto(filters, this._infoUtente);

            this.grdSupporti.DataSource = supporti;
            this.grdSupporti.DataBind();
        }
Beispiel #4
0
        protected void CaricaComboTitolari()
        {
            ddl_titolari.Items.Clear();

            ArrayList listaTitolari = new ArrayList(ConservazioneManager.getTitolariUtilizzabili(infoUtente.idAmministrazione));

            //Esistono dei titolari chiusi
            if (listaTitolari.Count > 1)
            {
                //Creo le voci della ddl dei titolari
                string valueTutti = string.Empty;
                foreach (WSConservazioneLocale.OrgTitolario titolario in listaTitolari)
                {
                    ListItem it = null;
                    switch (titolario.Stato)
                    {
                    case WSConservazioneLocale.OrgStatiTitolarioEnum.Attivo:
                        it = new ListItem(titolario.Descrizione, titolario.ID);
                        ddl_titolari.Items.Add(it);
                        valueTutti += titolario.ID + ",";
                        break;

                    case WSConservazioneLocale.OrgStatiTitolarioEnum.Chiuso:
                        it = new ListItem(titolario.Descrizione, titolario.ID);
                        ddl_titolari.Items.Add(it);
                        valueTutti += titolario.ID + ",";
                        break;
                    }
                }
                //Imposto la voce tutti i titolari
                valueTutti = valueTutti.Substring(0, valueTutti.Length - 1);
                if (valueTutti != string.Empty)
                {
                    if (valueTutti.IndexOf(',') == -1)
                    {
                        valueTutti = valueTutti + "," + valueTutti;
                    }

                    ListItem it = new ListItem("Tutti i titolari", valueTutti);
                    ddl_titolari.Items.Insert(0, it);
                }
            }

            //Non esistono titolario chiusi
            if (listaTitolari.Count == 1)
            {
                WSConservazioneLocale.OrgTitolario titolario = (WSConservazioneLocale.OrgTitolario)listaTitolari[0];
                if (titolario.Stato != WSConservazioneLocale.OrgStatiTitolarioEnum.InDefinizione)
                {
                    ListItem it = new ListItem(titolario.Descrizione, titolario.ID);
                    ddl_titolari.Items.Add(it);
                }
                ddl_titolari.Enabled = false;
            }
        }
Beispiel #5
0
        protected void LoadData(List <WSConservazioneLocale.FiltroRicerca> filters)
        {
            //leggo i dati da db
            listStampe = ConservazioneManager.GetListStampaConservazione(filters, infoUtente);

            //popolo la datagrid
            dg_StampeCons.DataSource = listStampe;
            dg_StampeCons.DataBind();

            this.upStampe.Update();
        }
Beispiel #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="infoSupporto"></param>
 /// <returns></returns>
 protected bool AreSupportiRimovibiliVerificabili(WSConservazioneLocale.InfoSupporto infoSupporto)
 {
     if (IsSupportoRimovibileRegistrato(infoSupporto))
     {
         return(ConservazioneManager.supportiRimovibiliVerificabili());
     }
     else
     {
         return(false);
     }
 }
Beispiel #7
0
 protected void GetTypeDocument()
 {
     WSConservazioneLocale.TemplateLite[] templateList;
     templateList = ConservazioneManager.GetTypeDocumentsWithDiagramByIdAmm(Convert.ToInt32(infoUtente.idAmministrazione), "F");
     if (templateList != null && templateList.Length > 0)
     {
         ddl_type_documents.Items.Clear();
         ddl_type_documents.Items.Add("");
         for (int i = 0; i < templateList.Length; i++)
         {
             ddl_type_documents.Items.Add(templateList[i].name);
             ddl_type_documents.Items[i + 1].Value = templateList[i].system_id;
         }
     }
 }
Beispiel #8
0
        /// <summary>
        /// Funzione per la ricerca dei documenti
        /// </summary>
        /// <param name="recordNumber">Numero di record restituiti dalla ricerca</param>
        protected WSConservazioneLocale.SearchObject[] SearchProject(WSConservazioneLocale.FiltroRicerca[][] searchFilters, int selectedPage, out int recordNumber)
        {
            // Documenti individuati dalla ricerca
            WSConservazioneLocale.SearchObject[] projects;

            // Numero totale di pagine
            int pageNumbers;

            // Lista dei system id dei documenti restituiti dalla ricerca
            WSConservazioneLocale.SearchResultInfo[] idProjects = null;

            projects = ConservazioneManager.GetListaFascicoliPagingCustom(null, null, this.SearchFilters[0], false, this.SelectedPage, out pageNumbers, out recordNumber, 10, false, out idProjects, null, false, false, null, null, infoUtente, false);

            // Memorizzazione del numero di risultati restituiti dalla ricerca, del numero di pagine e dei risultati
            this.RecordCount = recordNumber;
            this.PageCount   = pageNumbers;
            this.Result      = projects;

            return(projects);
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string tema = this.Page.Theme;

            if (tema.ToUpper().Equals("TEMAROSSO"))
            {
                this.img_logologinente1.Visible = false;
                this.img_logologinente2.Visible = false;
            }
            else if (tema.ToUpper().Equals("TEMAMILANO"))
            {
                this.img_logologinente1.Visible = false;
                this.img_logologinente2.Visible = false;
                this.img_logologin.Width        = 232;
            }
            this.btn_accedi.ImageUrl = "App_Themes\\" + this.Page.Theme + "\\Butt_Accedi.jpg";

            string inputToken = this.GetInputToken();

            //
            // Modifica Per PGU
            // il Token Passato dal PGU
            string idAmm = string.Empty;

            //
            // MEV CS 1.4 - Esibizione
            if (!string.IsNullOrEmpty(inputToken))
            {
                Session["PGU"] = "PGU";
            }
            // End MEV CS 1.4 - Esibizione
            //

            //
            // Provengo dal PGU
            if (inputToken.Contains('_'))
            {
                idAmm      = inputToken.Split('_')[1];
                inputToken = inputToken.Split('_')[0];
            }
            // End Modifica
            //

            //
            // Mev Cs 1.4 - esibizione
            if (this.pnl_profili.Visible && !string.IsNullOrEmpty(this.hf_profiloUtente.Value))
            {
                if (ddl_profili.SelectedValue.Equals("0"))
                {
                    Session["ProfiloUtente"] = "CONSERVAZIONE";
                }
                if (ddl_profili.SelectedValue.Equals("1"))
                {
                    Session["ProfiloUtente"] = "ESIBIZIONE";
                }
            }
            // End Mev cs 1.4
            //


            if (!string.IsNullOrEmpty(inputToken) || this.hd_forceLogin.Value == "true")
            {
                string pwd    = this.hd_pwd.Value;
                string userId = string.Empty;

                if (string.IsNullOrEmpty(inputToken))
                {
                    userId = this.hd_userId.Value;
                }
                else
                {
                    userId = inputToken;
                }

                DocsPaWR.UserLogin lgn = this.CreateUserLogin(pwd, userId);

                //
                // Modifica per PGU
                if (!string.IsNullOrEmpty(idAmm))
                {
                    lgn.IdAmministrazione = idAmm;
                }
                // End Modifica
                //

                if (this.ForcedLogin(lgn))
                {
                    user = (DocsPaWR.Utente)Session["userData"];

                    Session["DbType"] = ConservazioneManager.getDbType();

                    this.LaunchApplication();
                }
                else
                {
                    this.lbl_error.Visible = true;
                    this.lbl_error.Text    = "Nome utente o password non validi.";
                }
            }
        }
Beispiel #10
0
        private bool loginAction(DocsPaWR.UserLogin lgn, out string message)
        {
            bool resLogin = false;

            message = string.Empty;
            string ipaddress = "";

            DocsPaWR.LoginResult loginResult;
            DocsPaWR.Utente      utente = UserManager.login(this, lgn, out loginResult, out ipaddress);
            this.user = utente;
            if (user != null)
            {
                //PROVA SIGALOT per selezionare l'utente del centro servizi

                /*
                 * user.extApplications = new DocsPaWR.ExtApplication[1];
                 * user.extApplications[0] = new DocsPaWR.ExtApplication();
                 * user.extApplications[0].codice = "CS";
                 */

                //MODIFICATO PER GESTIONE APPLICAZIONE CENTRO SERVIZI
                user.codWorkingApplication = "CS";
            }

            switch (loginResult)
            {
            case DocsPaWR.LoginResult.OK:

                //PROVA SIGALOT per selezionare l'utente del centro servizi
                //user.extApplications = new DocsPaWR.ExtApplication[1];
                //user.extApplications[0] = new DocsPaWR.ExtApplication();
                //user.extApplications[0].codice = "CS";

                resLogin = true;

                Session["DbType"] = ConservazioneManager.getDbType();

                this.LaunchApplication();


                break;

            case DocsPaWR.LoginResult.UNKNOWN_USER:
                message = "Nome utente o password non validi.";

                break;

            case DocsPaWR.LoginResult.USER_ALREADY_LOGGED_IN:
                // Gestione autonoma da parte dell'utente
                message = "L'utente ha gia' una connessione aperta.";

                //        // Store login object
                //        Session.Add("loginData", lgn);
                string script = "<script>forceLogin('" + ipaddress + "');</script>";
                Page.RegisterStartupScript("NotifyUser", script);

                //    }

                break;

            case DocsPaWR.LoginResult.NO_RUOLI:
                message = "L'utente non ha un ruolo associato.";
                break;


            case DocsPaWR.LoginResult.DISABLED_USER:
                message = "Utente non abilitato";
                break;

            case DocsPaWR.LoginResult.PASSWORD_EXPIRED:
                message = "La password dell'utente risulta scaduta. Immettere una nuova password.";
                break;

            case DocsPaWR.LoginResult.NO_AMMIN:
                this.hf_loginResult.Value = DocsPaWR.LoginResult.NO_AMMIN.ToString();
                message = "Selezionare un'amministrazione";
                break;

            default:
                // Application Error
                message = "Errore nella procedura di Login. Contattare l'amministrazione.";
                break;
            }

            if (resLogin)
            {
                //utente.urlWA = Utils.getHttpFullPath(this);
                Session["userData"] = utente;
            }

            return(resLogin);
        }
Beispiel #11
0
        private void LaunchApplication()
        {
            if (this.user != null)
            {
                if (this.user.ruoli != null && this.user.ruoli.Length > 0)
                {
                    this.ruolo = (DocsPaWR.Ruolo) this.user.ruoli[0];
                }
                else
                {
                    DocsPaWR.Ruolo ruoloFinto = new DocsPaWR.Ruolo();
                    ruoloFinto.idAmministrazione = this.user.idAmministrazione;
                    ruoloFinto.idGruppo          = "-1";
                    ruoloFinto.systemId          = "-1";
                    this.ruolo = ruoloFinto;
                }
            }

            //
            // Old Code - MEV CS 1.4 - Esibizione
            //creaInfoUtente(this.user);
            //ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
            // End OldCode

            // New Code - MEV cs 1.4 - esibizione
            WSConservazioneLocale.InfoUtente infoUt = creaInfoUtente(this.user);

            if (infoUt != null)
            {
                if (!string.IsNullOrEmpty(infoUt.idAmministrazione) &&
                    !string.IsNullOrEmpty(infoUt.idPeople)
                    )
                {
                    // Lancio applicazione esibizione/conservazione
                    if (string.IsNullOrEmpty(ProfiloUtente))
                    {
                        ProfiloUtente = ConservazioneManager.CalcolaProfiloUtente(infoUt.idPeople, infoUt.idAmministrazione);
                    }

                    // Se provengo da PGU il Profilo è quello di conservazione
                    if (Session["PGU"] != null && Session["PGU"].Equals("PGU"))
                    {
                        ProfiloUtente = "CONSERVAZIONE";
                    }

                    if (!string.IsNullOrEmpty(ProfiloUtente))
                    {
                        switch (ProfiloUtente.ToUpper())
                        {
                        case "ESIBIZIONE":
                            Session["GestioneEsibizione"] = "ESIBIZIONE";     //per la pagina di gestione esibizione
                            ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('Esibizione/HomePageEsibizione.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                            break;

                        case "CONSERVAZIONE":
                            Session["GestioneEsibizione"] = "CONSERVAZIONE";     //per la pagina di gestione esibizione
                            ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                            break;

                        case "CONSERVAZIONE_ESIBIZIONE":
                            // Valore in sessione, che se popolato in pageLoad gestisce la combo per l'accesso al giusto modulo
                            // Rendo visibile il Panel della scelta del profilo CONSERVAZIONE / ESIBIZIONE
                        {
                            this.pnl_profili.Visible = true;
                            this.ddl_profili.Visible = true;

                            this.lbl_error.Text    = "Selezionare un profilo di accesso";
                            this.lbl_error.Visible = true;

                            // La combo profili è visibile
                            this.hf_profiloUtente.Value = ProfiloUtente;

                            if (Session["ProfiloUtente"] != null && Session["ProfiloUtente"].Equals("ESIBIZIONE"))
                            {
                                // Pulisco la sessione
                                this.hf_profiloUtente.Value   = Session["ProfiloUtente"].ToString();
                                Session["ProfiloUtente"]      = "";
                                this.lbl_error.Text           = string.Empty;
                                this.lbl_error.Visible        = false;
                                Session["GestioneEsibizione"] = "ESIBIZIONE";         //per la pagina di gestione esibizione
                                ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('Esibizione/HomePageEsibizione.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                            }

                            if (Session["ProfiloUtente"] != null && Session["ProfiloUtente"].Equals("CONSERVAZIONE"))
                            {
                                this.hf_profiloUtente.Value   = Session["ProfiloUtente"].ToString();
                                Session["ProfiloUtente"]      = "";
                                this.lbl_error.Text           = string.Empty;
                                this.lbl_error.Visible        = false;
                                Session["GestioneEsibizione"] = "CONSERVAZIONE";         //per la pagina di gestione esibizione
                                ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                            }
                            break;
                        }

                        default:
                            ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                            break;
                        }
                    }

                    //if(!string.IsNullOrEmpty(ProfiloUtente) && ProfiloUtente.ToUpper().Equals("ESIBIZIONE"))
                    //    ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('../Esibizione/HomePageEsibizione.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                    //else
                    //    ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                }
                else
                {
                    // Lancio applicazione Conservazione
                    ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
                }
            }
            else
            {
                // Default, Conservazione
                ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
            }
            //
            // End Mev cs 1.4 - esibizione

            // Response.Write("<script>var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}</script>");
            //ClientScript.RegisterStartupScript(this.GetType(), "openApplicazione", "var w=window.open('HomePageNew.aspx','HomePage','scrollbars=yes,location=0,resizable=yes');w.moveTo(0,0);w.resizeTo(screen.availWidth,screen.availHeight);if(w!=self){window.opener=null;self.close();}", true);
        }
Beispiel #12
0
        protected void btn_accedi_Click(object sender, ImageClickEventArgs e)
        {
            if (string.IsNullOrEmpty(this.hd_forceLogin.Value))
            {
                if (string.IsNullOrEmpty(this.hd_ddlRuolicaricato.Value))
                {
                    try
                    {
                        string message = string.Empty;

                        if (!loginAction(this.CreateUserLogin(this.txt_pass.Text, this.txt_userId.Text), out message))
                        {
                            this.lbl_error.Text    = message;
                            this.lbl_error.Visible = true;
                        }
                    }
                    catch (Exception exception)
                    {
                        System.Diagnostics.Debug.WriteLine(exception.ToString());

                        this.lbl_error.Text    = "Errore di connessione con il Server";
                        this.lbl_error.Visible = true;
                        //focus
                        string s = "<SCRIPT language='javascript'>document.getElementById('" + txt_userId.ID + "').focus() </SCRIPT>";
                        RegisterStartupScript("focus", s);

                        Debugger.Write("Errore nella login: "******"DbType"] = dbType;
                        this.LaunchApplication();
                    }
                    else
                    {
                        this.lbl_error.Text    = "Errore di comunicazione con il server";
                        this.lbl_error.Visible = true;
                    }
                }
            }
            else
            {
                if (isAuthorized)
                {
                    string dbType = ConservazioneManager.getDbType();
                    if (dbType != string.Empty)
                    {
                        Session["DbType"] = dbType;
                        this.LaunchApplication();
                    }
                    else
                    {
                        this.lbl_error.Text    = "Errore di comunicazione con il server";
                        this.lbl_error.Visible = true;
                    }
                }
                else
                {
                    this.lbl_error.Text    = "Utente non abilitato";
                    this.lbl_error.Visible = true;
                }
            }

            //
            // Adeguamento login Centro servizi dopo mev multi amministrazione
            if (this.hf_loginResult.Value.Equals("NO_AMMIN"))
            {
                //
                // Carico le amministrazioni buone per l'user id inserito.
                DocsPaWR.Amministrazione[] amministrazioni = null;
                string returnMsg = string.Empty;
                amministrazioni = UserManager.getListaAmministrazioniByUser(this, this.txt_userId.Text, true, out returnMsg);

                if (amministrazioni != null && amministrazioni.Length > 0)
                {
                    for (int i = 0; i < amministrazioni.Length; i++)
                    {
                        if (!ddl_Amministrazioni.Items.Contains(new ListItem(amministrazioni[i].descrizione, amministrazioni[i].systemId)))
                        {
                            this.ddl_Amministrazioni.Items.Add(new ListItem(amministrazioni[i].descrizione, amministrazioni[i].systemId));
                        }
                    }

                    //
                    // La lista delle amministrazioni viene resa visibile
                    this.pnl_ddlAmm.Visible          = true;
                    this.ddl_Amministrazioni.Visible = true;
                }
                else
                {
                    this.lbl_error.Text = "Nessuna amministrazione disponibile";
                }
            }
            //
            // End Adeguamento login Centro servizi dopo mev multi amministrazione
        }
Beispiel #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grdSupporti_ItemCommand(object sender, DataGridCommandEventArgs e)
        {
            this.grdSupporti.SelectedIndex = e.Item.ItemIndex;

            if (e.CommandName == "DOWNLOAD")
            {
                // Modifica per la scrittura dell'evento Download su Registro Conservazione e sul Log

                WSConservazioneLocale.InfoUtente infoUtente = ((WSConservazioneLocale.InfoUtente)Session["infoutCons"]);
                string idConservazione = this.NormalizeFilterCriteria(Request.QueryString["idConservazione"]);
                bool   redirectflag    = false;
                try
                {
                    Response.Redirect(e.CommandArgument.ToString(), redirectflag);

                    // MEV CS 1.5 - Alert Conservazione
                    // il download è avvenuto correttamente - verifico se l'alert è attivo
                    if (Utils.ConservazioneManager.IsAlertConservazioneAttivo(infoUtente.idAmministrazione, "DOWNLOAD"))
                    {
                        //task asincrono di incremento contatore ed eventuale invio alert
                        Utils.ConservazioneManager.InvioAlertAsync(infoUtente, "DOWNLOAD", string.Empty, string.Empty);
                    }
                    // end MEV CS 1.5

                    WSConservazioneLocale.RegistroCons regCons = new WSConservazioneLocale.RegistroCons();
                    regCons.idAmm       = infoUtente.idAmministrazione;
                    regCons.idIstanza   = idConservazione;
                    regCons.tipoOggetto = "I";
                    regCons.tipoAzione  = "";
                    regCons.userId      = infoUtente.userId;
                    regCons.codAzione   = "DOWNLOAD_ISTANZA";
                    regCons.descAzione  = "Download Istanza " + idConservazione;
                    regCons.esito       = "1";
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInRegistroCons(regCons, infoUtente);

                    // Inserisce nel DPA_LOG la Verifica Integrià dell'istanza
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInDpaLog(infoUtente, "DOWNLOAD_ISTANZA", idConservazione, "Download Istanza " + idConservazione, WSConservazioneLocale.Esito.OK);
                }
                catch
                {
                    WSConservazioneLocale.RegistroCons regCons = new WSConservazioneLocale.RegistroCons();
                    regCons.idAmm       = infoUtente.idAmministrazione;
                    regCons.idIstanza   = idConservazione;
                    regCons.tipoOggetto = "I";
                    regCons.tipoAzione  = "";
                    regCons.userId      = infoUtente.userId;
                    regCons.codAzione   = "DOWNLOAD_ISTANZA";
                    regCons.descAzione  = "Download Istanza " + idConservazione;
                    regCons.esito       = "0";
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInRegistroCons(regCons, infoUtente);

                    // Inserisce nel DPA_LOG la Verifica Integrià dell'istanza
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInDpaLog(infoUtente, "DOWNLOAD_ISTANZA", idConservazione, "Download Istanza " + idConservazione, WSConservazioneLocale.Esito.KO);
                }



                //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "download", "", true);
            }
            else if (e.CommandName == "BROWSE")
            {
                // Modifica per la scrittura dell'evento Browse su Registro Conservazione e sul Log

                WSConservazioneLocale.InfoUtente infoUtente = ((WSConservazioneLocale.InfoUtente)Session["infoutCons"]);
                string idConservazione = this.NormalizeFilterCriteria(Request.QueryString["idConservazione"]);

                try
                {
                    // Azione di browse dell'istanza di conservazione
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "openWindow", "window.open('" + e.CommandArgument + "');", true);

                    //Response.Redirect(e.CommandArgument.ToString());

                    // MEV CS 1.5 - Alert Conservazione
                    // l'operazione è avvenuta correttamente - verifico se l'alert è attivo
                    if (Utils.ConservazioneManager.IsAlertConservazioneAttivo(infoUtente.idAmministrazione, "SFOGLIA"))
                    {
                        // task asincrono di incremento contatore ed eventuale invio alert
                        Utils.ConservazioneManager.InvioAlertAsync(infoUtente, "SFOGLIA", string.Empty, string.Empty);
                    }
                    // end MEV CS 1.5

                    WSConservazioneLocale.RegistroCons regCons = new WSConservazioneLocale.RegistroCons();
                    regCons.idAmm       = infoUtente.idAmministrazione;
                    regCons.idIstanza   = idConservazione;
                    regCons.tipoOggetto = "I";
                    regCons.tipoAzione  = "";
                    regCons.userId      = infoUtente.userId;
                    regCons.codAzione   = "SFOGLIA_ISTANZA";
                    regCons.descAzione  = "Visualizzazione contenuti istanza " + idConservazione;
                    regCons.esito       = "1";
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInRegistroCons(regCons, infoUtente);

                    // Inserisce nel DPA_LOG la Verifica Integrià dell'istanza
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInDpaLog(infoUtente, "SFOGLIA_ISTANZA", idConservazione, "Visualizzazione contenuti istanza ", WSConservazioneLocale.Esito.OK);
                }
                catch
                {
                    WSConservazioneLocale.RegistroCons regCons = new WSConservazioneLocale.RegistroCons();
                    regCons.idAmm       = infoUtente.idAmministrazione;
                    regCons.idIstanza   = idConservazione;
                    regCons.tipoOggetto = "I";
                    regCons.tipoAzione  = "";
                    regCons.userId      = infoUtente.userId;
                    regCons.codAzione   = "SFOGLIA_ISTANZA";
                    regCons.descAzione  = "Visualizzazione contenuti istanza " + idConservazione;
                    regCons.esito       = "0";
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInRegistroCons(regCons, infoUtente);

                    // Inserisce nel DPA_LOG la Verifica Integrià dell'istanza
                    ConservazioneWA.Utils.ConservazioneManager.inserimentoInDpaLog(infoUtente, "SFOGLIA_ISTANZA", idConservazione, "Visualizzazione contenuti istanza ", WSConservazioneLocale.Esito.KO);
                }
            }
            else if (e.CommandName == "REGISTRA_SUPPORTO")
            {
                // Azione successiva alla registrazione del supporto rimovibile

                this.FetchSupporti();
            }
            else if (e.CommandName == "VERIFICA_SUPPORTO")
            {
                // Azione successiva alla verifica del supporto

                //string esitoVerifica = this.hd_verifica.Value;

                this.FetchSupporti();

                Label lblIdIstanza  = (Label)e.Item.FindControl("lblIdIstanza");
                Label lblIdSupporto = (Label)e.Item.FindControl("lblIdSupporto");

                this.FetchStoriaVerifiche(lblIdIstanza.Text, lblIdSupporto.Text);
            }
            else if (e.CommandName == "STORIA_VERIFICHE_SUPPORTO")
            {
                Label lblIdIstanza  = (Label)e.Item.FindControl("lblIdIstanza");
                Label lblIdSupporto = (Label)e.Item.FindControl("lblIdSupporto");

                this.FetchStoriaVerifiche(lblIdIstanza.Text, lblIdSupporto.Text);
            }
            else if (e.CommandName == "GO_TO_ISTANZA")
            {
                Label lblIdIstanza = (Label)e.Item.FindControl("lblIdIstanza");

                //istanze += "<li><a href=\"RicercaIstanze.aspx?id=" + singoleIstanze[i] + "\" title=\"Istanza numero " + singoleIstanze[i] + "\">" + singoleIstanze[i] + "</a></li>";

                this.Response.Redirect(string.Format("~/RicercaIstanze.aspx?id={0}", lblIdIstanza.Text));
            }
            else if (e.CommandName == "VERIFICA_INTEGRITA_STORAGE")
            {
                this.FetchSupporti();
            }
            else if (e.CommandName == "VERIFICA_LEGGIBILITA")
            {
                this.FetchSupporti();
            }
            else if (e.CommandName == "VERIFICHE_IL")
            {
                this.FetchSupporti();
            }
            // Modifica Rigenerazione Istanza Danneggiata a.sigalot
            else if (e.CommandName == "RIGENERAZIONE_ISTANZA")
            {
                string idConservazione = this.NormalizeFilterCriteria(Request.QueryString["idConservazione"]);

                WSConservazioneLocale.InfoUtente infoUtente = ((WSConservazioneLocale.InfoUtente)Session["infoutCons"]);
                Label lblIdSupporto = (Label)e.Item.FindControl("lblIdSupporto");

                if (string.IsNullOrEmpty(idConservazione))
                {
                    Label lblIdIstanza = (Label)e.Item.FindControl("lblIdIstanza");
                    idConservazione = lblIdIstanza.Text;
                }

                //ricerca x vedere se già ci sono istanze rigenerate DA FARE
                bool isIstanzaRig = ConservazioneManager.isIstanzaRigenerata(idConservazione, infoUtente);

                if (isIstanzaRig)
                {
                    // Istanza già rigenerata
                    this.hd_supporto_da_rigenerare.Value   = lblIdSupporto.Text;
                    this.hd_ID_istanza_da_rigenerare.Value = idConservazione;
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "notifyRigeneraIstanza", "notifyRigeneraIstanza('" + idConservazione + "','" + lblIdSupporto.Text + "');", true);
                }
                else
                {
                    string message = ConservazioneManager.rigeneraIstanza(idConservazione, lblIdSupporto.Text, infoUtente);
                    //if (string.IsNullOrEmpty(message))
                    //    Response.Write("<script>alert('Operazione avvenuta con successo')</script>");
                    //else
                    //    Response.Write("<script>alert('" + message + "')</script>");

                    if (string.IsNullOrEmpty(message))
                    {
                        //Response.Write("<script>alert('Operazione avvenuta con successo')</script>");
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_successo", "alert('Operazione avvenuta con successo.');", true);
                    }
                    else
                    {
                        //Response.Write("<script>alert('"+message+"')</script>");
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_rigenerazione_fallita", "alert('Si è verificato un errore.');", true);
                    }
                }
            }

            this.upDettaglio.Update();
        }
Beispiel #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Expires = -1;

            try
            {
                idEsibizione    = Request.QueryString["idEsibizione"];
                idDocumento     = Request.QueryString["idDocumento"];
                tipofirma       = Request.QueryString["tipofirma"];
                this.infoUtente = ((WSConservazioneLocale.InfoUtente)Session["infoutCons"]);

                if (string.IsNullOrEmpty(tipofirma))
                {
                    tipofirma = string.Empty;
                }
                if (tipofirma.Equals("cosign"))
                {
                    firmabool = true;
                }
                else
                {
                    firmabool = false;
                }

                byte[] ba = Request.BinaryRead(Request.ContentLength);
                DocsPaWR.DocsPaWebService WS = new ProxyManager().getProxyDocsPa();

                DocsPaWR.FileDocumento fd = new ConservazioneWA.DocsPaWR.FileDocumento();

                ASCIIEncoding ae            = new ASCIIEncoding();
                string        base64content = ae.GetString(ba);
                byte[]        content       = Convert.FromBase64String(base64content);

                //timestamp
                bool result = Utils.ConservazioneManager.MarcaCertificazioneIstanzaEsibizione(idEsibizione, this.infoUtente, content);
                if (!result)
                {
                    this.RegisterClientScript("errMarca", "alert('Apposizione marca temporale fallita.');");
                }


                DocsPaWR.InfoUtente infoutWS = WS.getInfoUtente(infoUtente.idPeople, infoUtente.idGruppo);

                if (!IsPostBack)
                {
                    DocsPaWR.FileRequest fr = WS.GetVersionsMainDocument(infoutWS, idDocumento)[0];
                    //il file è in formato pdf
                    //fr.fileName += ".pdf";

                    fr.dataInserimento = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");

                    bool retValue = WS.AppendDocumentoFirmato(base64content, firmabool, ref fr, infoutWS);

                    if (!retValue)
                    {
                        Debugger.Write("Errore nel Page_Load (docs = NULL)");
                        throw new Exception();
                    }
                    else
                    {
                        //aggiornamento tabella DPA_AREA_ESIBIZIONE
                        if (!ConservazioneManager.UpdateCertificazioneIstanzaEsibizione(this.infoUtente, this.idEsibizione))
                        {
                            Debugger.Write("Errore nel Page_Load (aggiornamento DPA_AREA_ESIBIZIONE)");
                            throw new Exception("Errore nell'aggioramento dei dati");
                        }
                    }
                }

                string confirmMsg = "Firma avvenuta con successo.";
                this.RegisterClientScript("SignCertOK", "alert('" + confirmMsg + "');");
            }

            catch (Exception ex)
            {
                string errorMsg = "Errore nella firma del documento di certificazione: " + ex.Message;
                this.RegisterClientScript("SignCertKO", "alert('" + errorMsg + "');");
            }
        }
Beispiel #15
0
        protected void txt_Codice_TextChanged(object sender, EventArgs e)
        {
            //In questo caso il campo è readOnly.
            //Controllo solo il codice perchè la descrizione è sempre readOnly,
            //l'apertura della rubrica è quindi inutile in quanto non si può
            //modificare il valore di questo userControl
            if (sCodiceReadOnly)
            {
                return;
            }

            string condRegistri = string.Empty;

            if (regAll != null && regAll.Length > 0)
            {
                condRegistri = " and (id_registro in (";
                foreach (ConservazioneWA.WSConservazioneLocale.Registro reg in regAll)
                {
                    condRegistri += reg.systemId + ",";
                }
                condRegistri  = condRegistri.Substring(0, condRegistri.Length - 1);
                condRegistri += ") OR id_registro is null)";
            }

            //Se in sessione c'è un ruolo, vuol dire che sono sul frontend e quindi la
            //rubrica puo' funzionare, in quanto preleva da sessione il registro, il ruolo e
            //l'utente che la vorrebbero utilizzando.
            //In caso contrario, vuol dire che sto chiamando l'apertura della rubrica
            //dall'amministrazione, in particolare da una delle due anteprime di profilazione.
            //In questo caso non essendoci nessun registro, nè ruolo nè utente in sessione,
            //l'apertura della rubrica viene inibita, ma non è un problema in quanto essendo
            //un antemprima, serve solo per determinare una veste grafica gradevole per tipo
            //di documento o di fascicolo che si sta creando.

            //if (txt_Codice.Text != null && txt_Codice.Text != "")
            if ((sCodice != null && sCodice != "") || (txt_Codice.Text != null && txt_Codice.Text != ""))
            {
                ConservazioneWA.WSConservazioneLocale.ElementoRubrica er = ConservazioneManager.getElementoRubrica(this.Page, txt_Codice.Text, condRegistri, infoUtente);
                //DocsPaWR.Corrispondente er = UserManager.getCorrispondenteRubrica(this.Page, this.txt_Codice.Text, DocsPaWR.RubricaCallType.CALLTYPE_PROTO_IN);
                if (er != null && er.descrizione != null && er.descrizione != "")
                {
                    this.TIPO = er.tipo;
                    this.ID_CORRISPONDENTE = er.systemId;
                    txt_Descrizione.Text   = er.descrizione;
                    txt_Codice.Text        = er.codice;
                }
                else
                {
                    this.TIPO = "";
                    this.ID_CORRISPONDENTE = "";
                    txt_Descrizione.Text   = "";
                    txt_Codice.Text        = "";
                }
            }
            else
            {
                this.TIPO = "";
                this.ID_CORRISPONDENTE = "";
                txt_Descrizione.Text   = "";
                txt_Codice.Text        = "";
            }
        }
Beispiel #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this._infoUtente    = ((WSConservazioneLocale.InfoUtente)Session["infoutCons"]);
            this._tipiSupporto  = ConservazioneManager.GetTipiSupporto();
            this._statiSupporto = ConservazioneManager.GetStatiSupporto();

            if (!Page.IsPostBack)
            {
                this.PrepareFilters();

                string idConservazione = this.NormalizeFilterCriteria(Request.QueryString["idConservazione"]);

                if (!string.IsNullOrEmpty(idConservazione))
                {
                    this.FetchSupporti();

                    this.txtFilterIdIstanza.Text = idConservazione;
                }
                else
                {
                    string id = this.NormalizeFilterCriteria(Request.QueryString["id"]);

                    if (!string.IsNullOrEmpty(id))
                    {
                        this.FetchSupporti();

                        this.txtFilterIdSupporto.Text = id;
                    }
                }

                this.GestioneGrafica();
            }

            //se l'istanza viene messa in lavorazione
            if (this.hd_istanza_da_rigenerare != null && this.hd_istanza_da_rigenerare.Value != String.Empty && this.hd_istanza_da_rigenerare.Value != "undefined")
            {
                WSConservazioneLocale.InfoUtente infoUtente = ((WSConservazioneLocale.InfoUtente)Session["infoutCons"]);
                string idSupporto = this.hd_supporto_da_rigenerare.Value;
                string idIstanza  = this.hd_ID_istanza_da_rigenerare.Value;
                string message    = "";
                try
                {
                    if (!string.IsNullOrEmpty(idSupporto) && !string.IsNullOrEmpty(idIstanza))
                    {
                        message = ConservazioneManager.rigeneraIstanza(idIstanza, idSupporto, infoUtente);
                        this.hd_istanza_da_rigenerare.Value    = null;
                        this.hd_supporto_da_rigenerare.Value   = null;
                        this.hd_ID_istanza_da_rigenerare.Value = null;

                        if (string.IsNullOrEmpty(message))
                        {
                            //Response.Write("<script>alert('Operazione avvenuta con successo')</script>");
                            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_successo", "alert('Operazione avvenuta con successo.');", true);
                        }
                        else
                        {
                            //Response.Write("<script>alert('"+message+"')</script>");
                            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_rigenerazione_fallita", "alert('Si è verificato un errore.');", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_rigenerazione_fallita", "alert('Si è verificato un errore.');", true);
                    }
                }
                catch
                {
                    this.hd_istanza_da_rigenerare.Value    = null;
                    this.hd_supporto_da_rigenerare.Value   = null;
                    this.hd_ID_istanza_da_rigenerare.Value = null;
                }
            }
        }
Beispiel #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Expires = -1;

            WSConservazioneLocale.InfoUtente infoUt = (WSConservazioneLocale.InfoUtente)Session["infoutCons"];
            // Per adesso Provo lacale
            bool localStore = true;

            //
            // Get isLocalStore
            localStore = ConservazioneWA.Utils.ConservazioneManager.isLocalStore();

            try
            {
                // Parametri necessari, idIstanza di conservazione, pathFile
                // Parametri passati in input dal chiamante
                idIstanza   = Request.QueryString["idIstanza"];
                idDocumento = Request.QueryString["idDoc"];
                type        = Request.QueryString["type"];


                wss = new ProxyManager().getProxy();

                // Visualizzazione xml per documento
                if (type == "D")
                {
                    //
                    // Recupero il file di chiusura, in cui sono contenute tutte le informazioni
                    Dictionary <String, String> documentiMemorizzati = null;
                    documentiMemorizzati = ConservazioneWA.Utils.ConservazioneManager.getFilesFromUniSincro(infoUt, idIstanza, localStore);

                    string info = documentiMemorizzati[idDocumento];

                    if (string.IsNullOrEmpty(info))
                    {
                        //
                    }
                    else
                    {
                        // Prendo il file dallo storage
                        //string formato = info.Split('§')[0];
                        string formato    = "text/plain";
                        string idDocument = info.Split('§')[1];
                        string path       = info.Split('§')[2];
                        //string hashSupporto = info.Split('§')[3];

                        pathFile = path + ".xml";

                        byte[] contentFile = wss.getFileFromStore(infoUt, idIstanza, pathFile, localStore);

                        if (contentFile != null)
                        {
                            Response.ContentType = formato;
                            Response.AddHeader("Content-Disposition", "inline");
                            Response.BinaryWrite(contentFile);
                        }
                    }
                }

                // Visualizzazione xml per fascicolo
                if (type == "F")
                {
                    // Get Info istanze conservazione
                    WSConservazioneLocale.ItemsConservazione[] itemsCons = ConservazioneManager.getItemsConservazione(idIstanza, infoUt);

                    string formato     = "text/plain";
                    string idFascicolo = idDocumento;

                    string CodiceFascicolo = string.Empty;
                    if (itemsCons.Length > 0)
                    {
                        CodiceFascicolo = itemsCons.FirstOrDefault(x => x.ID_Project.ToString() == idFascicolo).CodFasc.ToString();
                    }

                    string path = "\\Fascicoli" + "\\" + CodiceFascicolo + "\\" + idFascicolo;
                    //string hashSupporto = info.Split('§')[3];

                    pathFile = path + ".xml";

                    byte[] contentFile = wss.getFileFromStore(infoUt, idIstanza, pathFile, localStore);

                    if (contentFile != null)
                    {
                        Response.ContentType = formato;
                        Response.AddHeader("Content-Disposition", "inline");
                        Response.BinaryWrite(contentFile);
                    }
                }
            }
            catch (Exception ex)
            {
                Debugger.Write("Errore nel download del file: " + ex.Message);
            }
        }
Beispiel #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string thisPage = this.Request.CurrentExecutionFilePath + "?u=";
            string proxyURL = string.Empty;

            try
            {
                proxyURL = HttpUtility.UrlDecode(Request.QueryString["u"].ToString());
            }
            catch { }

            if (proxyURL != string.Empty)
            {
                try
                {
                    string storageBase = ConservazioneManager.httpStorageRemoteUrlAddress();

                    Uri            proxURI = new Uri(storageBase + proxyURL);
                    string         lastArg = proxURI.Segments.LastOrDefault();
                    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(proxURI.OriginalString);
                    request.Method = "GET";
                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();

                    if (response.StatusCode.ToString().ToLower() == "ok")
                    {
                        string       contentType   = response.ContentType;
                        Stream       content       = response.GetResponseStream();
                        StreamReader contentReader = new StreamReader(content);
                        if (string.IsNullOrEmpty(contentType))
                        {
                            if (lastArg.ToLower().EndsWith(".html"))
                            {
                                contentType = "text/html";
                            }

                            if (lastArg.ToLower().EndsWith(".htm"))
                            {
                                contentType = "text/htm";
                            }

                            if (lastArg.ToLower().EndsWith(".css"))
                            {
                                contentType = "text/css";
                            }

                            if (lastArg.ToLower().EndsWith(".zip"))
                            {
                                contentType = "application/x-zip-compressed";
                            }
                        }
                        Response.ContentType = contentType;
                        if (contentType.ToLower().Contains("text"))
                        {
                            string page = contentReader.ReadToEnd();

                            if (page.Contains("href=\"../static/main.css\""))
                            {
                                page = page.Replace("href=\"../static/main.css\"", "Href='" + thisPage + proxyURL.Replace(lastArg, string.Empty) + "../static/main.css'");
                            }

                            page = page.Replace("href=\"", "href=\"" + thisPage + proxyURL);

                            //href="../static/main.css"

                            page = page.Replace("href='", "href='" + thisPage + proxyURL);
                            page = page.Replace("src=\"", "src=\"" + thisPage + proxyURL);

                            if (page.Contains(lastArg))
                            {
                                if (!lastArg.EndsWith("/"))
                                {
                                    page = page.Replace(lastArg, string.Empty);
                                }
                            }

                            if (Response.ContentType.ToLower().Contains("text/css"))
                            {
                                proxyURL = proxyURL.Replace(lastArg, string.Empty);
                                page     = page.Replace("url(", "url(" + thisPage + proxyURL);
                            }

                            Response.Write(page);
                        }
                        else
                        {
                            // BinaryReader bcont = new BinaryReader(content);
                            //int len = (int)response.ContentLength;
                            // byte[] con = bcont.ReadBytes (len);
                            //content-disposition:attachment; filename=68702.zip


                            using (MemoryStream memoryStream = new MemoryStream())
                            {
                                byte[] buffer = new byte[8192];
                                int    bytesRead;
                                while ((bytesRead = content.Read(buffer, 0, buffer.Length)) > 0)
                                {
                                    memoryStream.Write(buffer, 0, bytesRead);
                                }
                                if (contentType.ToLower().Contains("zip"))
                                {
                                    Response.AddHeader("Content-Disposition", "attachment; filename=" + lastArg);
                                    Response.AddHeader("Content-Length", memoryStream.Length.ToString());
                                }
                                Response.BinaryWrite(memoryStream.ToArray());
                            }
                        }
                    }
                }
                catch
                {
                    Response.StatusCode = 404;
                }
            }
        }