Ejemplo n.º 1
0
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DocsPaWR.Corrispondente[] listaCorrTo = null;
            DocsPaWR.Corrispondente[] listaCorrCC = null;

            if (this.DataGrid1.SelectedIndex >= 0)
            {
                str_indexSel = ((Label)this.DataGrid1.Items[this.DataGrid1.SelectedIndex].Cells[5].Controls[1]).Text;
                int indexSel = Int32.Parse(str_indexSel);
                //this.infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento[]) Session["RicercaProtocolliUscita.ListaInfoDoc"];
                this.infoDoc = RicercaNonProtocollatiSessionMng.GetListaInfoDocumenti(this);

                if (indexSel > -1)
                {
                    infoDocSel = (DocsPAWA.DocsPaWR.InfoDocumento) this.infoDoc[indexSel];
                }

                if (infoDocSel != null)
                {
                    //prendo il dettaglio del documento e estraggo i destinatari del protocollo
                    DocsPaWR.SchedaDocumento schedaDocUscita = new DocsPAWA.DocsPaWR.SchedaDocumento();
                    schedaDocUscita = DocumentManager.getDettaglioDocumento(this, infoDocSel.idProfile, infoDocSel.docNumber);
                    //prendo i destinatari in To
                    listaCorrTo = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocUscita.protocollo).destinatari;
                    //prendo i destinatari in CC
                    listaCorrCC = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocUscita.protocollo).destinatariConoscenza;

                    FillDataGrid(listaCorrTo, listaCorrCC);
                    DocumentManager.setInfoDocumento(this, infoDocSel);
                }
            }
        }
Ejemplo n.º 2
0
        private void CaricaDatagridProt(DataGrid dg, DocsPaWR.InfoDocumento[] listaDoc, string SortType)
        {
            try
            {
                InfoCurr = new DocsPAWA.DocsPaWR.InfoDocumento();
                Rows     = new ArrayList();
                DataView dv;

                if (listaDoc != null)
                {
                    if (listaDoc.Length > 0)
                    {
                        for (int i = 0; i < listaDoc.Length; i++)
                        {
                            InfoCurr = (DocsPAWA.DocsPaWR.InfoDocumento)listaDoc[i];
                            if (InfoCurr != null && (InfoCurr.numProt == null || InfoCurr.numProt.Equals("")))
                            {
                                //Rows.Add(new Row(InfoCurr.numProt,InfoCurr.segnatura,InfoCurr.dataApertura,InfoCurr.codRegistro,InfoCurr.tipoProto,MittDest,InfoCurr.oggetto,i));
                                int docNumber;
                                if (InfoCurr.docNumber == null || InfoCurr.docNumber.Equals(""))
                                {
                                    docNumber = 0;
                                }
                                else
                                {
                                    docNumber = Int32.Parse(InfoCurr.docNumber);
                                }

                                this.dataSetRDocStampeReg1.element1.Addelement1Row(docNumber, InfoCurr.dataApertura, InfoCurr.oggetto, i, InfoCurr.codRegistro);
                            }
                        }
                        datatable            = this.dataSetRDocStampeReg1.Tables[0];
                        dv                   = datatable.DefaultView;    //Celeste
                        dv.Sort              = string.Format("{0} {1}", "numDoc", "DESC");
                        DataGrid1.DataSource = dv;                       //Fine Celeste
                        DataGrid1.DataBind();
                    }


                    else
                    {
                        DataGrid1.Visible = false;
                    }
                }

                else
                {
                    DataGrid1.Visible = false;
                }
            }
            catch (System.Web.Services.Protocols.SoapException es)
            {
                ErrorManager.redirect(this, es);
            }
        }
