Beispiel #1
0
        private void setUserSession()
        {
            this._datiAmministratore = new DocsPAWA.DocsPaWR.InfoUtenteAmministratore();

            DocsPAWA.AdminTool.Manager.SessionManager sessionMng = new DocsPAWA.AdminTool.Manager.SessionManager();
            this._datiAmministratore = sessionMng.getUserAmmSession();
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="infoDocumento"></param>
        /// <returns></returns>
        protected string GetTipo(DocsPaWR.InfoDocumento infoDocumento)
        {
            DocsPAWA.DocsPaWR.EtichettaInfo[]         etichette;
            DocsPAWA.DocsPaWR.DocsPaWebService        wws     = new DocsPAWA.DocsPaWR.DocsPaWebService();
            DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
            DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();
            String idAmm = null;

            if (UserManager.getInfoUtente() != null && !string.IsNullOrEmpty(UserManager.getInfoUtente().idAmministrazione))
            {
                idAmm = UserManager.getInfoUtente().idAmministrazione;
            }
            etichette = wws.getEtichetteDocumenti(infoUtente, idAmm);
            string grigio   = etichette[3].Descrizione; //Valore G
            string allegato = etichette[4].Descrizione; //Valore ALL

            if (infoDocumento.allegato)
            {
                // return "ALL";
                return(allegato);
            }
            else
            {
                // return "NP";
                return(grigio);
            }
        }
Beispiel #3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.Session.Abandon();

            string sessionID = Session.SessionID;

            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

            AmmUtils.WebServiceLink web = new AmmUtils.WebServiceLink();
            DocsPAWA.DocsPaWR.InfoUtenteAmministratore user = sessionManager.getUserAmmSession();
            if (user != null)
            {
                web.Logout(user);
            }

            switch (Request.QueryString["FROM"])
            {
            case "ABORT":
                Response.Redirect("login.htm");
                break;

            case "EXPIRED":
                FormsAuthentication.SignOut();
                Response.Redirect("login.htm");
                break;
            }
        }
Beispiel #4
0
        private void LoadGridContestoProcedurale()
        {
            DocsPAWA.DocsPaWR.Templates template = Session["template"] as DocsPAWA.DocsPaWR.Templates;

            DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
            DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();

            List <DocsPAWA.DocsPaWR.ContestoProcedurale> listContestoProcedurale = ProfilazioneDocManager.GetListContestoProcedurale(infoUtente);

            if (listContestoProcedurale != null && listContestoProcedurale.Count > 0)
            {
                this.dg_ContestoProcedurale.DataSource = listContestoProcedurale;
                this.dg_ContestoProcedurale.DataBind();
            }

            if (!string.IsNullOrEmpty(template.ID_CONTESTO_PROCEDURALE))
            {
                foreach (var item in this.dg_ContestoProcedurale.Items)
                {
                    if (((HiddenField)(((DataGridItem)item).FindControl("System_id"))).Value.Equals(template.ID_CONTESTO_PROCEDURALE))
                    {
                        ((RadioButton)(((DataGridItem)item).FindControl("rbSelezioneContesto"))).Checked = true;
                        break;
                    }
                }
            }
        }
Beispiel #5
0
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            string systemIdContesto = string.Empty;

            foreach (var item in this.dg_ContestoProcedurale.Items)
            {
                if (((RadioButton)(((DataGridItem)item).FindControl("rbSelezioneContesto"))).Checked)
                {
                    systemIdContesto = ((HiddenField)(((DataGridItem)item).FindControl("System_id"))).Value;
                    break;
                }
            }
            if (!string.IsNullOrEmpty(systemIdContesto))
            {
                DocsPAWA.DocsPaWR.Templates template = Session["template"] as DocsPAWA.DocsPaWR.Templates;

                DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
                DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();
                if (ProfilazioneDocManager.UpdateAssociazioneTemplateContestoProcedurale(template.SYSTEM_ID.ToString(), systemIdContesto, infoUtente))
                {
                    template.ID_CONTESTO_PROCEDURALE = systemIdContesto;
                    System.Web.HttpContext.Current.Session["template"] = template;
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "window.close();", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Si è verificato un errore durante il salvataggio dei dati');", true);
                }
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //----- CONTROLLO DELL'UTENTE AMMINISTRATORE CONNESSO -----------
            if (Session.IsNewSession)
            {
                Response.Redirect("../Exit.aspx?FROM=EXPIRED");
            }

            AmmUtils.WebServiceLink ws = new AmmUtils.WebServiceLink();
            if (!ws.CheckSession(Session.SessionID))
            {
                Response.Redirect("../Exit.aspx?FROM=ABORT");
            }
            // ---------------------------------------------------------------

            DocsPAWA.AdminTool.Manager.SessionManager  sessione           = new DocsPAWA.AdminTool.Manager.SessionManager();
            DocsPAWA.DocsPaWR.InfoUtenteAmministratore datiAmministratore = new DocsPAWA.DocsPaWR.InfoUtenteAmministratore();
            datiAmministratore = sessione.getUserAmmSession();

            if (datiAmministratore != null)
            {
                lb_utente.Text = datiAmministratore.nome + " " + datiAmministratore.cognome;
            }

            lbl_position.Text = "&nbsp;&bull;&nbsp;Amministrazione: " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "1");
        }
Beispiel #7
0
 private void InvalidaPassiCorrelati()
 {
     DocsPAWA.DocsPaWR.DocsPaWebService        wws            = new DocsPAWA.DocsPaWR.DocsPaWebService();
     DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
     wws.Timeout = System.Threading.Timeout.Infinite;
     wws.InvalidaPassiCorrelatiTitolare(this._idGruppoDaSpostare, "", "R", sessionManager.getUserAmmSession());
 }
Beispiel #8
0
        /// <summary>
        /// Cancellazione di un mezzo di spedizione
        /// </summary>
        /// <param name="tipoRuolo"></param>
        /// <returns></returns>
        private DocsPAWA.DocsPaWR.ValidationResultInfo DeleteMezzoSpedizione(ref DocsPAWA.DocsPaWR.MezzoSpedizione m_sped)
        {
            DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
            datiAmministratore = session.getUserAmmSession();
            string idAmm = AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "3");

            DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            return(ws.AmmDeleteMezzoSpedizione(datiAmministratore, ref m_sped, idAmm));
        }
