Exemplo n.º 1
0
        private void CreateAndTrasmDoc(SchedaDocumento scheda, InfoUtente userInfo, Ruolo ruolo)
        {
            //creo la trasmissione
            Trasmissione        trasm  = new Trasmissione();
            TrasmissioneSingola trasmS = new TrasmissioneSingola();
            TrasmissioneUtente  trasmU = new TrasmissioneUtente();

            //trasm.dataInvio = DateTime.Now.ToShortDateString();
            trasm.DataDocFasc   = scheda.dataCreazione;
            trasm.infoDocumento = DocsPAWA.DocumentManager.getInfoDocumento(scheda);
            trasm.ruolo         = ruolo;
            trasm.tipoOggetto   = TrasmissioneTipoOggetto.DOCUMENTO;
            trasm.utente        = DocsPAWA.UserManager.getUtente();

            trasmS.ragione               = TrasmManager.GetRagioneNotifica(userInfo.idAmministrazione);
            trasmS.tipoDest              = TrasmissioneTipoDestinatario.RUOLO;
            trasmS.tipoTrasm             = "S";
            trasmS.corrispondenteInterno = UserManager.getCorrispondenteBySystemID(this.Page, ruolo.systemId);
            trasmU.daNotificare          = true;
            trasmU.utente = UserManager.getUtente();

            trasmS.trasmissioneUtente    = new TrasmissioneUtente[1];
            trasmS.trasmissioneUtente[0] = trasmU;
            trasm.trasmissioniSingole    = new TrasmissioneSingola[1];
            trasm.trasmissioniSingole[0] = trasmS;
            Trasmissione trasmRes = TrasmManager.saveExecuteTrasm(this.Page, trasm, userInfo);
        }
