Exemplo n.º 1
0
        protected void btn_ok_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(txt_note_annullamento.Text) && !String.IsNullOrEmpty(idOggetto))
            {
                //Annullamento
                ProfilazioneDocManager.AnnullaContatoreDiRepertorio(idOggetto, docNumber, this);

                DocsPaWR.SchedaDocumento documentoSelezionato = DocumentManager.getDocumentoSelezionato(this);
                documentoSelezionato.template = ProfilazioneDocManager.getTemplateDettagli(docNumber, this);
                DocumentManager.setDocumentoSelezionato(documentoSelezionato);

                //Storicizzazione
                DocsPaWR.OggettoCustom   oggettoCustom = documentoSelezionato.template.ELENCO_OGGETTI.Where(oggetto => oggetto.SYSTEM_ID.ToString().Equals(idOggetto)).FirstOrDefault();
                DocsPaWR.Storicizzazione storico       = new DocsPaWR.Storicizzazione();
                storico.ID_TEMPLATE    = documentoSelezionato.template.SYSTEM_ID.ToString();
                storico.DATA_MODIFICA  = oggettoCustom.DATA_ANNULLAMENTO;
                storico.ID_PROFILE     = documentoSelezionato.docNumber;
                storico.ID_OGG_CUSTOM  = oggettoCustom.SYSTEM_ID.ToString();
                storico.ID_PEOPLE      = UserManager.getInfoUtente(this).idPeople;
                storico.ID_RUOLO_IN_UO = UserManager.getInfoUtente(this).idCorrGlobali;
                storico.DESC_MODIFICA  = txt_note_annullamento.Text.Replace("'", "''");

                ProfilazioneDocManager.Storicizza(storico, this);

                ClientScript.RegisterStartupScript(this.GetType(), "close", "window.close();", true);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('La motivazione è obbligatoria.');", true);
            }
        }
Exemplo n.º 2
0
        /// </summary>
        /// <remarks>
        /// Qualora sia attivata la gestione degli allegati profilati, la scheda documento sarà relativa
        /// all'allegato correntemente selezionato da tab allegati
        /// </remarks>
        public static void RefreshCheckOutStatus()
        {
            DocsPaWR.SchedaDocumento schedaDocumento = null;
            DocsPaWR.FileRequest     fileRequest     = FileManager.getSelectedFile();
            if (fileRequest != null)
            {
                if (fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    // Tab "allegati" correntemente selezionato,
                    // reperimento dello stato checkout dell'allegato selezionato.
                    // Solo se attiva la profilazione allegati.
                    if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                    {
                        schedaDocumento = DocumentManager.getDocumentDetails(null, fileRequest.docNumber, fileRequest.docNumber);
                    }
                }
                else
                {
                    schedaDocumento = DocumentManager.getSelectedRecord();
                }

                if (schedaDocumento != null)
                {
                    //Inizializzazione del contesto di checkout del documento
                    CheckInOut.CheckOutContext.Current = new CheckInOut.CheckOutContext(schedaDocumento);
                }
                else
                {
                    CheckInOut.CheckOutContext.Current = null;
                }
            }
        }
Exemplo n.º 3
0
        private void getDatiSpedizioni()
        {
            //carica_Info
            schedaDocumento = DocumentManager.getDocumentoInLavorazione(this);

            if (schedaDocumento == null || schedaDocumento.systemId.Equals(""))
            {
                this.lbl_message.Text    = "Problemi nel reperimento delle spedizioni";
                this.lbl_message.Visible = true;
                return;
            }

            //prende tutti le spedizioni
            DocsPaWR.StatoInvio[] listaSpedizioni;
            listaSpedizioni = DocumentManager.getListaSpedizioni(this, schedaDocumento.systemId);
            Dg_elem         = new ArrayList();
            if (listaSpedizioni != null && listaSpedizioni.Length > 0)
            {
                for (int i = 0; i < listaSpedizioni.Length; i++)
                {
                    BindGrid(listaSpedizioni[i]);
                }
                if (Dg_elem.Count > 0)
                {
                    this.DataGrid1.DataSource = Dg_elem;
                    this.DataGrid1.DataBind();
                }
            }
        }