Ejemplo n.º 3
0
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            string key = ((Label)this.DataGrid1.Items[this.DataGrid1.SelectedIndex].Cells[3].Controls[1]).Text;

            DocsPaWR.InfoDocumento infoDoc = new DocsPAWA.DocsPaWR.InfoDocumento();
            //Celeste
            //infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)ListaDoc[Int32.Parse(key)];
            infoDoc = DocumentManager.getListaDocProt(this)[Int32.Parse(key)];
            //Fine Celeste
            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>");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Reperimento dei documenti per il contesto di paginazione richiesto
        /// </summary>
        /// <param name="filters"></param>
        /// <param name="pagingContext"></param>
        /// <returns></returns>
        public InfoDocumento[] GetDocumenti(FiltroRicerca[] filters, PagingContext pagingContext)
        {
            InfoDocumento[] documenti = null;

            int pageCount;
            int recordCount;

            // Array degli idProfile dei documenti restituiti dalla ricerca
            SearchResultInfo[] idProfilesList = new SearchResultInfo[0];

            DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente();

            DocsPaWebService ws = new DocsPaWebService();

            documenti = ws.DocumentoGetQueryDocumentoPaging(infoUtente.idGruppo,
                                                            infoUtente.idPeople,
                                                            new FiltroRicerca[1][] { filters },
                                                            false,
                                                            false,
                                                            pagingContext.PageNumber,
                                                            true,
                                                            false,
                                                            out pageCount,
                                                            out recordCount,
                                                            out idProfilesList);

            if (documenti == null)
            {
                documenti = new DocsPAWA.DocsPaWR.InfoDocumento[0];
            }

            pagingContext.PageCount   = pageCount;
            pagingContext.RecordCount = recordCount;

            if (idProfilesList != null)
            {
                // Salavtaggio della lista di idProfile dei documenti individuati
                pagingContext.IdProfilesList = new string[idProfilesList.Length];
                for (int i = 0; i < idProfilesList.Length; i++)
                {
                    pagingContext.IdProfilesList[i] = idProfilesList[i].Id;
                }
            }

            return(documenti);
        }
Ejemplo n.º 5
0
        private string GestioneAvvisoModale(string valore)
        {
            string retValue = string.Empty;

            try
            {
                //prendo il documento in sessione
                schedaDocInLavorazione = DocumentManager.getDocumentoInLavorazione(this);

                //prendo il protocollo in uscita selezionato dal datagrid
                infoDocSel = DocumentManager.getInfoDocumento(this);

                retValue = valore;

                switch (valore)
                {
                case "Y":     //Gestione pulsante SI, CONTINUA

                    /* Alla pressione del pulsante CONTINUA l'utente vuole proseguire il
                     * collegamento nonostante oggetto sia diverso */

                    if (schedaDocInLavorazione != null)
                    {
                        if (infoDocSel != null)
                        {
                            schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                            schedaDocInLavorazione.modificaRispostaDocumento = true;
                        }

                        this.hd_returnValueModal.Value = "";

                        //if (((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente == null)
                        //{
                        //   if (RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this) != null)
                        //   {
                        //      ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente = RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this);
                        //   }
                        //}
                        DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                        DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);
                        //metto in sessione la scheda documento con le informazioni del protocollo a cui risponde

                        Page.RegisterStartupScript("", "<script>window.close();</script>");
                    }

                    break;

                case "N":

                    /* Alla pressione del pulsante NO, RESETTA l'utente vuole proseguire il collegamento
                     * con i dati che ha digitato sulla pagina di protocollo */


                    if (schedaDocInLavorazione != null)
                    {
                        if (infoDocSel != null)
                        {
                            schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                            schedaDocInLavorazione.modificaRispostaDocumento = true;
                        }

                        if (schedaDocInLavorazione.oggetto != null)
                        {
                            schedaDocInLavorazione.oggetto.descrizione = infoDocSel.oggetto.ToString();
                        }
                        else
                        {
                            DocsPaWR.Oggetto ogg = new DocsPAWA.DocsPaWR.Oggetto();
                            ogg.descrizione = infoDocSel.oggetto.ToString();
                            schedaDocInLavorazione.oggetto = ogg;
                        }

                        //if (RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this) != null)
                        //{
                        //   ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente = RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this);
                        //}

                        //	popolo il campo mittente con il destinatario selezionato dal protocollo a cui ri risponde
                        //((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente = destSelected;

                        //metto in sessione la scheda documento con le informazioni del protocollo a cui risponde
                        DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                        DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);
                        Page.RegisterStartupScript("", "<script>window.close();</script>");

                        this.hd_returnValueModal.Value = "";
                    }

                    break;

                case "S":
                    //non posso modificare il mittente o oggetto, quindi il pulsante continua
                    //si limiterà a popolare il campo risposta al protocollo con l'infoDoc corrente
                    if (schedaDocInLavorazione != null)
                    {
                        if (infoDocSel != null)
                        {
                            schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                            schedaDocInLavorazione.modificaRispostaDocumento = true;
                        }
                    }
                    DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                    DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);
                    Page.RegisterStartupScript("", "<script>window.close();</script>");

                    break;
                }
            }
            catch
            {
            }

            return(retValue);
        }