Beispiel #9
0
        /// <summary>
        /// Cancellazione di un tipo ruolo
        /// </summary>
        /// <param name="tipoRuolo"></param>
        /// <returns></returns>
        private DocsPAWA.DocsPaWR.ValidationResultInfo DeleteTipoRuolo(ref DocsPAWA.DocsPaWR.OrgTipoRuolo tipoRuolo)
        {
            DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
            datiAmministratore = session.getUserAmmSession();
            string idAmm = AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "3");

            DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            return(ws.AmmDeleteTipoRuolo(datiAmministratore, ref tipoRuolo, idAmm));
        }
Beispiel #10
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private CheckOutStatus[] GetCheckedOutDocuments()
        {
            // Reperimento idamministrazione correntemente selezionata
            string idAdministration = AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "3");

            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
            InfoUtente infoUtente = sessionManager.getUserAmmSession();

            return(CheckInOutAdminServices.GetCheckOutAdminDocuments(infoUtente, idAdministration));
        }
Beispiel #11
0
        /// <summary>
        /// Forza la scadenza di tutte le password di tutti gli utenti dell'amministrazione
        /// </summary>
        protected void ExpireAllPassword()
        {
            if (this.IsSupportedPasswordConfig())
            {
                DocsPAWA.DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();

                DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

                ws.AdminExpireAllPassword(sessionManager.getUserAmmSession(), this.GetIdAmministrazione());
            }
        }
Beispiel #12
0
        protected void InitializePage()
        {
            try
            {
                DocsPAWA.AdminTool.Manager.SessionManager         session    = new DocsPAWA.AdminTool.Manager.SessionManager();
                DocsPAWA.AdminTool.Manager.AmministrazioneManager ammManager = new DocsPAWA.AdminTool.Manager.AmministrazioneManager();
                DocsPaWR.InfoUtenteAmministratore infoAmministratore         = session.getUserAmmSession();

                if (infoAmministratore.tipoAmministratore == "2" || infoAmministratore.tipoAmministratore == "3")
                {
                    this.ddl_amministrazione.Items.Clear();
                    ammManager.InfoAmmCorrente(infoAmministratore.idAmministrazione);
                    DocsPaWR.InfoAmministrazione infoAmm = ammManager.getCurrentAmm();
                    this.ddl_amministrazione.Items.Add(new ListItem()
                    {
                        Text     = string.Format("[{0}] {1}", infoAmm.Codice, infoAmm.Descrizione),
                        Value    = infoAmm.IDAmm,
                        Selected = true
                    });

                    this.ddl_amministrazione.Enabled = false;
                }
                else
                {
                    ammManager.ListaAmministrazioni();

                    if (ammManager.getListaAmministrazioni() != null && ammManager.getListaAmministrazioni().Count > 0)
                    {
                        this.ddl_amministrazione.Items.Clear();
                        this.ddl_amministrazione.Items.Add(new ListItem()
                        {
                            Text = string.Empty, Value = "0"
                        });
                        foreach (DocsPaWR.InfoAmministrazione amm in ammManager.getListaAmministrazioni())
                        {
                            ListItem item = new ListItem()
                            {
                                Text  = string.Format("[{0}] {1}", amm.Codice, amm.Descrizione),
                                Value = amm.IDAmm
                            };
                            this.ddl_amministrazione.Items.Add(item);
                            this.ddl_amministrazione.Enabled = true;
                        }
                    }
                }

                this.ddl_dataEsecuzione_SelectedIndexChanged(null, null);
            }
            catch (Exception)
            {
            }
        }
Beispiel #13
0
        //INSERITA DA FABIO PRENDE LE ETICHETTE DEI PROTOCOLLI
        private void getLettereProtocolli()
        {
            DocsPAWA.DocsPaWR.DocsPaWebService        wws     = new DocsPAWA.DocsPaWR.DocsPaWebService();
            DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
            DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();
            String idAmm = null;

            if (UserManager.getInfoUtente() != null && !string.IsNullOrEmpty(UserManager.getInfoUtente().idAmministrazione))
            {
                idAmm = UserManager.getInfoUtente().idAmministrazione;
            }
            this.etichette = wws.getEtichetteDocumenti(infoUtente, idAmm);
        }
Beispiel #14
0
        /// <summary>
        /// Inserimento di un nuovo mezzo di spedizione
        /// </summary>
        /// <param name="mezzo spedizione"></param>
        /// <returns></returns>
        private DocsPAWA.DocsPaWR.ValidationResultInfo InsertMezzoSpedizione(ref DocsPAWA.DocsPaWR.MezzoSpedizione m_sped)
        {
            DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
            datiAmministratore = session.getUserAmmSession();
            string idAmm = AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "3");

            DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            return(ws.AmmInsertMezzoSpedizione(datiAmministratore, ref m_sped, idAmm));

            this.FillListMezziSpedizione();
            this.txt_descrizione.Text = "";
            // this.txt_chatipocanale.Text = "";
        }
Beispiel #15
0
        protected void btn_conferma_Click(object sender, EventArgs e)
        {
            DocsPaWR.CopyVisibility copyVisibility = getCopyVisibility();

            if (string.IsNullOrEmpty(copyVisibility.codRuoloDestinazione))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "emptySearch_3", "alert('Selezionare un ruolo di destinazione !');", true);
            }
            else
            {
                AmmUtils.WebServiceLink wsLink = new AmmUtils.WebServiceLink();

                DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
                InfoUtenteAmministratore iuA = session.getUserAmmSession();
                InfoUtente ut = new InfoUtente();
                ut.idPeople          = iuA.idPeople;
                ut.idGruppo          = (iuA.idGruppo == null ? "0" : iuA.idGruppo);
                ut.idCorrGlobali     = (iuA.idCorrGlobali == null ? "0" : iuA.idCorrGlobali);
                ut.idAmministrazione = iuA.idAmministrazione;
                ut.sede   = iuA.sede;
                ut.userId = iuA.userId;


                DocsPaWR.EsitoOperazione esitoOperazione = wsLink.CopyVisibility(ut, copyVisibility);
                // ABBATANGELI GIANLUIGI
                if (esitoOperazione.Codice == 0)
                {
                    //ABBATANGELI GIANLUIGI
                    PrintReportRequest request = new PrintReportRequest
                    {
                        ContextName   = "CopiaVisibilita",
                        SearchFilters = null,
                        UserInfo      = ut,
                        Title         = "Report copia visibilità"
                    };


                    ReportingUtils.PrintRequest = request;
                    if (esitoOperazione.Descrizione.Contains('*'))
                    {
                        esitoOperazione.Descrizione = esitoOperazione.Descrizione.Split('*')[0];
                    }

                    ClientScript.RegisterStartupScript(this.GetType(), "esitoOperazione", "if (confirm('" + esitoOperazione.Descrizione + "\\n\\rEsportare il risultato?')) {" + ReportScript + "}", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "esitoOperazione", "alert('" + esitoOperazione.Descrizione + "');", true);
                }
            }
        }
