Exemple #1
0
 private void btn_stampaRegistro_Click(object sender, System.Web.UI.ImageClickEventArgs e)
 {
     try
     {
         DocsPaWR.InfoUtente           infoUt   = UserManager.getInfoUtente(this);
         DocsPaWR.InfoDocumento        infoDoc  = new DocsPAWA.DocsPaWR.InfoDocumento();
         DocsPaWR.Registro             registro = GestManager.getRegistroSel(this);
         DocsPaWR.Ruolo                ruolo    = UserManager.getRuolo(this);
         DocsPaWR.StampaRegistroResult StpRegRS = GestManager.StampaRegistro(this, infoUt, ruolo, registro);
         if (StpRegRS != null && StpRegRS.errore != null && StpRegRS.errore != "")
         {
             string errore = StpRegRS.errore;
             errore = errore.Replace("'", "\\'");
             string l_script = "<script language=javascript>alert('" + errore + "');</script>";
             if (!this.IsStartupScriptRegistered("startup"))
             {
                 this.RegisterStartupScript("startup", l_script);
             }
         }
         else
         {
             infoDoc.docNumber = StpRegRS.docNumber;
             DocsPaWR.SchedaDocumento schedaDoc = new DocsPAWA.DocsPaWR.SchedaDocumento();
             schedaDoc = DocumentManager.getDettaglioDocumento(this, infoDoc.idProfile, infoDoc.docNumber);
             FileManager.setSelectedFileReg(this, schedaDoc.documenti[0], "../../popup");
             string sval = @"../../popup/ModalVisualStampaReg.aspx?id=" + this.Session.SessionID;
             RegisterStartupScript("ApriModale", "<script>OpenMyDialog('" + sval + "');</script>");
         }
         Response.Write("<script>parent.iFrame_dettagli.location='regDettagli.aspx';</script>");
     }
     catch (Exception ex)
     {
         ErrorManager.redirectToErrorPage(this, ex);
     }
 }
Exemple #2
0
        private void DGDoc_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            if (e.CommandName.Equals("Select"))
            {
                int key = e.Item.ItemIndex;
                ListaDoc = ((DocsPAWA.DocsPaWR.InfoDocumento[])Session["ListaDocCestino"]);
                DocsPAWA.DocsPaWR.InfoDocumento infoDoc = new DocsPAWA.DocsPaWR.InfoDocumento();

                infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)ListaDoc[e.Item.ItemIndex];
                DocumentManager.setRisultatoRicerca(this, infoDoc);

                Response.Write("<script>window.open('../documento/gestionedoc.aspx?tab=profilo&daCestino=1','principale');</script>");

                Response.Write("<script>window.close();</script>");
                //Response.Write("<script language='javascript'>top.principale.document.location = '../documento/gestionedoc.aspx?tab=profilo' ;</script>");
            }
            if (e.CommandName.Equals("Ripristina"))
            {
                //Il documento ritorna attivo
                this.DGDoc.SelectedIndex = e.Item.ItemIndex;

                //Conferma utente
                string messaggio = InitMessageXml.getInstance().getMessage("RIATTIVA_DOCUMENTO");
                Msg_Ripristina.Confirm(messaggio);
            }
            if (e.CommandName.Equals("Elimina"))
            {
                DGDoc.SelectedIndex = e.Item.ItemIndex;
                //La rimozione dei documenti è un privilegio di solo alcuni utenti...
                //Verifica che l'utente connesso sia abilitato a svuotare i cestini
                if (!UserManager.ruoloIsAutorized(this, "SVUOTA_CESTINO"))
                {
                    Response.Write("<script>alert('Utente non abilitato a questa operazione.')</script>");
                }
                else
                {
                    //Conferma utente
                    string messaggio = InitMessageXml.getInstance().getMessage("ELIMINA_DOCUMENTO");
                    Msg_EliminaDoc.Confirm(messaggio);
                }
            }
            if (e.CommandName.Equals("VisDoc"))
            {
                int key = e.Item.ItemIndex;
                ListaDoc = ((DocsPAWA.DocsPaWR.InfoDocumento[])Session["ListaDocCestino"]);
                DocsPAWA.DocsPaWR.SchedaDocumento schedaSel = new DocsPAWA.DocsPaWR.SchedaDocumento();
                schedaSel = DocumentManager.getDettaglioDocumento(this, this.ListaDoc[key].idProfile, this.ListaDoc[key].docNumber);
                DocumentManager.setDocumentoSelezionato(this, schedaSel);
                FileManager.setSelectedFile(this, schedaSel.documenti[0], false);
                ClientScript.RegisterStartupScript(this.GetType(), "lanciaVIs", "loadvisualizzaDoc('" + Session.SessionID + "','" + this.ListaDoc[key].docNumber + "','" + this.ListaDoc[key].idProfile + "');", true);
            }
        }