Ejemplo n.º 6
0
        private void btn_ok_Click(object sender, System.EventArgs e)
        {
            int    itemIndex;
            bool   oggettoOK     = false;
            string oggettoDocSel = "";
            bool   avanzaDoc     = verificaSelezioneDocumento(out itemIndex);

            if (avanzaDoc)
            {
                this.infoDoc = RicercaNonProtocollatiSessionMng.GetListaInfoDocumenti(this);

                if (itemIndex > -1)
                {
                    infoDocSel    = (DocsPAWA.DocsPaWR.InfoDocumento) this.infoDoc[itemIndex];
                    oggettoDocSel = ((Label)DataGrid1.Items[itemIndex].Cells[3].Controls[1]).Text;
                    DocumentManager.setInfoDocumento(this, infoDocSel);
                }

                schedaDocInLavorazione = DocumentManager.getDocumentoInLavorazione(this);
                if (schedaDocInLavorazione != null)
                {
                    //if (schedaDocInLavorazione.docNumber != null)
                    //{
                    //CASO DOC GRIGIO CREATO

                    //inizio verifica congruenza campo oggetto
                    if (schedaDocInLavorazione.oggetto != null && schedaDocInLavorazione.oggetto.descrizione != null && schedaDocInLavorazione.oggetto.descrizione != String.Empty)
                    {
                        if (oggettoDocSel != null && oggettoDocSel != String.Empty)
                        {
                            if (schedaDocInLavorazione.oggetto.descrizione.ToUpper().Equals(oggettoDocSel.ToUpper()))
                            {
                                oggettoOK = true;
                            }
                        }
                    }
                    else
                    {
                        oggettoOK = true;
                        if (oggettoDocSel != null && oggettoDocSel != String.Empty)
                        {
                            DocsPaWR.Oggetto ogg = new DocsPAWA.DocsPaWR.Oggetto();
                            ogg.descrizione = oggettoDocSel.ToString();
                            schedaDocInLavorazione.oggetto = ogg;
                        }
                    }

                    if (!oggettoOK)
                    {
                        //se oggetto non coincide si lancia un avviso	all'utente
                        if (!this.Page.IsStartupScriptRegistered("avvisoModale"))
                        {
                            string scriptString = "";
                            if (schedaDocInLavorazione.docNumber != null)
                            {
                                scriptString = "<SCRIPT>OpenAvvisoModale( '" + oggettoOK + "' , 'True');</SCRIPT>";
                            }
                            else
                            {
                                scriptString = "<SCRIPT>OpenAvvisoModale( '" + oggettoOK + "' , 'False');</SCRIPT>";
                            }
                            this.Page.RegisterStartupScript("avvisoModale", scriptString);
                        }
                    }
                    else
                    {
                        schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                        schedaDocInLavorazione.modificaRispostaDocumento = true;

                        DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                        DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);

                        RicercaNonProtocollatiSessionMng.SetDialogReturnValue(this, true);

                        Page.RegisterStartupScript("", "<script>window.close();</script>");
                    }
                }
                //}
            }
        }
Ejemplo n.º 7
0
        private void DataGrid1_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            if (e.CommandName == "delete")
            {
                getParametersFromQueryString();
                DocsPaWR.InfoDocumento infoDocSel;
                if (e.Item.ItemIndex >= 0)
                {
                    string str_indexSel = ((Label)this.DataGrid1.Items[e.Item.ItemIndex].Cells[6].Controls[1]).Text;
                    int    indexSel     = Int32.Parse(str_indexSel);
                    this.infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento[])Session["listaDocInRisp.infoDoc"];

                    if (indexSel > -1)
                    {
                        infoDocSel = (DocsPAWA.DocsPaWR.InfoDocumento) this.infoDoc[indexSel];
                    }
                    else
                    {
                        infoDocSel = null;
                        return;
                    }

                    //Scollego i documenti
                    bool retValue = DocumentManager.scollegaDocumento(this, infoDocSel.idProfile);

                    if (retValue)
                    {
                        if (currentPage > 1 && this.DataGrid1.Items.Count == 1)
                        {
                            currentPage = currentPage - 1;
                        }

                        DocsPaWR.InfoDocumento[] newListInfoDocumenti = new DocsPAWA.DocsPaWR.InfoDocumento[this.infoDoc.Length - 1];

                        if (newListInfoDocumenti.Length == 0)
                        {
                            this.LoadData(true);
                        }
                        else
                        {
                            int index = 0;

                            foreach (DocsPAWA.DocsPaWR.InfoDocumento infoDocumento in this.infoDoc)
                            {
                                if (infoDocumento.idProfile != infoDocSel.idProfile)
                                {
                                    newListInfoDocumenti[index] = infoDocumento;
                                    index++;
                                }
                            }

                            this.infoDoc = newListInfoDocumenti;
                            Session["listaDocInRisp.infoDoc"] = this.infoDoc;

                            this.BindGrid(this.infoDoc);
                        }

                        this.DataGrid1.SelectedIndex = -1;
                    }
                }
                else
                {
                    Response.Write("<script>alert('Attenzione: selezionare un documento!');</script>");
                }
            }
        }