Exemplo n.º 2
0
        private bool SaveTransmission()
        {
            try
            {
                if (this.Transmission.utente != null)
                {
                    this.Transmission.utente.idAmministrazione = UserManager.GetInfoUser().idAmministrazione;
                }
                if (DocumentManager.getSelectedRecord() != null)
                {
                    this.Transmission.infoDocumento = DocumentManager.getInfoDocumento(DocumentManager.getSelectedRecord());
                }
                else if (ProjectManager.getProjectInSession() != null)
                {
                    this.Transmission.infoFascicolo = ProjectManager.getInfoFascicoloDaFascicolo(ProjectManager.getProjectInSession());
                }

                DocsPaWR.CessioneDocumento objCessione = new DocsPaWR.CessioneDocumento();
                objCessione.docCeduto        = true;
                objCessione.idPeople         = UserManager.GetInfoUser().idPeople;
                objCessione.idRuolo          = UserManager.GetInfoUser().idGruppo;
                objCessione.idPeopleNewPropr = this.rblUsers.SelectedValue.Split('_')[0];
                objCessione.idRuoloNewPropr  = this.rblUsers.SelectedValue.Split('_')[1];
                objCessione.userId           = UserManager.GetInfoUser().userId;
                this.Transmission.cessione   = objCessione;
                this.Transmission            = impostaUtenteConNotifica(this.Transmission);

                if (this.SaveButNotTransmit)
                {
                    this.Transmission = TrasmManager.saveTrasm(this, this.Transmission);
                }
                else
                {
                    InfoUtente infoUser = UserManager.GetInfoUser();
                    this.Transmission = TrasmManager.saveExecuteTrasm(this, this.Transmission, infoUser);
                }

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            fascicolo = FascicoliManager.getFascicoloSelezionato(this);
            if (fascicolo == null)
            {
                Response.Write("<SCRIPT>top.principale.iFrame_dx.iFrame_cn.document.location='../blank_page.htm';</SCRIPT>");
                return;
            }

            //Profilazione dinamica fascicoli
            if (System.Configuration.ConfigurationManager.AppSettings["ProfilazioneDinamicaFasc"] != null && System.Configuration.ConfigurationManager.AppSettings["ProfilazioneDinamicaFasc"] == "1" && fascicolo.tipo.Equals("P"))
            {
                pnl_profilazione.Visible = true;
                if (fascicolo.template != null)
                {
                    txt_tipoFasc.Text  = fascicolo.template.DESCRIZIONE;;
                    fascicolo.template = ProfilazioneFascManager.getTemplateFascDettagli(fascicolo.systemID, this);
                    FascicoliManager.setFascicoloSelezionato(fascicolo);
                }
            }
            //Fine Profilazione dinamica fascicoli

            userRuolo = UserManager.getRuolo(this);
            userHome  = UserManager.getUtente(this);
            infoUt    = UserManager.getInfoUtente(this);

            if (!Page.IsPostBack)
            {
                HashFolder = new Hashtable();
                if (this.Page.Session["fascDettagliFasc.nodoSelezionato"] == null)
                {
                    this.Page.Session["fascDettagliFasc.nodoSelezionato"] = getSelectedNodeFolder();
                }
                setInfoFascicolo();
            }
            else
            {
                this.Page.Session.Remove("fascDettagliFasc.nodoSelezionato");
                HashFolder = FascicoliManager.getHashFolder(this);
            }

            //selezionaUltimoNodoSelezionato();
            //controllo se devo creare una nuova cartella
            if (Session["descNewFolder"] != null)
            {
                DocsPAWA.DocsPaWR.ResultCreazioneFolder result;
                if (!this.CreateNewFolder(out result))
                {
                    // Visualizzazione messaggio di errore
                    string errorMessage = string.Empty;
                    if (result == DocsPAWA.DocsPaWR.ResultCreazioneFolder.FOLDER_EXIST)
                    {
                        errorMessage = "Il sottofascicolo richiesto è già presente e non può essere duplicato";
                    }
                    else
                    {
                        errorMessage = "Errore nella creazione del sottofascicolo";
                    }

                    Response.Write(string.Format("<script>alert('{0}');</script>", errorMessage));
                }

                Session.Remove("descNewFolder");
            }

            //Seleziono il folder selezionato da ricerca sottofascicolo

            if (hd_returnValueModal.Value == "Y") //ritorno dalla modale di ricerca dei sottofascicoli
            {
                SelezionaSottofascicolo();
            }
            else
            {
                selezionaUltimoNodoSelezionato();
            }


            Folders.SelectExpands = true;

            if (enableUfficioRef)
            {
                this.pnl_uffRef.Visible = true;
                if (fascicolo.ufficioReferente != null)
                {
                    DocsPaWR.Corrispondente corrRef = UserManager.getCorrispondenteBySystemID(this, fascicolo.ufficioReferente.systemId);
                    this.txt_cod_uff_ref.Text  = corrRef.codiceRubrica;
                    this.txt_desc_uff_ref.Text = corrRef.descrizione;
                    fascicolo.ufficioReferente = corrRef;
                    FascicoliManager.setFascicoloSelezionato(this, fascicolo);
                    // trasmetti a UO referente solo se vengo da nuovo fascicolo
                    //se vengo dal dettaglio del fascicolo la trasmissione non deve partire
                    if (Request.QueryString["newFasc"] != null && this.Request.QueryString["newFasc"].ToString().Equals("1"))
                    {
                        //effettuo la trasmissione dopo la creazione di un nuovo fascicolo(provendo da doc classifica)
                        //Invia la trasmissione ai ruoli di riferimento dell'Ufficio Referente
                        if (!getRagTrasmissioneUfficioReferente())
                        {
                            string theAlert = "<script>alert('Attenzione! Ragione di trasmissione assente per l\\'Ufficio referente.";
                            theAlert = theAlert + "\\nLa trasmissione non è stata effettuata.');</script>";
                            Response.Write(theAlert);
                        }
                        else
                        {
                            string esito = setCorrispondentiTrasmissione();
                            if (!esito.Equals(""))
                            {
                                esito = esito.Replace("'", "''");
                                Page.RegisterStartupScript("chiudi", "<script>alert('" + esito + "')</script>");
                                esito = "";
                            }
                            else
                            {
                                //richiamo il metodo che salva la trasmissione
                                DocsPAWA.DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente();
                                if (infoUtente.delegato != null)
                                {
                                    trasmissione.delegato = ((DocsPAWA.DocsPaWR.InfoUtente)(infoUtente.delegato)).idPeople;
                                }

                                //Nuovo metodo saveExecuteTrasm
                                trasmissione.daAggiornare = false;
                                DocsPaWR.Trasmissione trasm_res = TrasmManager.saveExecuteTrasm(this, trasmissione, infoUtente);
                                //trasmissione = TrasmManager.saveTrasm(this, trasmissione);
                                //trasmissione.daAggiornare = false;
                                //DocsPaWR.Trasmissione trasm_res = TrasmManager.executeTrasm(this,trasmissione);

                                if (trasm_res != null && trasm_res.ErrorSendingEmails)
                                {
                                    Response.Write("<script>window.alert('Non è stato possibile inoltrare una o più e-mail. \\nContattare l\\'amministratore per risolvere il problema.');</script>");
                                }
                            }
                        }
                        //rimozione variabili di sessione
                        TrasmManager.removeGestioneTrasmissione(this);
                        TrasmManager.removeRagioneSel(this);
                        FascicoliManager.removeUoReferenteSelezionato(this);
//						FascicoliManager.removeFascicoloSelezionato(this);
                        //Rimuovo la variabile di sessione dopo la trasmissione
                    }
                }
            }
            else
            {
                this.pnl_uffRef.Visible = false;
            }
            //Session.Remove("newFasc");
        }