Exemple #3
0
        private void EliminaDoc()
        {
            ListaDoc = ((DocsPAWA.DocsPaWR.InfoDocumento[])Session["ListaDocCestino"]);
            DocsPAWA.DocsPaWR.InfoDocumento infoDoc = new DocsPAWA.DocsPaWR.InfoDocumento();
            infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)ListaDoc[DGDoc.SelectedIndex];

            bool result = DocumentManager.EliminaDoc(this, UserManager.getInfoUtente(this), infoDoc);

            if (result)
            {
                BindGrid();
            }
        }
Exemple #4
0
 protected void btn_firmato_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string errorMessage = string.Empty;
         DocsPAWA.DocsPaWR.SchedaDocumento schedaSel = new DocsPAWA.DocsPaWR.SchedaDocumento();
         if (!this.PAGINA_CHIAMANTE.Equals("toDoList"))
         {
             schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);
         }
         else
         {
             string docNumberAppo = this.DOC_NUMBER.Substring(this.DOC_NUMBER.IndexOf(":") + 1);
             string docNumber     = docNumberAppo.Trim();
             schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, docNumber);
         }
         DocsPAWA.DocsPaWR.InfoDocumento infoDoc = DocumentManager.getInfoDocumento(schedaSel);
         if (infoDoc.tipoProto.Equals("R") || infoDoc.tipoProto.Equals("C"))
         {
             this.RegisterClientScript("DocumentoTipoStampaRegistro",
                                       "alert('Tipologia documento non visualizzabile');");
         }
         else
         {
             int retValue = DocumentManager.verificaACL("D", this.ID_PROFILE, UserManager.getInfoUtente(), out errorMessage);
             if (retValue == 0 || retValue == 1)
             {
                 string script = ("<script>alert('" + errorMessage + "');</script>");
                 Response.Write(script);
             }
             else
             {
                 DocumentManager.setRisultatoRicerca(Page, infoDoc);
                 DocumentManager.setDocumentoSelezionato(Page, schedaSel);
                 //FileManager.setSelectedFile(Page, schedaSel.documenti[0]);
                 Page.Session["FileManager.selectedFile"] = schedaSel.documenti[0];
                 if (this.FIRMATO == "1")
                 {
                     Page.ClientScript.RegisterStartupScript(this.GetType(), "firma", "ShowMaskDettagliFirma();", true);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ErrorManager.redirectToErrorPage(Page, ex);
     }
 }
Exemple #5
0
 public DocsPAWA.DocsPaWR.InfoDocumento[] addListaNew(DocsPAWA.DocsPaWR.InfoDocumento[] lista, DocsPAWA.DocsPaWR.InfoDocumento infoDoc)
 {
     DocsPAWA.DocsPaWR.InfoDocumento[] nuovaLista;
     if (lista != null)
     {
         int len = lista.Length;
         nuovaLista = new DocsPAWA.DocsPaWR.InfoDocumento[len + 1];
         lista.CopyTo(nuovaLista, 0);
         nuovaLista[len] = infoDoc;
     }
     else
     {
         nuovaLista    = new DocsPAWA.DocsPaWR.InfoDocumento[1];
         nuovaLista[0] = infoDoc;
     }
     return(nuovaLista);
 }
Exemple #6
0
        private void RiattivaDoc()
        {
            ListaDoc = ((DocsPAWA.DocsPaWR.InfoDocumento[])Session["ListaDocCestino"]);
            DocsPAWA.DocsPaWR.InfoDocumento infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)ListaDoc[DGDoc.SelectedIndex];

            // string DocData = ((Label)this.DGDoc.SelectedItem.Cells[0].Controls[1]).Text;
            // DocData = DocData.Substring(0, DocData.Length - 11);
            bool result = DocumentManager.riattivaDocumento(this, UserManager.getInfoUtente(this), infoDoc);

            if (result)
            {
                BindGrid();
            }
            else
            {
                Response.Write("<script>alert('Attenzione operazione non riuscita');</script>");
            }
        }