Beispiel #16
0
        protected void btn_importa_Click(object sender, EventArgs e)
        {
            //Controllo la selezione file
            if (uploadFile.Value == "" || uploadFile.Value == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "selezioneNonValida_1", "alert('Selezionare un file valido.');", true);
                return;
            }

            //Controllo che sia un file Excel
            if (uploadFile.Value != "")
            {
                if (uploadFile.Value != null)
                {
                    string[] path = uploadFile.Value.Split('.');
                    if (path.Length != 0 && path[path.Length - 1] != "xls")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "selezioneNonValida_2", "alert('I files validi sono solo quelli con estensione *.xls');", true);
                        return;
                    }
                }
            }

            if (Session["titolarioSelezionato"] != null)
            {
                DocsPAWA.DocsPaWR.OrgTitolario titolario = (DocsPAWA.DocsPaWR.OrgTitolario)Session["titolarioSelezionato"];

                //Inizio importazione
                HttpPostedFile p    = uploadFile.PostedFile;
                Stream         fs   = p.InputStream;
                byte[]         dati = new byte[fs.Length];
                fs.Read(dati, 0, (int)fs.Length);
                fs.Close();

                DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

                if (wws.importTitolario(dati, titolario, sessionManager.getUserAmmSession()))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "importazioneAvvenuta", "alert('Importazione avvenuta con successo.');", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "importazioneNonAvvenuta", "alert('Problemi nell\\'importazione controllare il file di log.');", true);
                }
            }

            //Abilito il pulsante di log
            btn_log.Visible = true;
        }
Beispiel #17
0
        /// <summary>
        /// Save dei dati della password
        /// </summary>
        protected void SavePasswordConfigurations()
        {
            if (this.IsSupportedPasswordConfig())
            {
                int idAmministrazione = this.GetIdAmministrazione();

                DocsPAWA.DocsPaWR.PasswordConfigurations pwdConfigurations = new DocsPAWA.DocsPaWR.PasswordConfigurations();

                pwdConfigurations.IdAmministrazione = this.GetIdAmministrazione();

                int validationDaysIfEnabled;
                if (Int32.TryParse(this.txtPasswordValidityDays.Text, out validationDaysIfEnabled))
                {
                    pwdConfigurations.ValidityDays = validationDaysIfEnabled;
                }
                pwdConfigurations.ExpirationEnabled = (validationDaysIfEnabled > 0);

                int pwdMinLenght;
                if (Int32.TryParse(this.txtPasswordMinLength.Text, out pwdMinLenght))
                {
                    pwdConfigurations.MinLength = pwdMinLenght;
                }
                else
                {
                    pwdConfigurations.MinLength = 0;
                }

                pwdConfigurations.SpecialCharacters = this.txtPasswordSpecialChars.Text.ToCharArray();

                DocsPAWA.DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();

                DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

                if (!ws.AdminSavePasswordConfigurations(sessionManager.getUserAmmSession(), pwdConfigurations))
                {
                    // Aggiornamento dei dati non andato a buon fine
                    this.Page.Response.Write("<script>alert('Si è verificato un errore nell\\'aggiornamento delle configurazioni delle password.');</script>");
                }
                else
                {
                    if (!this.Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "SavePasswordConfigCompleted"))
                    {
                        this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "SavePasswordConfigCompleted", "<script>SavePasswordConfigCompleted();</script>");
                    }
                }
            }
        }
Beispiel #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="idStatus"></param>
        private bool UndoCheckOut(string idStatus)
        {
            bool retValue = false;

            // Reperimento status documento
            CheckOutStatus status = this.GetCheckOutStatus(idStatus);

            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
            InfoUtente adminUser = sessionManager.getUserAmmSession();

            ValidationResultInfo resultInfo = CheckInOutAdminServices.ForceUndoCheckOutAdminDocument(adminUser, status);

            if (resultInfo.Value)
            {
                this.CheckOutStatusLocalList.Remove(status);

                this.FetchLocal();

                retValue = true;
            }
            else
            {
                string errorMessage = string.Empty;

                foreach (BrokenRule brokenRule in resultInfo.BrokenRules)
                {
                    if (errorMessage != string.Empty)
                    {
                        errorMessage += Environment.NewLine;
                    }

                    errorMessage += brokenRule.Description;
                }

                errorMessage = errorMessage.Replace("'", "\\'");

                // Visualizzazione messaggio di errore
                this.RegisterClientScript("UndoCheckOutError", "alert('" + errorMessage + "');");
            }

            return(retValue);
        }
Beispiel #19
0
        private bool insertFile(System.Web.UI.HtmlControls.HtmlInputFile upload, string typeFile, string name)
        {
            HttpPostedFile p  = upload.PostedFile;
            Stream         fs = p.InputStream;

            byte[] dati = new byte[fs.Length];
            fs.Read(dati, 0, (int)fs.Length);
            fs.Close();
            bool result = true;

            int    num       = p.FileName.LastIndexOf('\\');
            string fileInput = p.FileName.Substring(num + 1);

            string[] estensione = fileInput.Split('.');

            DocsPAWA.DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            string[] amministrazione = ((string)Session["AMMDATASET"]).Split('@');
            string   idAmm           = amministrazione[3];
            string   nomeFile        = name + idAmm + "." + estensione[1];

            ws.Timeout = System.Threading.Timeout.Infinite;

            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

            try
            {
                result = insert(sessionManager.getUserAmmSession(), dati, nomeFile, ws.getpath(typeFile));
                utils.InitImagePath.getInstance(idAmm).clear();
                return(result);
            }
            catch (Exception e)
            {
                //Debugger.Write("Errore in DocsPaWS.asmx  - metodo: insertFile", e);
                return(false);
            }

            return(result);
        }
Beispiel #20
0
        protected void btn_AggiungiContesto_Click(object sender, EventArgs e)
        {
            //Verifico che tutti i campi siano stati inseriti
            if (string.IsNullOrEmpty(this.txt_tipoContesto.Text) || string.IsNullOrEmpty(this.txt_Nome.Text) ||
                string.IsNullOrEmpty(this.txt_famiglia.Text) || string.IsNullOrEmpty(this.txt_versione.Text))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Tutti i campi sono obbligatori!');", true);
            }
            else
            {
                DocsPAWA.DocsPaWR.ContestoProcedurale contesto = new DocsPaWR.ContestoProcedurale();

                contesto.TIPO_CONTESTO_PROCEDURALE = this.txt_tipoContesto.Text;
                contesto.NOME     = this.txt_Nome.Text;
                contesto.FAMIGLIA = this.txt_famiglia.Text;
                contesto.VERSIONE = this.txt_versione.Text;

                DocsPAWA.AdminTool.Manager.SessionManager session = new DocsPAWA.AdminTool.Manager.SessionManager();
                DocsPAWA.DocsPaWR.InfoUtente infoUtente           = session.getUserAmmSession();

                if (ProfilazioneDocManager.InsertContestoProcedurale(contesto, infoUtente))
                {
                    LoadGridContestoProcedurale();
                    this.ClearField();
                    this.pnlNuovoContesto.Visible = false;
                    this.btnNuovoContesto.Enabled = true;

                    this.upButtons.Update();
                    this.UpNuovoContesto.Update();
                    this.UpDgContestoProcedurale.Update();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Si è verificato un errore durante il salvataggio dei dati');", true);
                }
            }
        }
Beispiel #21
0
        private void AccessOnNewSessionProfilato()
        {
            try
            {
                DocsPAWA.AdminTool.Manager.AmministrazioneManager manager = new DocsPAWA.AdminTool.Manager.AmministrazioneManager();
                DocsPAWA.AdminTool.Manager.SessionManager         session = new DocsPAWA.AdminTool.Manager.SessionManager();
                DocsPAWA.DocsPaWR.EsitoOperazione esito = new DocsPAWA.DocsPaWR.EsitoOperazione();

                datiAmministratore = session.getUserAmmSession();

                DocsPAWA.DocsPaWR.UserLogin userLogin = new DocsPAWA.DocsPaWR.UserLogin();
                userLogin.UserName  = datiAmministratore.userId;
                userLogin.Password  = this.hd_pwd.Value;
                userLogin.SessionId = Session.SessionID;
                userLogin.IPAddress = this.Request.UserHostAddress;

                esito = manager.Login(userLogin, true, out datiAmministratore);

                if (esito.Codice.Equals(0))
                {
                    session.setUserAmmSession(datiAmministratore);

                    this._userID  = datiAmministratore.userId;
                    this._userPWD = this.hd_pwd.Value;
                    this.gotoHomePageProfilata();
                }
                else
                {
                    this.GUI("error");
                }
            }
            catch
            {
                this.GUI("error");
            }
        }
Beispiel #22
0
        protected void btn_import_Click(object sender, EventArgs e)
        {
            //Verifica dati obbligatori e loro correttezza
            if (txt_Path.Text == "")
            {
                lbl_errore.Text = "Inserire i dati obbligatori contrassegnati da un asterisco.";
                return;
            }

            OleDbConnection xlsConn   = new OleDbConnection();
            OleDbDataReader xlsReader = null;

            //xlsConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + txt_Path.Text +";Extended Properties='Excel 8.0;HDR=NO;IMEX=1';";
            xlsConn.ConnectionString = "Provider=" + System.Configuration.ConfigurationManager.AppSettings["DS_PROVIDER"] + "Data Source=" + txt_Path.Text + ";Extended Properties='" + System.Configuration.ConfigurationManager.AppSettings["DS_EXTENDED_PROPERTIES"] + "IMEX=1'";
            xlsConn.Open();

            OleDbCommand xlsCmd = new OleDbCommand("select * from [Sheet 1$]", xlsConn);

            xlsReader = xlsCmd.ExecuteReader();

            while (xlsReader.Read())
            {
                if (get_string(xlsReader, 0) != null && get_string(xlsReader, 0) != "" &&
                    get_string(xlsReader, 1) != null && get_string(xlsReader, 1) != "")
                {
                    string codice      = get_string(xlsReader, 0);
                    string descrizione = get_string(xlsReader, 1);
                    wws.Timeout = System.Threading.Timeout.Infinite;

                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

                    bool result = wws.modificaTemplateExcelTitolario(codice, descrizione, "importTitolario.xls", sessionManager.getUserAmmSession());
                    if (!result)
                    {
                        lbl_errore.Text = "Problemi durante l'importazione, consultare il file di log.";
                        btn_log.Visible = true;
                        return;
                    }
                }
            }

            if (xlsReader != null)
            {
                xlsReader.Close();
            }
            if (xlsConn != null)
            {
                xlsConn.Close();
            }

            lbl_errore.Text = "Importazione avvenuta con successo.";
        }
Beispiel #23
0
        private void GestRitornoAvvisoLF(string valore)
        {
            try
            {
                switch (valore)
                {
                case "Y":
                    // verifica che non sia l'unico del ruolo
                    if (Convert.ToInt16(this.hd_countUtenti.Value) > 1)
                    {
                        // NON è l'unico utente nel ruolo quindi lo elimina dal ruolo
                        if (this.EliminaUtenteInRuolo(this.hd_idPeople.Value, this.hd_idGruppo.Value))
                        {
                            // ripulisce l'AREA DI LAVORO
                            if (this.EliminaADLUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppo.Value))
                            {
                                // inserisce l'utente nel nuovo ruolo
                                if (this.InserimentoUtente(this.hd_idPeople.Value, this.hd_idGruppoDest.Value))
                                {
                                    // inserisce trasm utente
                                    if (this.InsTrasmUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppoDest.Value))
                                    {
                                        DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                                        AsyncCallback callback = new AsyncCallback(CallBack);
                                        invalidaPassiCorrelati = new InvalidaPassiCorrelatiDelegate(InvalidaPassiCorrelati);
                                        invalidaPassiCorrelati.BeginInvoke(this.hd_idPeople.Value, this.hd_idGruppo.Value, sessionManager.getUserAmmSession(), callback, null);

                                        string returnValue = this.hd_idCorrGlobUtente.Value + "_" + this.hd_idCorrGlobGruppoDest.Value;
                                        this.executeJS("<SCRIPT>alert('Operazione di spostamento utente eseguita correttamente.'); window.returnValue = '" + returnValue + "'; self.close();</SCRIPT>");
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        // è l'unico utente del ruolo...
                        // verifica che il ruolo non abbia trasmissioni con work-flow
                        if (this.RuoloConTrasmissioni(this.hd_idCorrGlobGruppo.Value))
                        {
                            // ruolo con trasmissioni... avvisa l'amministratore di seguire un'altra procedura
                            string msg = "Attenzione,\\n\\ncon lo spostamento di " + this.lbl_utente.Text.Replace("<b>", "").Replace("</b>", "") + " il ruolo rimane senza utenti.\\n\\nTuttavia il ruolo presenta trasmissioni che necessitano ACCETTAZIONE,\\npertanto non è possibile lasciare il ruolo privo di utenti.\\n\\n\\nProcedere come segue:\\nselezionare il ruolo nel quale ora è inserito " + this.lbl_utente.Text.Replace("<b>", "").Replace("</b>", "") + ",\\neliminarlo da questo ruolo tramite il tasto \\'Gestione utenti\\',\\nquindi inserirlo nel nuovo ruolo di destinazione utilizzando sempre il tasto indicato.";
                            this.executeJS("<SCRIPT>alert('" + msg + "'); window.returnValue = 'N'; self.close();</SCRIPT>");
                        }
                        else
                        {
                            // elimina utente dal ruolo
                            if (this.EliminaUtenteInRuolo(this.hd_idPeople.Value, this.hd_idGruppo.Value))
                            {
                                // ripulisce l'AREA DI LAVORO
                                if (this.EliminaADLUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppo.Value))
                                {
                                    // inserisce l'utente nel nuovo ruolo
                                    if (this.InserimentoUtente(this.hd_idPeople.Value, this.hd_idGruppoDest.Value))
                                    {
                                        // inserisce trasm utente
                                        if (this.InsTrasmUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppoDest.Value))
                                        {
                                            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                                            AsyncCallback callback = new AsyncCallback(CallBack);
                                            invalidaPassiCorrelati = new InvalidaPassiCorrelatiDelegate(InvalidaPassiCorrelati);
                                            invalidaPassiCorrelati.BeginInvoke(this.hd_idPeople.Value, this.hd_idGruppo.Value, sessionManager.getUserAmmSession(), callback, null);

                                            this.executeJS("<SCRIPT>alert('Operazione di spostamento utente eseguita correttamente.'); window.returnValue = 'Y'; self.close();</SCRIPT>");
                                        }
                                    }
                                }
                            }
                        }
                    }
                    break;

                case "N":
                    break;
                }
                this.hd_returnValueModalLF.Value = "";
            }
            catch
            {
            }
        }
Beispiel #24
0
        protected SchedaDocumento getDettaglioDocumento(string idProfile, string docNumber)
        {
            DocsPaWR.SchedaDocumento sd = new DocsPAWA.DocsPaWR.SchedaDocumento();

            try
            {
                if (idProfile == null && docNumber == null)
                {
                    sd = null;
                }
                else
                {
                    AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    sd = ProxyManager.getWS().DocumentoGetDettaglioDocumentoNoSecurity(sessionManager.getUserAmmSession(), idProfile, docNumber);
                    if ((sd == null))// || (sd.inCestino != null && sd.inCestino == "1"))
                    {
                        string errorMessage = string.Empty;

                        if (sd == null)
                        {
                            errorMessage = "Attenzione, non è stato possibile recuperare i dati del documento richiesto.\\nConsultare il log per maggiori dettagli.";
                            Page.Response.Write("<script>alert('" + errorMessage + "');</script>");
                            if (Page.Session["protocolloEsistente"] != null && (bool)Page.Session["protocolloEsistente"])
                            {
                                Page.Session.Remove("protocolloEsistente");
                            }
                            else
                            {
                                // Redirect alla homepage di docspa
                                SiteNavigation.CallContextStack.Clear();
                                SiteNavigation.NavigationContext.RefreshNavigation();
                                string script = "<script>window.open('../GestioneRuolo.aspx','principale','width=410,height=300,scrollbars=NO');</script>";
                                Page.Response.Write(script);
                            }
                        }
                    }
                }
            }
            catch (Exception es)
            {
                return(null);
            }

            return(sd);
        }
Beispiel #25
0
        protected void btn_salva_scheduler_Click(object sender, EventArgs e)
        {
            if (configString == null)
            {
                configString = new DocsPaWR.ChiaveConfigurazione
                {
                    Codice            = "BE_CONSERVAZIONE_AUTOTEST_JOB",
                    TipoChiave        = "B",
                    IDAmministrazione = IdAmministrazione.ToString(),
                    Modificabile      = "0",
                    Visibile          = "0",
                    IsGlobale         = "0",
                    Descrizione       = "Chiave di configurazione per gestire i controlli automatici della conservazione",
                    Valore            = "0"
                };

                DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                ws.addChiaveConfigurazione(configString);
                this.Clear(IdAmministrazione.ToString());
                configString = GetChiaveConfigurazione("BE_CONSERVAZIONE_AUTOTEST_JOB", IdAmministrazione.ToString());
            }


            if (this.Enabled.Checked == false)
            {
                configString.Valore = "0";
            }
            else
            {
                configString.Valore = GetExecutionConfigurations();
            }
            DocsPaWR.ValidationResultInfo result = null;

            result = UpdateChiaveConfig(ref configString);

            if (!result.Value)
            {
                // this.ShowValidationMessage(result);

                //
                // MEV CS 1.3 - LOG controlli automatici
                try
                {
                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                    ws.WriteLog(sessionManager.getUserAmmSession(), "AMM_CONTROLLI_AUTOMATICI", string.Empty, "Attivazione controlli automatici per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), false);
                }
                catch (Exception ex)
                {
                }
                // End MEV CS 1.3 - LOG controlli automatici
                //
            }
            else
            {
                // Pulizia della cache
                //pulizia della cache sul backend e sul frontend
                this.Clear(IdAmministrazione.ToString());
                //ricalcolo delle chiavi
                //this.FillListChiaviConfig();

                //
                // MEV CS 1.3 - LOG controlli automatici
                try
                {
                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                    ws.WriteLog(sessionManager.getUserAmmSession(), "AMM_CONTROLLI_AUTOMATICI", string.Empty, "Attivazione controlli automatici per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), true);
                }
                catch (Exception ex)
                {
                }
                // End MEV CS 1.3 - LOG controlli automatici
                //
            }
        }
Beispiel #26
0
        protected void btn_importa_Click(object sender, EventArgs e)
        {
            //Controllo la selezione file
            if (uploadFile.Value == "" || uploadFile.Value == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "selezioneNonValida_1", "alert('Selezionare un file valido.');", true);
                return;
            }

            //Controllo che sia un file Excel
            if (uploadFile.Value != "")
            {
                if (uploadFile.Value != null)
                {
                    string[] path = uploadFile.Value.Split('.');
                    if (path.Length != 0 && path[path.Length - 1] != "xls")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "selezioneNonValida_2", "alert('I files validi sono solo quelli con estensione *.xls');", true);
                        return;
                    }
                }
            }

            //Inizio importazione
            HttpPostedFile p  = uploadFile.PostedFile;
            Stream         fs = p.InputStream;

            byte[] dati = new byte[fs.Length];
            fs.Read(dati, 0, (int)fs.Length);
            fs.Close();
            bool esitoImport = true;

            DocsPAWA.DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            string[] amministrazione = ((string)Session["AMMDATASET"]).Split('@');
            string   codiceAmm       = amministrazione[0];
            bool     update          = false;

            if (CheckBox1.Checked)
            {
                update = true;
            }
            ws.Timeout = System.Threading.Timeout.Infinite;

            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();

            esitoImport = ws.importaUtenti(sessionManager.getUserAmmSession(), dati, "importUtenti.xls", codiceAmm, update, ref utInseriti, ref utAggiornati);

            if (!esitoImport)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "errore", "alert('ERRORE : controllare che il modello del file sia corretto.');", true);
                lbl_avviso.Text = "ERRORE nell'importazione !";
                btn_log.Visible = true;
                return;
            }

            //ClientScript.RegisterStartupScript(this.GetType(), "importazioneAvvenuta", "alert('Importazione completata correttamente.');", true);
            //Inserisco questa variabile in sessione per poter discriminare dalla pagina chiamante
            //se aggiornare o meno il datagrid degli utenti
            Session.Add("ImportazioneAvvenuta", "ImportazioneAvvenuta");

            lbl_avviso.Text = "Utenti Inseriti : " + utInseriti + " Utenti Aggiornati : " + utAggiornati;
            btn_log.Visible = true;
        }
Beispiel #27
0
        /// <summary>
        /// Metodo per la chiusura di un fase di lavoro
        /// </summary>
        /// <param name="result">Risultato dell'azione precedente</param>
        /// <param name="details">Dettagli sul risultato precedente</param>
        private void CloseReportVoice(SaveChangesToRoleReportResult result, String details)
        {
            if (Report[Report.Count - 1].Result == SaveChangesToRoleReportResult.Waiting || Report[Report.Count - 1].Result != SaveChangesToRoleReportResult.KO)
            {
                Report[Report.Count - 1].Result = result;
            }
            Report[Report.Count - 1].Description += "<br />" + details;
            Report[Report.Count - 1].ImageUrl     = Report[Report.Count - 1].Result == SaveChangesToRoleReportResult.OK ? "Images/completed.jpg" : "Images/failed.jpg";

            // Se la fase è Finish o se il risultato dell'operazione è un errore, viene inizializzato il report
            if (SaveChangesRequest.Phase == SaveChangesToRolePhase.Finish || result == SaveChangesToRoleReportResult.KO)
            {
                ReportingUtils.PrintRequest = new PrintReportObjectTransformationRequest()
                {
                    DataObject  = Report.ToArray(),
                    ContextName = "ModificaRuolo",
                    ReportKey   = "ModificaRuolo"
                }
            }
            ;

            //ABBATANGELI-PANICI LIBRO FIRMA
            if (SaveChangesRequest.Phase == SaveChangesToRolePhase.Finish)
            {
                SaveChangesToRoleRequest saveChangesRequest = CallContextStack.CurrentContext.ContextState["SaveChangesRequest"] as SaveChangesToRoleRequest;
                string idRuoloOld         = saveChangesRequest.IdOldRole;
                bool   interrompiProcessi = GetSessionInterrompiProcessi();
                bool   storicizzaProcessi = GetSessionStoricizzaProcessi();
                if (interrompiProcessi)
                {
                    AsyncCallback callback = new AsyncCallback(CallBack);
                    invalidaPassiCorrelati = new InvalidaPassiCorrelatiDelegate(InvalidaPassiCorrelati);
                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    invalidaPassiCorrelati.BeginInvoke("R", idRuoloOld, string.Empty, sessionManager.getUserAmmSession(), callback, null);
                }
                else if (storicizzaProcessi)
                {
                    string        idRuoloNew = SaveChangesRequest.ModifiedRole.IDGruppo;
                    AsyncCallback callback   = new AsyncCallback(CallBackStoricizza);
                    storicizzaPassiCorrelati = new StoricizzaPassiCorrelatiDelegate(StoricizzaPassiCorrelati);
                    storicizzaPassiCorrelati.BeginInvoke(idRuoloOld, idRuoloNew, callback, null);
                }
            }
            //FINE
        }
Beispiel #28
0
        /// <summary>
        /// Bottone salva del pannello Stampa Registri
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSalvaStampaRegistri_Click(object sender, EventArgs e)
        {
            #region input parameters declaration
            //
            // Parametri da passare al metodo che salva i valori nella tabella DPA_CONFIG_STAMPA_CONS
            string freqStampaValue = string.Empty;
            string oraStampaValue  = string.Empty;
            string disabled        = string.Empty;
            string idAmm           = string.Empty;
            #endregion

            //
            // esito dell'operazione di salvataggio
            bool result = false;

            //
            // Recupero i valori per il salvataggio della configurazione

            disabled        = (!this.cbAttivazioneStampaReg.Checked?"1":"0");
            freqStampaValue = this.ddlFreqStampa.SelectedValue;
            oraStampaValue  = this.ddlOraStampa.SelectedValue;


            idAmm = IdAmministrazione.ToString();

            if (!string.IsNullOrEmpty(freqStampaValue) && !string.IsNullOrEmpty(idAmm))
            {
                //
                // Chiamata al webMethod per il salvataggio della configurazione
                // Return Value = true (Operazione andata a buon fine)
                // Return Value = false (Operazione non andata a buon fine)
                result = _wsInstance.SaveStampaRegistroValues(idAmm, disabled, freqStampaValue, oraStampaValue);
            }

            if (!result)
            {
                //
                // Operazione non avvenuta
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "save_stampa_registro_KO", "alert('Salvataggio configurazione Stampa Registro non andato a buon fine');", true);

                //
                // MEV CS 1.3 - LOG Stampa Registro
                try
                {
                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    _wsInstance.WriteLog(sessionManager.getUserAmmSession(), "AMM_STAMPA_REGISTRO_CONS", string.Empty, "Attivazione stampa registro per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), false);
                }
                catch (Exception ex)
                {
                }
                // End MEV CS 1.3 - LOG Stampa Registro
                //
            }
            else
            {
                //
                // Perazione avvenuta con successo
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "save_stampa_registro_OK", "alert('Salvataggio configurazione Stampa Registro avvenuto correttamente');", true);
                this.GetDataOraInfo();

                //
                // MEV CS 1.3 - LOG Stampa Registro
                try
                {
                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    _wsInstance.WriteLog(sessionManager.getUserAmmSession(), "AMM_STAMPA_REGISTRO_CONS", string.Empty, "Attivazione stampa registro per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), true);
                }
                catch (Exception ex)
                {
                }
                // End MEV CS 1.3 - LOG Stampa Registro
                //
            }
        }
