예제 #1
0
        /// <summary>
        /// Elimina un documento dal fascicolo
        /// </summary>
        /// <param name="key">Chiave del record da elimnare</param>
        private void deleteDocument(int key)
        {
            Hashtable hashDoc = FascicoliManager.getHashDocProtENonProt(this);

            if (hashDoc != null)
            {
                DocsPaWR.InfoDocumento infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)hashDoc[key];
                if (infoDoc != null)
                {
                    string          msg              = string.Empty;
                    DocsPaWR.Folder fold             = FascicoliManager.getFolderSelezionato(this);
                    string          valoreChiaveFasc = utils.InitConfigurationKeys.GetValue(UserManager.getInfoUtente().idAmministrazione, "FE_FASC_RAPIDA_REQUIRED");
                    if (string.IsNullOrEmpty(valoreChiaveFasc))
                    {
                        valoreChiaveFasc = "false";
                    }
                    DocsPAWA.DocsPaWR.ValidationResultInfo result = FascicoliManager.deleteDocFromFolder(this, fold, infoDoc.idProfile, valoreChiaveFasc, out msg);
                    if (result != null && result.BrokenRules.Length > 0)
                    {
                        DocsPAWA.DocsPaWR.BrokenRule br = (DocsPAWA.DocsPaWR.BrokenRule)result.BrokenRules[0];
                        ClientScript.RegisterStartupScript(this.GetType(), "sottonumeroSuccessivo", "alert('" + br.Description + "');", true);
                        return;
                    }
                    if (msg != string.Empty)
                    {
                        Response.Write("<script>alert('" + msg + "')</script>");
                        return;
                    }
                }
            }

            // rimuove la sessione della chiave che specifica il record da eliminare
            Page.Session.Remove("key");
        }
예제 #2
0
        protected void btn_eliminaDocInFasc_Click(object sender, ImageClickEventArgs e)
        {
            switch (this.PAGINA_CHIAMANTE)
            {
            case "NewDocListInProject":


                Hashtable hashDoc = FascicoliManager.getHashDocProtENonProt(Page);

                DocsPaWR.Folder fold             = FascicoliManager.getFolderSelezionato(Page);
                string          msg              = string.Empty;
                string          valoreChiaveFasc = utils.InitConfigurationKeys.GetValue(UserManager.getInfoUtente().idAmministrazione, "FE_FASC_RAPIDA_REQUIRED");
                if (string.IsNullOrEmpty(valoreChiaveFasc))
                {
                    valoreChiaveFasc = "false";
                }
                DocsPAWA.DocsPaWR.ValidationResultInfo result = FascicoliManager.deleteDocFromFolder(Page, fold, this.ID_PROFILE, valoreChiaveFasc, out msg);
                if (result != null && result.BrokenRules.Length > 0)
                {
                    DocsPAWA.DocsPaWR.BrokenRule br = (DocsPAWA.DocsPaWR.BrokenRule)result.BrokenRules[0];
                    Response.Write("<script>alert('" + br.Description + "')</script>");
                    return;
                }
                if (msg != string.Empty)
                {
                    Response.Write("<script>alert('" + msg + "')</script>");
                    return;
                }
                // rimuove la sessione della chiave che specifica il record da eliminare
                Page.Session.Remove("key");

                break;
            }
        }
예제 #3
0
        /// <summary>
        /// Al click su questo pulsante, viene rimosso il documento dal fasciolo aperto
        /// </summary>
        protected void btnRemoveDocumentFromProject_Click(object sender, ImageClickEventArgs e)
        {
            // Il folder selezionato
            Folder folder;

            // Messaggio restituito dalla procedura di rimozione
            String message;

            // Risultato della rimozione
            ValidationResultInfo result;

            // Recupero del folder selezionato
            folder = FascicoliManager.getFolderSelezionato(Page);

            // Rimozione del documento
            string valoreChiaveFasc = utils.InitConfigurationKeys.GetValue(UserManager.getInfoUtente().idAmministrazione, "FE_FASC_RAPIDA_REQUIRED");

            if (string.IsNullOrEmpty(valoreChiaveFasc))
            {
                valoreChiaveFasc = "false";
            }
            result = FascicoliManager.deleteDocFromFolder(
                Page,
                folder,
                ((ImageButton)sender).CommandArgument,
                valoreChiaveFasc,
                out message);

            // Se result è valorizzato ed esistono delle BrokenRules, viene
            // visualizzato un messaggio
            if (result != null &&
                result.BrokenRules.Length > 0)
            {
                this.ShowMessageToUser(result.BrokenRules[0].Description);
            }
            else
            {
                // Altrimenti viene visualizzato il messaggio restituito dall'operazione
                // di rimozione
                if (!string.IsNullOrEmpty(message))
                {
                    this.ShowMessageToUser(message);
                }
                else
                {
                    if (Request["idFolder"] != null)
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "LanciaRic", "top.principale.document.iFrame_dx.location='tabPulsantiDoc.aspx?IdFolder=" + Request["idFolder"].ToString() + "';", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "LanciaRic", "top.principale.document.iFrame_dx.location='tabPulsantiDoc.aspx';", true);
                    }
                }
            }
        }