Exemple #7
0
        protected void DataGrid_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            int elSelezionato = e.Item.ItemIndex;

            switch (e.CommandName)
            {
            case "Select":
                string idDocOrFasc = DataGrid.Items[elSelezionato].Cells[0].Text;
                string tipo        = DataGrid.Items[elSelezionato].Cells[2].Text;
                //Documenti
                if (tipo == this.arrivo || tipo == this.partenza || tipo == this.interno || tipo == this.grigio)
                {
                    DocsPAWA.DocsPaWR.InfoDocumento infoDoc = DocumentManager.GetInfoDocumento(idDocOrFasc, null, this);
                    DocumentManager.setRisultatoRicerca(this, infoDoc);
                    Session.Remove("listInArea");
                    DocumentManager.removeListaDocProt(this);
                    FascicoliManager.removeFascicoloSelezionatoFascRapida();
                    //Documenti Grigi
                    if (tipo == this.grigio)
                    {
                        Response.Write("<script language='javascript'> top.principale.document.location = '../documento/gestionedoc.aspx?tab=profilo';</script>");
                    }
                    //Protocolli
                    else
                    {
                        Response.Write("<script language='javascript'> top.principale.document.location = '../documento/gestionedoc.aspx?tab=protocollo';</script>");
                    }
                }
                //Fascicoli
                if (tipo == "F")
                {
                    DocsPAWA.DocsPaWR.Fascicolo fasc = FascicoliManager.getFascicoloById(this, idDocOrFasc);
                    FascicoliManager.setFascicoloSelezionato(this, fasc);
                    Response.Write("<script language='javascript'> top.principale.document.location = '../fascicolo/gestioneFasc.aspx?tab=documenti';</script>");
                }

                SetCurrentDocFascIndexOnContext(elSelezionato);
                break;

            case "Page":
                DataGrid.SelectedIndex = -1;
                break;
            }
        }
Exemple #8
0
        public static string refreshPage(DocsPAWA.DocsPaWR.InfoDocumento doc, Page page)
        {
            // Verifica se l'utente ha i diritti per accedere al documento
            string errorMessage = string.Empty;
            string script       = string.Empty;

            int retValue = DocumentManager.verificaACL("D", doc.idProfile, UserManager.getInfoUtente(), out errorMessage);

            if (retValue == 0 || retValue == 1)
            {
                script = "alert('" + errorMessage + "');";
            }
            else
            {
                DocumentManager.setRisultatoRicerca(page, doc);
                script = "top.principale.document.location = 'documento/gestionedoc.aspx?tab=protocollo';";
            }

            return(script);
        }
Exemple #9
0
 private void CreateInfoDocumento(DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento)
 {
     this._infoDocumento = DocsPAWA.DocumentManager.getInfoDocumento(schedaDocumento);
 }
Exemple #10
0
        public void BindGrid()
        {
            DocsPAWA.DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente();

            DocsPaWR.FiltroRicerca[][] filtriRicercaDocumenti = GetFiltriRicercaDocumenti();


            if (filtriRicercaDocumenti == null)
            {
                ListaDoc = DocumentManager.getDocInCestino(this, infoUtente, null);
            }
            else
            {
                ListaDoc = DocumentManager.getDocInCestino(this, infoUtente, filtriRicercaDocumenti);
                if (ListaDoc == null)
                {
                    this.btnFilterDocs.Enabled  = false;
                    this.btnShowAllDocs.Enabled = false;
                }
            }
            Session["ListaDocCestino"] = ListaDoc;



            if (ListaDoc == null || ListaDoc.Length == 0)
            {
                // this.titolo.Text = "Nessun valore trovato";
                this.DGDoc.Visible      = false;
                this.btn_stampa.Visible = false;
                this.btn_svuota.Visible = false;

                numeroDoc = 0;

                //return;
            }
            else
            {
                InfoDoc = new DocsPAWA.DocsPaWR.InfoDocumento();
                Dt_elem = new ArrayList();
                string docData;
                for (int i = 0; i < ListaDoc.Length; i++)
                {
                    InfoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)ListaDoc[i];
                    //il campo mittDest è un array list di possibili mitt/dest lo scorro tutto e concat in una singola string con separatore ="[spazio]-[spazio]"
                    string MittDest = "";
                    int    numProt  = new Int32();
                    if (InfoDoc.mittDest != null && InfoDoc.mittDest.Length > 0)
                    {
                        for (int g = 0; g < InfoDoc.mittDest.Length; g++)
                        {
                            MittDest += InfoDoc.mittDest[g] + " - ";
                        }
                        if (InfoDoc.mittDest.Length > 0)
                        {
                            MittDest = MittDest.Substring(0, MittDest.Length - 3);
                        }
                    }
                    else
                    {
                        MittDest += "";
                    }
                    docData = InfoDoc.docNumber + "\n" + ListaDoc[i].dataApertura;
                    string nuova_etichetta = getEtichetta(InfoDoc.tipoProto);
                    Dt_elem.Add(new Cols(docData, InfoDoc.codRegistro, InfoDoc.oggetto, nuova_etichetta, MittDest, InfoDoc.noteCestino, InfoDoc.autore, InfoDoc.acquisitaImmagine));
                }
                if (ListaDoc.Length > 0)
                {
                    //DocumentManager.setDataGridAllegati(this,Dt_elem);
                    this.DGDoc.DataSource = Dt_elem;
                    this.DGDoc.DataBind();
                }
                this.btn_stampa.Visible     = true;
                this.btnFilterDocs.Visible  = true;
                this.btnShowAllDocs.Enabled = false;
                this.DGDoc.Visible          = true;
                numeroDoc = DGDoc.Items.Count;

                DGDoc.SelectedIndex = -1;
            }

            RefreshCountDocumenti();
        }
Exemple #11
0
        protected void btn_adl_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (btn_adl.CommandName.Equals("inserisciAdl"))
                {
                    DocsPAWA.DocsPaWR.SchedaDocumento schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);

                    //se ho attiva la nuova ADL devo invertire la funzionalità
                    if (Request.QueryString["ricADL"] != string.Empty && Request.QueryString["ricADL"] != null)
                    {
                        DocumentManager.eliminaDaAreaLavoro(Page, schedaSel.systemId, null);
                        //riavvio la ricerca
                        string fromPage = Request.QueryString["from"].ToString();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "LanciaRic", "top.principale.document.location = 'gestioneRicDoc.aspx?tab=" + fromPage + "&ricADL=1&from=" + fromPage + "';", true);
                    }
                    else //normale comportamento
                    {
                        DocumentManager.addAreaLavoro(Page, schedaSel);

                        this.IN_ADL = "1";

                        if (Session["listInArea"] != null)
                        {
                            DocsPAWA.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                            System.Collections.Hashtable    listInArea = (Hashtable)Session["listInArea"];
                            if (listInArea != null && listInArea.ContainsKey(this.DOC_NUMBER) == false)
                            {
                                listInArea.Add(this.DOC_NUMBER, infoDoc);
                            }

                            Session["listInArea"] = listInArea;
                        }
                        else
                        {
                            DocsPAWA.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                            System.Collections.Hashtable    listInArea = new Hashtable();
                            listInArea.Add(infoDoc.numProt + infoDoc.dataApertura, infoDoc);
                            Session["listInArea"] = listInArea;
                        }
                    }
                }//se elimino dall'area di lavoro
                else
                {
                    DocsPAWA.DocsPaWR.SchedaDocumento schedaSel = DocumentManager.getDettaglioDocumento(Page, this.ID_PROFILE, this.DOC_NUMBER);
                    DocumentManager.eliminaDaAreaLavoro(Page, schedaSel.systemId, null);

                    //se ho attiva la nuova ADL devo invertire la funzionalità
                    if (Request.QueryString["ricADL"] != string.Empty && Request.QueryString["ricADL"] != null)
                    {
                        //string fromPage = Request.QueryString["from"].ToString();
                        SiteNavigation.CallContext currentContext = SiteNavigation.CallContextStack.CurrentContext;
                        string fromPage = (string)currentContext.QueryStringParameters["from"];
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "LanciaRic", "top.principale.document.location = 'gestioneRicDoc.aspx?tab=" + fromPage + "&ricADL=1&from=" + fromPage + "';", true);
                    }
                    this.IN_ADL = "0";
                    if (Session["listInArea"] != null)
                    {
                        DocsPAWA.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                        System.Collections.Hashtable    listInArea = (Hashtable)Session["listInArea"];
                        if (listInArea.ContainsKey(this.DOC_NUMBER) == false)
                        {
                            listInArea.Add(this.DOC_NUMBER, infoDoc);
                        }

                        Session["listInArea"] = listInArea;
                    }
                    else
                    {
                        DocsPAWA.DocsPaWR.InfoDocumento infoDoc    = DocumentManager.getInfoDocumento(schedaSel);
                        System.Collections.Hashtable    listInArea = new Hashtable();
                        listInArea.Add(infoDoc.numProt + infoDoc.dataApertura, infoDoc);
                        Session["listInArea"] = listInArea;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager.redirectToErrorPage(Page, ex);
            }
        }