Beispiel #29
0
        protected void btn_salva_dimensioni_Click(object sender, EventArgs e)
        {
            #region OldCode
            //int num_docs, dim_istanza;
            //if (string.IsNullOrEmpty(tb_num_docs.Text) || string.IsNullOrEmpty(tb_dim_istanza.Text) || !Int32.TryParse(tb_num_docs.Text, out num_docs) || !Int32.TryParse(tb_dim_istanza.Text, out dim_istanza))
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_valori", "alert('Inserire i valori richiesti, in formato numerico!');", true);
            //}
            //else
            //{
            //    if (configString == null)
            //    {
            //        configString = new DocsPaWR.ChiaveConfigurazione
            //        {
            //            Codice = "BE_CONSERVAZIONE_MAX_DIM_ISTANZA",
            //            TipoChiave = "B",
            //            IDAmministrazione = IdAmministrazione.ToString(),
            //            Modificabile = "0",
            //            Visibile = "0",
            //            IsGlobale = "0",
            //            Descrizione = "Chiave di configurazione per definire la massima dimensione delle istanze di conservazione.",
            //            Valore = "0"
            //        };

            //        DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            //        ws.addChiaveConfigurazione(configString);
            //        this.Clear(IdAmministrazione.ToString());
            //        configString = GetChiaveConfigurazione("BE_CONSERVAZIONE_MAX_DIM_ISTANZA", IdAmministrazione.ToString());
            //    }

            //    configString.Valore = string.Format("{0}§{1}", tb_num_docs.Text, tb_dim_istanza.Text);
            //    DocsPaWR.ValidationResultInfo result = null;

            //    result = UpdateChiaveConfig(ref configString);

            //    if (!result.Value)
            //    {
            //        // this.ShowValidationMessage(result);

            //        //
            //        // MEV CS 1.3 - LOG Dimensione istanze
            //        try
            //        {
            //            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
            //            DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            //            ws.WriteLog(sessionManager.getUserAmmSession(), "AMM_DIMENSIONI_ISTANZE", string.Empty, "Definizione dimensioni massime istanze per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), false);
            //        }
            //        catch (Exception ex)
            //        {
            //        }
            //        // End MEV CS 1.3 - LOG Dimensione istanze
            //        //
            //    }
            //    else
            //    {
            //        this.Clear(IdAmministrazione.ToString());

            //        //
            //        // MEV CS 1.3 - LOG Dimensione istanze
            //        try
            //        {
            //            DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
            //            DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
            //            ws.WriteLog(sessionManager.getUserAmmSession(), "AMM_DIMENSIONI_ISTANZE", string.Empty, "Definizione dimensioni massime istanze per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), true);
            //        }
            //        catch (Exception ex)
            //        {
            //        }
            //        // End MEV CS 1.3 - LOG Dimensione istanze
            //        //
            //    }
            //}
            #endregion

            #region MEV CS 1.5 - F03_01 - NewCode
            int num_docs, dim_istanza, perc_Toll;
            if (string.IsNullOrEmpty(tb_num_docs.Text) ||
                string.IsNullOrEmpty(tb_dim_istanza.Text) ||
                string.IsNullOrEmpty(tb_perc.Text) ||
                !Int32.TryParse(tb_num_docs.Text, out num_docs) ||
                !Int32.TryParse(tb_dim_istanza.Text, out dim_istanza) ||
                !Int32.TryParse(tb_perc.Text, out perc_Toll)
                )
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "alt_valori", "alert('Inserire i valori richiesti, in formato numerico!');", true);
            }
            else
            {
                if (configString == null)
                {
                    configString = new DocsPaWR.ChiaveConfigurazione
                    {
                        Codice            = "BE_CONSERVAZIONE_MAX_DIM_ISTANZA",
                        TipoChiave        = "B",
                        IDAmministrazione = IdAmministrazione.ToString(),
                        Modificabile      = "0",
                        Visibile          = "0",
                        IsGlobale         = "0",
                        Descrizione       = "Chiave di configurazione per definire la massima dimensione delle istanze di conservazione.",
                        Valore            = "0"
                    };

                    DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                    ws.addChiaveConfigurazione(configString);
                    this.Clear(IdAmministrazione.ToString());
                    configString = GetChiaveConfigurazione("BE_CONSERVAZIONE_MAX_DIM_ISTANZA", IdAmministrazione.ToString());
                }

                configString.Valore = string.Format("{0}§{1}", tb_num_docs.Text, tb_dim_istanza.Text);
                DocsPaWR.ValidationResultInfo result = null;

                result = UpdateChiaveConfig(ref configString);

                if (!result.Value)
                {
                    // this.ShowValidationMessage(result);

                    //
                    // MEV CS 1.3 - LOG Dimensione istanze
                    try
                    {
                        DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                        DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                        ws.WriteLog(sessionManager.getUserAmmSession(), "AMM_DIMENSIONI_ISTANZE", string.Empty, "Definizione dimensioni massime istanze per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), false);
                    }
                    catch (Exception ex)
                    {
                    }
                    // End MEV CS 1.3 - LOG Dimensione istanze
                    //
                }
                else
                {
                    this.Clear(IdAmministrazione.ToString());

                    //
                    // MEV CS 1.3 - LOG Dimensione istanze
                    try
                    {
                        DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                        DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                        ws.WriteLog(sessionManager.getUserAmmSession(), "AMM_DIMENSIONI_ISTANZE", string.Empty, "Definizione dimensioni massime istanze per Ente " + AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "0"), true);
                    }
                    catch (Exception ex)
                    {
                    }
                    // End MEV CS 1.3 - LOG Dimensione istanze
                    //
                }

                #region Percentuale di Tolleranza
                if (configString_percToller == null)
                {
                    configString_percToller = new DocsPaWR.ChiaveConfigurazione
                    {
                        Codice            = "BE_CONS_PERC_TOLL_MAX_DIM_IST",
                        TipoChiave        = "B",
                        IDAmministrazione = IdAmministrazione.ToString(),
                        Modificabile      = "0",
                        Visibile          = "0",
                        IsGlobale         = "0",
                        Descrizione       = "Chiave di configurazione per definire la percentuale di tolleranza delle istanze di conservazione.",
                        Valore            = "0"
                    };

                    DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                    ws.addChiaveConfigurazione(configString_percToller);
                    this.Clear(IdAmministrazione.ToString());
                    configString_percToller = GetChiaveConfigurazione("BE_CONS_PERC_TOLL_MAX_DIM_IST", IdAmministrazione.ToString());
                }

                if (configString_percToller != null)
                {
                    configString_percToller.Valore = tb_perc.Text;
                    DocsPaWR.ValidationResultInfo result_percToll = null;

                    result_percToll = UpdateChiaveConfig(ref configString_percToller);

                    if (!result_percToll.Value)
                    {
                        // this.ShowValidationMessage(result);
                    }
                    else
                    {
                        this.Clear(IdAmministrazione.ToString());
                    }
                }
                #endregion
            }
            #endregion
        }
Beispiel #30
0
        private void btn_sposta_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (this.txt_ricCod.Text.Trim() != "" && this.txt_ricDesc.Text.Trim() != "")
                {
                    string idPeople = this.DatiUtente(this.hd_idCorrGlobUtente.Value).IDPeople;
                    this.hd_idPeople.Value = idPeople;

                    if (this.hd_idAmm.Value != "" &&
                        this.hd_userid.Value != "" &&
                        this.hd_countUtenti.Value != "" &&
                        this.hd_idPeople.Value != "" &&
                        this.hd_idGruppo.Value != "" &&
                        this.hd_idCorrGlobGruppo.Value != "" &&
                        this.hd_idGruppoDest.Value != "" &&
                        this.hd_idCorrGlobGruppoDest.Value != "")
                    {
                        // verifica che l'utente non sia connesso a docspa
                        if (this.VerificaUtenteLoggato(this.hd_userid.Value, this.hd_idAmm.Value))
                        {
                            // verifica che non sia l'unico del ruolo
                            if (Convert.ToInt16(this.hd_countUtenti.Value) > 1)
                            {
                                // NON è l'unico utente nel ruolo quindi lo elimina dal ruolo
                                if (this.EliminaUtenteInRuolo(this.hd_idPeople.Value, this.hd_idGruppo.Value))
                                {
                                    // ripulisce l'AREA DI LAVORO
                                    if (this.EliminaADLUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppo.Value))
                                    {
                                        // inserisce l'utente nel nuovo ruolo
                                        if (this.InserimentoUtente(this.hd_idPeople.Value, this.hd_idGruppoDest.Value))
                                        {
                                            // inserisce trasm utente
                                            if (this.InsTrasmUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppoDest.Value))
                                            {
                                                DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                                                AsyncCallback callback = new AsyncCallback(CallBack);
                                                invalidaPassiCorrelati = new InvalidaPassiCorrelatiDelegate(InvalidaPassiCorrelati);
                                                invalidaPassiCorrelati.BeginInvoke(this.hd_idPeople.Value, this.hd_idGruppo.Value, sessionManager.getUserAmmSession(), callback, null);

                                                string returnValue = this.hd_idCorrGlobUtente.Value + "_" + this.hd_idCorrGlobGruppoDest.Value;
                                                this.executeJS("<SCRIPT>alert('Operazione di spostamento utente eseguita correttamente.'); window.returnValue = '" + returnValue + "'; self.close();</SCRIPT>");
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                // è l'unico utente del ruolo...
                                // verifica che il ruolo non abbia trasmissioni con work-flow
                                if (this.RuoloConTrasmissioni(this.hd_idCorrGlobGruppo.Value))
                                {
                                    // ruolo con trasmissioni... avvisa l'amministratore di seguire un'altra procedura
                                    string msg = "Attenzione,\\n\\ncon lo spostamento di " + this.lbl_utente.Text.Replace("<b>", "").Replace("</b>", "") + " il ruolo rimane senza utenti.\\n\\nTuttavia il ruolo presenta trasmissioni che necessitano ACCETTAZIONE,\\npertanto non è possibile lasciare il ruolo privo di utenti.\\n\\n\\nProcedere come segue:\\nselezionare il ruolo nel quale ora è inserito " + this.lbl_utente.Text.Replace("<b>", "").Replace("</b>", "") + ",\\neliminarlo da questo ruolo tramite il tasto \\'Gestione utenti\\',\\nquindi inserirlo nel nuovo ruolo di destinazione utilizzando sempre il tasto indicato.";
                                    this.executeJS("<SCRIPT>alert('" + msg + "'); window.returnValue = 'N'; self.close();</SCRIPT>");
                                }
                                else
                                {
                                    // elimina utente dal ruolo
                                    if (this.EliminaUtenteInRuolo(this.hd_idPeople.Value, this.hd_idGruppo.Value))
                                    {
                                        // ripulisce l'AREA DI LAVORO
                                        if (this.EliminaADLUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppo.Value))
                                        {
                                            // inserisce l'utente nel nuovo ruolo
                                            if (this.InserimentoUtente(this.hd_idPeople.Value, this.hd_idGruppoDest.Value))
                                            {
                                                // inserisce trasm utente
                                                if (this.InsTrasmUtente(this.hd_idPeople.Value, this.hd_idCorrGlobGruppoDest.Value))
                                                {
                                                    DocsPAWA.AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                                                    AsyncCallback callback = new AsyncCallback(CallBack);
                                                    invalidaPassiCorrelati = new InvalidaPassiCorrelatiDelegate(InvalidaPassiCorrelati);
                                                    invalidaPassiCorrelati.BeginInvoke(this.hd_idPeople.Value, this.hd_idGruppo.Value, sessionManager.getUserAmmSession(), callback, null);


                                                    string returnValue = this.hd_idCorrGlobUtente.Value + "_" + this.hd_idCorrGlobGruppoDest.Value;
                                                    this.executeJS("<SCRIPT>alert('Operazione di spostamento utente eseguita correttamente.'); window.returnValue = '" + returnValue + "'; self.close();</SCRIPT>");
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema: dati insufficienti');</SCRIPT>");
                    }
                }
            }
            catch
            {
                this.executeJS("<SCRIPT>alert('Attenzione, si è verificato un errore di sistema');</SCRIPT>");
            }
        }