Exemplo n.º 4
0
        protected void SelectKeywordBtnOk_Click(object sender, EventArgs e)
        {
            try {
                DocsPaWR.DocumentoParolaChiave[] listaDocParoleChiave = new DocsPaWR.DocumentoParolaChiave[0];;

                for (int i = 0; i < this.ListParoleChiave.Items.Count; i++)
                {
                    if (this.ListParoleChiave.Items[i].Selected)
                    {
                        DocsPaWR.DocumentoParolaChiave docParoleChiave = new DocsPaWR.DocumentoParolaChiave();
                        docParoleChiave.systemId          = this.ListParoleChiave.Items[i].Value;
                        docParoleChiave.descrizione       = this.ListParoleChiave.Items[i].Text;
                        docParoleChiave.idAmministrazione = UserManager.GetInfoUser().idAmministrazione;
                        listaDocParoleChiave = utils.addToArrayParoleChiave(listaDocParoleChiave, docParoleChiave);
                    }
                }

                DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getSelectedRecord();
                if (schedaDocumento != null)
                {
                    schedaDocumento.paroleChiave             = addParoleChiaveToDoc(schedaDocumento, listaDocParoleChiave);
                    schedaDocumento.daAggiornareParoleChiave = true;
                }

                Session["ReturnValuePopup"] = listaDocParoleChiave;

                DocumentManager.setSelectedRecord(schedaDocumento);
                ScriptManager.RegisterStartupScript(this, this.GetType(), "SelectKeyword", "parent.closeAjaxModal('SelectKeyword', 'up', parent);", true);
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ViewState["lista"] = null;
                    if (Request.QueryString["IdDoc"] != null)
                    {
                        string IdDoc = Request.QueryString["IdDoc"].ToString();

                        DocsPaWR.SchedaDocumento sd = DocumentManager.getDettaglioDocumento(this, IdDoc, null);


                        bindGrid(IdDoc);
                        lblmodDoc.Text = "Selezionare i Ruoli per cui si desidera sbloccare il documento " + IdDoc + " e cliccare su Conferma";
                    }
                }
            }

            catch (Exception ex)
            {
                ErrorManager.redirectToErrorPage(this, ex);
            }
        }
Exemplo n.º 6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Response.Expires = -1;

            if (!this.IsPostBack)
            {
                this.btn_annulla.Attributes["onClick"] = "ClosePage(false);";

                DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoSelezionato(this);

                string ownerUser;

                // Verifica se il documento è in stato checkout
                if (CheckInOutServices.IsCheckedOutDocumentWithUser(out ownerUser))
                {
                    bool isOwnerCheckedOut = (ownerUser.ToUpper() == UserManager.getInfoUtente().userId.ToUpper());

                    this.lbl_messageOwnerCheckOut.Visible = isOwnerCheckedOut;
                    this.lbl_messageCheckOut.Visible      = !isOwnerCheckedOut;
                    this.lbl_message.Visible = false;
                    this.btn_ok.Visible      = isOwnerCheckedOut;

                    if (isOwnerCheckedOut)
                    {
                        this.btn_ok.Attributes.Add("onClick", "RemoveCheckOutVersion();");
                    }
                }
                else
                {
                    this.lbl_messageOwnerCheckOut.Visible = false;
                    this.lbl_messageCheckOut.Visible      = false;
                    this.lbl_message.Visible = true;
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Reperimento delle informazioni di stato checkout del documento
        /// </summary>
        /// <returns></returns>
        public static CheckOutStatus GetCheckOutDocumentStatus()
        {
            DocsPaWR.SchedaDocumento schedaDocumento = null;

            if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato
                DocsPaWR.FileRequest fileRequest = FileManager.getSelectedFile();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    SiteNavigation.CallContext context = SiteNavigation.CallContextStack.CurrentContext;

                    schedaDocumento = context.ContextState["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;
                }
            }
            else
            {
                // Qualsiasi altro tab differente dal tab "allegati",
                // reperimento dello stato checkout del documento principale
                schedaDocumento = CheckInOutServices.CurrentSchedaDocumento;
            }

            if (schedaDocumento != null)
            {
                return(schedaDocumento.checkOutStatus);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 8
0
        public void ProcessRequest()
        {
            // Ottieni istanza MTEXT
            MTextModelProvider mtext = ModelProviderFactory <MTextModelProvider> .GetInstance();

            // Carica scheda documento
            DocsPaWR.SchedaDocumento schedaDocumentoSelezionata = CheckInOut.CheckInOutServices.CurrentSchedaDocumento;

            // Carica modello
            String databinding = schedaDocumentoSelezionata.template.PATH_MODELLO_1;

            // Elabora FQN
            String fqn = MTextUtils.Id2FullQualifiedName(documentNumber);

            // Crea documento
            try
            {
                fqn = mtext.CreateDocument(fqn, MTextUtils.CustomObject2Dictionary(schedaDocumentoSelezionata.template), databinding);
            }
            catch (Exception e)
            {
                Response.StatusCode = 500;
                this.WriteResponse(fqn, e.Message);
                return;
            }

            // Ottieni URL per EDIT
            String url = mtext.GetDocumentEditUrl(fqn);

            // Restituisci stringa fqn|editURL
            this.WriteResponse(fqn, url);
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Expires = -1;
            DocsPaWR.FileDocumento theDoc = null;
            string PosLabelPdf            = null;

            DocsPaWR.labelPdf label = new DocsPAWA.DocsPaWR.labelPdf();
            bool   tipo             = false;
            string rotazione        = null;
            string orientamento     = null;
            string carattere        = string.Empty;
            string colore           = string.Empty;

            DocsPaWR.SchedaDocumento schedaCorrente = DocumentManager.getDocumentoSelezionato(Page);

            DocsPaVO.documento.FileRequest fr = new DocsPaVO.documento.FileRequest();

            if (this.Session["personalize"] != null)
            {
                PosLabelPdf = this.Session["personalize"].ToString();
            }
            if (Session["tipoLabel"] != null)
            {
                tipo = System.Convert.ToBoolean(Session["tipoLabel"].ToString());
            }
            if (Session["rotazione"] != null)
            {
                rotazione = Session["rotazione"].ToString();
            }
            if (Session["carattere"] != null)
            {
                carattere = Session["carattere"].ToString();
            }
            if (Session["colore"] != null)
            {
                colore = Session["colore"].ToString();
            }
            if (Session["orientamento"] != null)
            {
                orientamento = Session["orientamento"].ToString();
            }
            //carico i dati dentro l'oggetto Label
            label.position       = PosLabelPdf;
            label.tipoLabel      = tipo;
            label.label_rotation = rotazione;
            label.sel_font       = carattere;
            label.sel_color      = colore;
            label.orientamento   = orientamento;
            theDoc = FileManager.getInstance(Session.SessionID).getVoidFileConSegnatura(fr, schedaCorrente, label, this);

            //aggiungo in session le info relative alle label
            Session.Add("labelProperties", theDoc.LabelPdf);
            if (theDoc != null)
            {
                Response.ContentType = theDoc.contentType;
                Response.AddHeader("content-disposition", "inline;filename=" + theDoc.name);
                Response.AddHeader("content-length", theDoc.content.Length.ToString());
                Response.BinaryWrite(theDoc.content);
            }
        }
Exemplo n.º 10
0
        private void btn_ok_Click(object sender, System.EventArgs e)
        {
            try
            {
                int indexSel = Int32.Parse(Request.QueryString["versioneSelezionata"]);

                if (indexSel >= 0)
                {
                    DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoSelezionato(this);

                    //if(schedaDocumento.documenti[indexSel].version!="1")
                    if (schedaDocumento.documenti.Length > 1 && indexSel != 0)
                    {
                        if (DocumentManager.rimuoviVersione(this, schedaDocumento.documenti[indexSel], schedaDocumento))
                        {
                            schedaDocumento.documenti = DocumentManager.rimuoviDaListaVersioni(schedaDocumento.documenti, indexSel);
                            DocumentManager.setDocumentoSelezionato(this, schedaDocumento);

                            //pulisco anche la parte di destra
                            FileManager.removeSelectedFile(this);
                        }
                    }
                }

                this.RegisterClientScript("ClosePage", "ClosePage(true);");
            }
            catch (Exception ex)
            {
                ErrorManager.redirect(this, ex);
            }
        }
Exemplo n.º 11
0
        private void Page_PreRender(object sender, System.EventArgs e)
        {
            DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoSelezionato();

            //Protocollo Titolario
            string protoTit       = wws.isEnableProtocolloTitolario();
            string protoTitolario = String.Empty;

            if (!String.IsNullOrEmpty(schedaDocumento.systemId))
            {
                protoTitolario = wws.getProtocolloTitolario(DocumentManager.getDocumentoSelezionato(this.Page));
            }

            if (!string.IsNullOrEmpty(protoTitolario))
            {
                pnl_protoTitolario.Visible   = true;
                lbl_titleProtoTitolario.Text = protoTit + " : ";
                lbl_protoTitolario.Text      = protoTitolario;
            }
            else
            {
                pnl_protoTitolario.Visible = false;
                lbl_protoTitolario.Text    = "";
            }

            this.trStatoConsolidamento.Visible = (schedaDocumento != null &&
                                                  schedaDocumento.ConsolidationState != null &&
                                                  schedaDocumento.ConsolidationState.State > DocsPaWR.DocumentConsolidationStateEnum.None);
        }
        protected void VisibilitaDocsStatoFinale_PreRender(object sender, EventArgs e)
        {
            if (Request.QueryString["IdDoc"] != null)
            {
                string IdDoc = Request.QueryString["IdDoc"].ToString();

                DocsPaWR.SchedaDocumento sd = this.getDettaglioDocumento(IdDoc, null);
                if (sd.ConsolidationState.State != DocumentConsolidationStateEnum.None)
                //if (sd.ConsolidationState.State.Equals("1") || sd.ConsolidationState.State.Equals("2"))
                {
                    foreach (DataGridItem item in dg_Visibilita.Items)
                    {
                        if (item.ItemType == ListItemType.Item ||
                            item.ItemType == ListItemType.AlternatingItem)
                        {
                            CheckBox cb_Abilita = (CheckBox)item.FindControl("cb_Abilita");
                            if (cb_Abilita.Checked)
                            {
                                cb_Abilita.Enabled = true;
                            }
                            else
                            {
                                cb_Abilita.Enabled = false;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Reperimento delle informazioni di stato checkout del documento
        /// </summary>
        /// <returns></returns>
        public static CheckOutStatus GetCheckOutDocumentStatus()
        {
            DocsPaWR.SchedaDocumento schedaDocumento = null;

            if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato
                DocsPaWR.FileRequest fileRequest = (UIManager.DocumentManager.getSelectedAttachId() != null) ?
                                                   UIManager.FileManager.GetFileRequest(UIManager.DocumentManager.getSelectedAttachId()) :
                                                   UIManager.FileManager.GetFileRequest();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    schedaDocumento = System.Web.HttpContext.Current.Session["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;
                }
            }
            else
            {
                // Qualsiasi altro tab differente dal tab "allegati",
                // reperimento dello stato checkout del documento principale
                schedaDocumento = CheckInOutServices.CurrentSchedaDocumento;
            }

            if (schedaDocumento != null)
            {
                return(schedaDocumento.checkOutStatus);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Reperimento allegato selezionato per la modifica dei dati
        /// </summary>
        /// <returns></returns>
        protected DocsPaWR.Allegato GetSelectedAllegato()
        {
            DocsPaWR.Allegato retValue = null;

            string versionId = this.VersionId;

            if (!string.IsNullOrEmpty(versionId))
            {
                DocsPaWR.SchedaDocumento schedaDocumento = this.GetSchedaDocumento();

                if (schedaDocumento != null)
                {
                    foreach (DocsPaWR.Allegato allegato in schedaDocumento.allegati)
                    {
                        if (allegato.versionId.Equals(versionId))
                        {
                            retValue = allegato;
                            break;
                        }
                    }
                }
            }

            return(retValue);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Navigazione verso il dettaglio del documento allegato
        /// </summary>
        protected virtual void NavigateDocument()
        {
            DocsPaWR.Allegato allegato = this.GetSelectedAllegato();

            if (allegato != null)
            {
                DocsPaWR.SchedaDocumento schedaDocumentoAllegato = null;

                if (this.DocumentoInCestino)
                {
                    schedaDocumentoAllegato = DocumentManager.getDettaglioDocumentoDaCestino(this, allegato.docNumber, allegato.docNumber);
                }
                else
                {
                    schedaDocumentoAllegato = DocumentManager.getDettaglioDocumento(this, allegato.docNumber, allegato.docNumber);
                }

                if (schedaDocumentoAllegato != null)
                {
                    DocumentManager.setDocumentoSelezionato(this, schedaDocumentoAllegato);

                    // Impostazione del versionId dell'allegato selezionato nel contesto corrente
                    this.SetCurrentIdOnContext(allegato.versionId);

                    // Navigazione verso il documento allegato,
                    // indicando di forzare la crezione di un nuovo contesto e
                    // se il documento è stato inserito in cestino
                    string url = string.Format("<script>window.open('gestioneDoc.aspx?tab=profilo&allegato=true&forceNewContext=true&daCestino={0}','principale');</script>", schedaDocumentoAllegato.inCestino);
                    this.Response.Write(url);
                }
            }
        }
Exemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.Response.Expires = -1;

            // Reperimento documento selezionato
            this._schedaDocumento = DocumentManager.getDocumentoSelezionato(this);

            if (!this.IsPostBack)
            {
                this.btn_ok.Attributes.Add("onclick", "window.document.body.style.cursor = 'wait'");
                this.btn_annulla.Attributes.Add("onclick", "CloseMask(false);");

                bool canRemove = true;

                string message = string.Empty;

                canRemove = !this.IsAclRevocata(out message);

                if (canRemove)
                {
                    canRemove = !this.IsCheckedOutDocument(out message);
                }

                if (canRemove)
                {
                    message = MSG_CONFERMA_RIMUOVI;
                }

                this.btn_ok.Enabled   = canRemove;
                this.lbl_message.Text = message;
            }
        }
Exemplo n.º 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="infoSpedizione"></param>
        protected virtual void Spedisci(DocsPaWR.SpedizioneDocumento infoSpedizione)
        {
            // Spedizione del documento ai destinatari selezionati
            DocsPaWR.SchedaDocumento scheda = DocumentManager.getDocumentoSelezionato();


            //filtro dagli allegati da spedire quelli associati a notifiche di tipo PEC
            List <DocsPaWR.Allegato> listAllegati = new List <DocsPaWR.Allegato>();

            if (scheda.allegati != null && scheda.allegati.Length > 0)
            {
                foreach (DocsPaWR.Allegato a in scheda.allegati)
                {
                    if (a.versionId != null)
                    {
                        if (!DocumentManager.AllegatoIsPEC(a.versionId).Equals("1"))
                        {
                            listAllegati.Add(a);
                        }
                    }
                }
                scheda.allegati = listAllegati.ToArray();
            }

            infoSpedizione = SpedizioneManager.SpedisciDocumento(scheda, infoSpedizione);

            //Andrea
            foreach (string s in infoSpedizione.listaDestinatariNonRaggiungibili)
            {
                messError = messError + s + "\\n";
            }
            if (infoSpedizione != null && infoSpedizione.listaDestinatariNonRaggiungibili != null)
            {
                infoSpedizione.listaDestinatariNonRaggiungibili = null;
            }

            if (messError != "")
            {
                Session.Add("MessError", messError);
            }
            //End Andrea

            // Impostazione dei dati di spedizione
            this.SetSpedizioneDocumento(infoSpedizione);

            this.FetchData(infoSpedizione);

            if (scheda.tipoProto.ToUpper().Equals("I"))
            {
                this.SetStatoSpedizioneTrasmissione(infoSpedizione);
            }
            else
            {
                // Impostazione dello stato della spedizione
                this.SetStatoSpedizione(infoSpedizione);
            }

            this.SetReturnValue(true);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Determina se il corrispondente è tra i destinatari principali del documento
        /// </summary>
        /// <param name="corrispondente"></param>
        /// <returns></returns>
        private bool IsDestinatarioPrincipale(DocsPaWR.Corrispondente corrispondente)
        {
            DocsPaWR.SchedaDocumento documento = DocumentManager.getSelectedRecord();

            DocsPaWR.ProtocolloUscita protocolloUscita = (DocsPaWR.ProtocolloUscita)documento.protocollo;

            return(protocolloUscita.destinatari.Count(e => e.systemId == corrispondente.systemId) > 0);
        }
Exemplo n.º 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="infoSpedizione"></param>
        protected void Spedisci(DocsPaWR.SpedizioneDocumento infoSpedizione)
        {
            // Spedizione del documento ai destinatari selezionati
            DocsPaWR.SchedaDocumento scheda = DocumentManager.getSelectedRecord();


            //filtro dagli allegati da spedire quelli associati a notifiche di tipo PEC
            List <DocsPaWR.Allegato> listAllegati = new List <DocsPaWR.Allegato>();

            if (scheda.allegati != null && scheda.allegati.Length > 0)
            {
                foreach (DocsPaWR.Allegato a in scheda.allegati)
                {
                    if (a.versionId != null)
                    {
                        if (!DocumentManager.AllegatoIsPEC(a.versionId).Equals("1"))
                        {
                            listAllegati.Add(a);
                        }
                    }
                }
                scheda.allegati = listAllegati.ToArray();
            }
            if (scheda.spedizioneDocumento != null)
            {
                scheda.spedizioneDocumento.tipoMessaggio = infoSpedizione.tipoMessaggio;
            }
            else
            {
                scheda.spedizioneDocumento = infoSpedizione;
            }
            infoSpedizione = SenderManager.SpedisciDocumento(scheda, infoSpedizione);

            //Andrea
            foreach (string s in infoSpedizione.listaDestinatariNonRaggiungibili)
            {
                messError = messError + s + Environment.NewLine;
            }
            if (infoSpedizione != null && infoSpedizione.listaDestinatariNonRaggiungibili != null)
            {
                infoSpedizione.listaDestinatariNonRaggiungibili = null;
            }

            if (messError != "")
            {
                Session.Add("MessError", messError);
            }
            //End Andrea

            // Impostazione dei dati di spedizione
            this.SetSpedizioneDocumento(infoSpedizione);

            this.FetchData(infoSpedizione);

            this.SetReturnValue(true);

            InitializesForm(infoSpedizione, scheda.tipoProto);
        }
Exemplo n.º 20
0
        //Non dovrebbe serivre più... perchè per ora sono stati commentati i pulsanti dal datagrid
        private void dgDoc_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            // visualizza doc in popup
            if (e.CommandName.Equals("VisDoc"))
            {
                //vis unificata
                string docNumber = ((Label)this.dgDoc.Items[e.Item.ItemIndex].Cells[12].Controls[1]).Text;
                string idProfile = ((Label)this.dgDoc.Items[e.Item.ItemIndex].Cells[11].Controls[1]).Text;

                DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDettaglioDocumento(this, idProfile, docNumber);
                if (schedaDoc.documenti[0].fileSize != "" && schedaDoc.documenti[0].fileSize != "0")
                {
                    DocumentManager.setDocumentoSelezionato(this, schedaDoc);
                    FileManager.setSelectedFile(this, schedaDoc.documenti[0], false);
                    ClientScript.RegisterStartupScript(this.GetType(), "lanciaVIs", "loadvisualizzaDoc('" + Session.SessionID + "','" + docNumber + "','" + idProfile + "');", true);
                }
            }
            if (e.CommandName.Equals("InArchivio"))
            {
                string script = "<script>if(window.parent.parent.document.getElementById ('please_wait_archivio')!=null)";
                script += "{";
                script += "		window.parent.parent.document.getElementById ('please_wait_archivio').style.display = 'none'";
                script += "} </script>";
                Response.Write(script);

                string tipoOperazione = "";
                if (UserManager.ruoloIsAutorized(this, "DO_ARCHIVIA"))
                {
                    tipoOperazione = "IN_DEPOSITO";
                }
                else
                {
                    tipoOperazione = "IN_CORRENTE";
                }


                //Fascicoli generali
                string idProfile = ((Label)this.dgDoc.Items[e.Item.ItemIndex].Cells[11].Controls[1]).Text;
                if (ViewState["scelta"].ToString() == "F")
                {
                    if (DocumentManager.trasfInDepositoDocumento(this, idProfile, UserManager.getInfoUtente(), false, tipoOperazione) != "-1")
                    {
                        this.dgDoc.CurrentPageIndex = 0;
                        this.FillData(this.dgDoc.CurrentPageIndex + 1);
                    }
                }
                //caso serie di documenti repertoriati
                else if (ViewState["scelta"].ToString() == "S")
                {
                    if (DocumentManager.trasfInDepositoDocumento(this, idProfile, UserManager.getInfoUtente(), true, tipoOperazione) != "-1")
                    {
                        this.dgDoc.CurrentPageIndex = 0;
                        this.FillData(this.dgDoc.CurrentPageIndex + 1);
                    }
                }
            }
        }
Exemplo n.º 21
0
        private void setCorrispondentiProtocollo()
        {
            DocsPaWR.Corrispondente corr;
            if (target == null)
            {
                return;
            }
            //gestione documento
            //DocsPaWR.SchedaDocumento schedaDoc = (DocsPAWA.DocsPaWR.SchedaDocumento)Session["docProtocollo.schedaDocumento"];
            DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoInLavorazione(this);

            //controlla i corrispondenti selezionati, li mette in una hashTable e poi carica la pagina
            if (target.Equals("dest"))
            {
                // Protocollo in uscita
                for (int i = 0; i < this.tbl_Corr.Rows.Count; i++)
                {
                    CheckBox AppoChk = (CheckBox)this.tbl_Corr.Rows[i].Cells[0].Controls[0];
                    if (AppoChk.Checked)
                    {
                        corr      = (DocsPAWA.DocsPaWR.Corrispondente)listaCorr[i];
                        schedaDoc = addDestinatari(schedaDoc, corr);

                        ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo).daAggiornareDestinatari = true;
                    }
                }
            }
            else if (target.Equals("mitt") || target.Equals("mittInt"))
            {
                // Protocollo in entrata
                int selIndex = rb_Corr.SelectedIndex;
                if (selIndex > -1)
                {
                    corr = listaCorr[selIndex];
                }
                else
                {
                    corr = null;
                }
                if (target.Equals("mitt"))
                {
                    ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittente             = corr;
                    ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).daAggiornareMittente = true;
                }
                else
                {
                    ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittenteIntermedio = corr;

                    ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).daAggiornareMittenteIntermedio = true;
                }
            }

            //Session["docProtocollo.schedaDocumento"] = schedaDoc;
            DocumentManager.setDocumentoInLavorazione(this, schedaDoc);
            Session.Remove("rubrica.listaCorr");
            Response.Write("<script>var k=window.open('../documento/docProtocollo.aspx','IframeTabs'); window.close();</script>");
        }
Exemplo n.º 22
0
 private void dettaglioDocumento(string idProfile, string docNumber, string newUrl)
 {
     DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDettaglioDocumento(this, idProfile, docNumber);
     if (schedaDoc != null)
     {
         DocumentManager.setDocumentoSelezionato(this, schedaDoc);
         Response.Write("<script>window.open('" + newUrl + "','principale');</script>");
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// Handler evento "RestoreContextState" per il ripristino
        /// manuale della scheda documento mediante il metodo "DocumentManager.setDocumentoSelezionato"
        /// </summary>
        /// <param name="e"></param>
        private static void OnRestoreContextState(SiteNavigation.RestoreContextEventArgs e)
        {
            if (e.SessionState.Contains("gestioneDoc.schedaDocumento"))
            {
                DocsPaWR.SchedaDocumento schedaDoc = (DocsPAWA.DocsPaWR.SchedaDocumento)e.SessionState["gestioneDoc.schedaDocumento"];

                DocumentManager.setDocumentoSelezionato(schedaDoc);
                DocumentManager.setDocumentoInLavorazione(schedaDoc);
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Task di salvataggio dell'allegato
        /// </summary>
        protected virtual DocsPaWR.Allegato SaveAllegato()
        {
            DocsPaWR.Allegato allegato = null;

            try
            {
                DocsPaWR.SchedaDocumento schedaDocumento = this.GetSchedaDocumento();

                // Reperimento oggetto allegato
                allegato = this.GetSelectedAllegato();

                if (allegato == null)
                {
                    // Modalità di inserimento
                    allegato              = new DocsPaWR.Allegato();
                    allegato.descrizione  = this.TextDescrizione.Text;
                    allegato.numeroPagine = this.NumeroPagine;
                    allegato.docNumber    = schedaDocumento.docNumber;
                    allegato.version      = "0";

                    string idPeopleDelegato = "0";
                    if (UserManager.getInfoUtente().delegato != null)
                    {
                        idPeopleDelegato = UserManager.getInfoUtente().delegato.idPeople;
                    }
                    allegato.idPeopleDelegato = idPeopleDelegato;

                    // Impostazione del repositoryContext associato al documento
                    allegato.repositoryContext = schedaDocumento.repositoryContext;
                    allegato.position          = (schedaDocumento.allegati.Length + 1);
                    allegato = DocumentManager.aggiungiAllegato(allegato);

                    // Inserimento dell'allegato nella scheda documento
                    List <DocsPaWR.Allegato> allegati = new List <DocsPaWR.Allegato>(schedaDocumento.allegati);
                    allegati.Add(allegato);
                    schedaDocumento.allegati = allegati.ToArray();
                }
                else
                {
                    // Modifica dati
                    allegato.descrizione  = this.TextDescrizione.Text;
                    allegato.numeroPagine = this.NumeroPagine;

                    DocumentManager.modificaAllegato(this, allegato, schedaDocumento.docNumber);
                    DocumentManager.setDocumentoSelezionato(this, schedaDocumento);
                }
            }
            catch (Exception ex)
            {
                allegato = null;
            }

            return(allegato);
        }
Exemplo n.º 25
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            result           = "";
            Response.Expires = -1;
            this.txt_note.Focus();
            if (!this.IsPostBack)
            {
                this.btn_annulla.Attributes["onClick"] = "ClosePage(false);";

                DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoSelezionato(this);

                string ownerUser;

                bool isCheckedOut = CheckInOutServices.IsCheckedOutDocumentWithUser(out ownerUser);

                // Verifica se il documento è in stato checkout
                if (isCheckedOut)
                {
                    this.IsOwnerCheckedOut = (ownerUser.ToUpper() == UserManager.getInfoUtente().userId.ToUpper());

                    this.lbl_messageCheckOut.Visible      = !this.IsOwnerCheckedOut;
                    this.lbl_messageOwnerCheckOut.Visible = this.IsOwnerCheckedOut;

                    this.btn_ok.Visible   = this.IsOwnerCheckedOut;
                    this.lbl_note.Visible = false;
                    this.txt_note.Visible = false;
                    this.lbl_result.Text  = string.Empty;
                }
                else
                {
                    this.lbl_messageCheckOut.Visible      = false;
                    this.lbl_messageOwnerCheckOut.Visible = false;

                    this.lbl_mess_conf_rimuovi.Visible = true;

                    result = DocumentManager.verificaDirittiCestinaDocumento(this, schedaDocumento);

                    this.lbl_note.Visible = (result == "Del");
                    //luluciani 17/06/2008
                    this.btn_ok.Visible = (result == "Del");
                    this.lbl_mess_conf_rimuovi.Visible = (result == "Del");


                    this.txt_note.Visible = this.lbl_note.Visible;

                    if (!this.lbl_note.Visible)
                    {
                        this.lbl_result.Text = result;
                    }
                }
            }
            tastoInvio();
        }
Exemplo n.º 26
0
        /// <summary>
        /// Reperimento dello stato della spedizione al destinatario
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        protected virtual string GetStatoSpedizione(DocsPaWR.Destinatario item, string tipoDest)
        {
            string result = item.StatoSpedizione.Descrizione;

            DocsPaWR.SchedaDocumento scheda = DocumentManager.getSelectedRecord();
            if (!string.IsNullOrEmpty(scheda.eredita) && scheda.eredita.Equals("0") && !string.IsNullOrEmpty(tipoDest) && tipoDest == "INTERNO")
            {
                result += "\n(Estensione gerarchica della visibiltà bloccata dall'utente)";
            }

            return(result);
        }
Exemplo n.º 27
0
        private void setCorrispondentiProtocollo()
        {
            try
            {
                if (target == null)
                {
                    return;
                }
                DocsPaWR.SchedaDocumento  schedaDoc  = DocumentManager.getDocumentoInLavorazione(this);
                DocsPaWR.Corrispondente[] searchCorr = (DocsPAWA.DocsPaWR.Corrispondente[])Session["rubricaSempl.listaCorr"];
                DocsPaWR.Corrispondente   corr;
                //controlla i corrispondenti selezionati, li mette in una hashTable e poi carica la pagina
                if (target.Equals("dest"))
                {
                    // Protocollo in uscita
                    for (int i = 0; i < ListCorrispondenti.Items.Count; i++)
                    {
                        if (ListCorrispondenti.Items[i].Selected)
                        {
                            corr      = (DocsPAWA.DocsPaWR.Corrispondente)searchCorr[i];
                            schedaDoc = addDestinatari(schedaDoc, corr);
                            //Logger.log("Corrispondente Proto= "+corr.descrizione);
                        }
                    }

                    DocumentManager.setDocumentoInLavorazione(this, schedaDoc);
                }
                else if (target.Equals("mitt") || target.Equals("mittInt"))
                {
                    if (ListCorrispondenti.SelectedIndex > -1)
                    {
                        corr = (DocsPAWA.DocsPaWR.Corrispondente)searchCorr[ListCorrispondenti.SelectedIndex];

                        if (target.Equals("mitt"))
                        {
                            ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittente = corr;
                        }
                        else
                        {
                            ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDoc.protocollo).mittenteIntermedio = corr;
                        }

                        //Session["docProtocollo.schedaDocumento"] = schedaDoc;
                        DocumentManager.setDocumentoInLavorazione(this, schedaDoc);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager.redirectToErrorPage(this, ex);
            }
        }
Exemplo n.º 28
0
        private void btn_insDoc_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            bool rootFolder;
            bool outValue = false;

            DocsPaWR.Folder selectedFolder = getSelectedFolder(out rootFolder);
            if (selectedFolder != null)
            {
                DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoSelezionato(this);
                String message = String.Empty;
                DocumentManager.addDocumentoInFolder(this, schedaDoc.systemId, selectedFolder.systemID, false, out outValue, out message);
                Response.Write("<script>var k=window.open('../documento/docClassifica.aspx','IframeTabs');</script>");
            }
        }
Exemplo n.º 29
0
        public void BindGrid()
        {
            //preparo i destinatari/destinatari cc
            List <Cols> columns = new List <Cols>();

            schedaDoc = DocumentManager.getDocumentoInLavorazione(this);
            DocsPaWR.ProtocolloUscita protocollo = (DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDoc.protocollo;
            DocsPaWR.Corrispondente[] listaCorrispondenti;
            DocsPaWR.Corrispondente[] listaCorrispondentiCc;
            listaCorrispondenti   = protocollo.destinatari;
            listaCorrispondentiCc = protocollo.destinatariConoscenza;
            if (listaCorrispondenti != null)
            {
                foreach (DocsPaWR.Corrispondente c in listaCorrispondenti)
                {
                    if (!string.IsNullOrEmpty(c.systemId))
                    {
                        Canale canalePreferenz = UserManager.getCorrispondenteBySystemID(this.Page, c.systemId).canalePref;
                        if (canalePreferenz != null && (!string.IsNullOrEmpty(canalePreferenz.descrizione)))
                        {
                            columns.Add(new Cols("(" + canalePreferenz.descrizione + ") " + c.descrizione, c.systemId));
                        }
                        else
                        {
                            columns.Add(new Cols(c.descrizione, c.systemId));
                        }
                    }
                }
            }
            if (listaCorrispondentiCc != null)
            {
                foreach (DocsPaWR.Corrispondente c in listaCorrispondentiCc)
                {
                    if (!string.IsNullOrEmpty(c.systemId))
                    {
                        Canale canalePreferenz = UserManager.getCorrispondenteBySystemID(this.Page, c.systemId).canalePref;
                        if (canalePreferenz != null && (!string.IsNullOrEmpty(canalePreferenz.descrizione)))
                        {
                            columns.Add(new Cols("(Cc)(" + c.canalePref.descrizione + ") " + c.descrizione, c.systemId));
                        }
                        else
                        {
                            columns.Add(new Cols("(Cc)  " + c.descrizione, c.systemId));
                        }
                    }
                }
            }
            dataGridMezzi.DataSource = columns;
            dataGridMezzi.DataBind();
        }
Exemplo n.º 30
0
        protected void RowSelected_RowCommand(object sender, GridViewRowEventArgs e)
        {
            try {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    string idProfile_trasm = ((Label)e.Row.FindControl("LblIdSel")).Text;
                    string language        = UIManager.UserManager.GetUserLanguage();

                    if (!string.IsNullOrEmpty(idProfile_trasm))
                    {
                        DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentDetails(this, idProfile_trasm, "");
                        DocsPaWR.InfoDocumento   doc       = DocumentManager.getInfoDocumento(schedaDoc);

                        if (doc.tipoProto.ToUpper().Equals("R"))
                        {
                            //Tipologia documento non visualizzabile
                            ((Label)e.Row.FindControl("Comunication")).Text = Utils.Languages.GetLabelFromCode("HistoryPreservedDocNotView", language);
                        }
                        else
                        {
                            // Verifica se l'utente ha i diritti per accedere al documento
                            //int retValue = DocumentManager.verificaACL("D", idProfile_trasm, UserManager.getInfoUtente(), out errorMessage);
                            //if (retValue == 0 || retValue == 1)
                            //{
                            //    string script = ("<script>alert('" + errorMessage + "');</script>");
                            //    Response.Write(script);
                            //}
                            //else
                            //{

                            //Rendo il record cliccabile
                            e.Row.Attributes["onclick"] = "$('#grid_rowindex').val('" + ((Label)e.Row.FindControl("LblIdSel")).Text + "'); __doPostBack('UpGridCorr', ''); return false;";
                            e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer'");
                            //}
                        }
                    }
                    else
                    {
                        //Non esiste alcuna trasmissione associata al documento
                        ((Label)e.Row.FindControl("Comunication")).Text = Utils.Languages.GetLabelFromCode("HistoryPreservedDocNotTrasm", language);
                    }
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }