Exemplo n.º 1
0
        private void updateElementoSelezionato(DocsPAWA.DocsPaWR.Registro registro)
        {
            this.btn_modificReg.Enabled     = false;
            this.btn_stampaRegistro.Enabled = false;

            this.btn_cambiaStatoReg.Enabled = false;

            this.btn_casellaIstituzionale.Enabled = true;

            if (registro.chaRF == "1")
            {
                Response.Write("<script>parent.iFrame_dettagli.location='regDettagli.aspx?idReg=" + registro.idAOOCollegata + "';</script>");
                Response.Write("<script>if(parent.iFrame_dettagliRF!=null){parent.iFrame_dettagliRF.location='regDettagliRF.aspx';}</script>");
            }
            else
            {
                if (registro.stato.Equals("C"))
                {
                    this.btn_modificReg.Enabled     = true;
                    this.btn_stampaRegistro.Enabled = true;
                }
                else
                {
                    this.btn_modificReg.Enabled     = false;
                    this.btn_stampaRegistro.Enabled = false;
                }
                this.btn_cambiaStatoReg.Enabled       = true;
                this.btn_casellaIstituzionale.Enabled = true;
                Response.Write("<script>parent.iFrame_dettagli.location='regDettagli.aspx';</script>");
                Response.Write("<script>if(parent.iFrame_dettagliRF!=null){parent.iFrame_dettagliRF.location='../../blank_page.htm'};</script>");
            }
        }
Exemplo n.º 2
0
        private void btn_cambiaStatoReg_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            DocsPAWA.DocsPaWR.Registro registro = null;
            if (this.DataGrid2.Items.Count > 0)
            {
                string idReg = ((Label)this.DataGrid2.SelectedItem.Cells[5].Controls[1]).Text;
                registro = GestManager.getRegistroById(this.Page, idReg);
            }
            if (registro == null)
            {
                RegisterStartupScript("alertRegistroMancante", "<script language=javascript>alert('Selezionare un registro!');</script>");
                return;
            }

            if (registro != null && registro.Sospeso)
            {
                RegisterStartupScript("alertRegistroSospeso", "<script language=javascript>alert('Attenzione! Lo stato del registro non può essere modificato perchè risulta essere sospeso!');</script>");
                //this.DataGrid2.SelectedIndex = -1;
                //RegisterStartupScript("refresh", "<script language=javascript>document.forms[0].submit();</script>");
                return;
            }

            GestManager.cambiaStatoRegistro(this);
            BindGridRF();
            //old: updateRegistroSelezionato(GestManager.getRegistroSel(this));
            updateElementoSelezionato(GestManager.getRegistroSel(this));
            this.RefreshDocumentsCallContext();
        }
Exemplo n.º 3
0
        private string setStatoReg(DocsPAWA.DocsPaWR.Registro reg)
        {
            string   dataApertura = reg.dataApertura;
            string   nomeImg;
            string   img;
            DateTime dt_cor = DateTime.Now;

            if (UserManager.getStatoRegistro(reg).Equals("G"))
            {
                nomeImg = "stato_giallo2.gif";
            }
            else if (UserManager.getStatoRegistro(reg).Equals("V"))
            {
                nomeImg = "stato_verde2.gif";
            }
            else
            {
                nomeImg = "stato_rosso2.gif";
            }


            img = "<img src=" + "../../images/" + nomeImg + " border=0 width=52, height=18>";

            return(img);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Inizializzazione
        /// </summary>
        private void Inizilize()
        {
            Session["Titolario"] = "Y";

            this.txt_codice_padre.Text = Request.QueryString["val"].ToString();
            this.hd_from.Value         = Request.QueryString["from"].ToString();

            _fascSelezionato = DocsPAWA.FascicoliManager.getFascicoloDaCodice(this, this.txt_codice_padre.Text);
            _registro        = DocsPAWA.UserManager.getRegistroSelezionato(this);

            if (_fascSelezionato != null && _registro != null)
            {
                this.lbl_padre.Text = "Inserisci sotto il nodo di titolario:<br>" +
                                      _fascSelezionato.codice + " - " + _fascSelezionato.descrizione +
                                      "<br><br>" +
                                      "Registro:<br>" +
                                      _registro.codRegistro + " - " + _registro.descrizione;
            }

            if (wws.isEnableContatoreTitolario() != "")
            {
                DocsPAWA.DocsPaWR.OrgNodoTitolario nodoTitSel = this.GetCurrentTitolario();
                txt_protTitolario.Text = wws.getContatoreProtTitolario(nodoTitSel).ToString();
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Modifica dello stato del registro
        /// </summary>
        /// <param name="registro"></param>
        public void CambiaStatoRegistroCorrente()
        {
            DocsPAWA.DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();

            ProtocollazioneIngresso.Login.LoginMng loginMng = new ProtocollazioneIngresso.Login.LoginMng(this._page);
            DocsPAWA.DocsPaWR.Registro             registro = ws.RegistriCambiaStato(loginMng.GetInfoUtente(), this.GetRegistroCorrente());

            this.SetRegistroCorrente(registro);
        }
Exemplo n.º 6
0
 private void ddl_registri_SelectedIndexChanged(object sender, EventArgs e)
 {
     //mette in sessione il registro selezionato
     if (ddl_registri.SelectedIndex != -1)
     {
         DocsPAWA.DocsPaWR.Registro reg = UserManager.getRegistroBySistemId(this.Page, ddl_registri.SelectedValue.Trim());
         UserManager.setRegistroSelezionato(this, reg);
         this.caricaTreeView();
     }
 }
Exemplo n.º 7
0
        private void setRegistro(DocsPAWA.DocsPaWR.Registro reg)
        {
            schedaDocumento          = DocumentManager.getDocumentoInLavorazione(this);
            schedaDocumento.registro = reg;
            //aggiunto per annullare la risposta al protocollo se si cambia registro
            //commentato il 20/07/2005 per modifica richiesta per ANAS
            //schedaDocumento.protocollo.rispostaProtocollo = null;

            //aggiunto per risettare la data
            if (schedaDocumento.protocollo != null)
            {
                schedaDocumento.protocollo.dataProtocollazione = null;
                if (schedaDocumento.protocollo.GetType() == typeof(DocsPAWA.DocsPaWR.ProtocolloEntrata))
                {
                    if (!corrInRegistro(((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocumento.protocollo).mittente, reg))
                    {
                        ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocumento.protocollo).mittente = null;
                    }
                    if (!corrInRegistro(((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocumento.protocollo).mittenteIntermedio, reg))
                    {
                        ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocumento.protocollo).mittenteIntermedio = null;
                    }
                }
                else
                if (schedaDocumento.protocollo.GetType() == typeof(DocsPAWA.DocsPaWR.ProtocolloUscita))
                {
                    // destinatari
                    DocsPaWR.Corrispondente[] listaCorr = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocumento.protocollo).destinatari;
                    if (listaCorr != null)
                    {
                        for (int i = listaCorr.Length - 1; i > -1; i--)
                        {
                            if (!corrInRegistro(listaCorr[i], reg))
                            {
                                listaCorr = UserManager.removeCorrispondente(listaCorr, i);
                            }
                        }
                        ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocumento.protocollo).destinatari = listaCorr;
                    }
                    // destinatari per conoscenza
                    listaCorr = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocumento.protocollo).destinatariConoscenza;
                    if (listaCorr != null)
                    {
                        for (int i = listaCorr.Length - 1; i > -1; i--)
                        {
                            if (!corrInRegistro(listaCorr[i], reg))
                            {
                                listaCorr = UserManager.removeCorrispondente(listaCorr, i);
                            }
                        }
                        ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocumento.protocollo).destinatariConoscenza = listaCorr;
                    }
                }
            }
        }
Exemplo n.º 8
0
 private void setDettagli(DocsPAWA.DocsPaWR.Registro registro)
 {
     if (!Page.IsPostBack)
     {
         this.txtRegistro.Text           = registro.codRegistro;
         this.txtDataApertura.Text       = registro.dataApertura;
         this.txtDataChiusura.Text       = registro.dataChiusura;
         this.txtDescrizione.Text        = registro.descrizione;
         this.txtEmail.Text              = registro.email;
         this.txtProssimoProtocollo.Text = registro.ultimoNumeroProtocollo;
         this.txtDataUltimoProt.Text     = registro.dataUltimoProtocollo;
     }
 }
Exemplo n.º 9
0
        private void setRegistroNoControlloCorrInReg(DocsPAWA.DocsPaWR.Registro reg)
        {
            schedaDocumento          = DocumentManager.getDocumentoInLavorazione(this);
            schedaDocumento.registro = reg;
            //aggiunto per annullare la risposta al protocollo se si cambia registro
            //commentato il 20/07/2005 per modifica richiesta per ANAS
            //schedaDocumento.protocollo.rispostaProtocollo = null;

            //aggiunto per risettare la data
            if (schedaDocumento.protocollo != null)
            {
                schedaDocumento.protocollo.dataProtocollazione = null;
            }
        }
Exemplo n.º 10
0
        protected void setDettagli(DocsPAWA.DocsPaWR.Registro rf)
        {
            this.lbl_registro.Text    = rf.codRegistro;
            this.lbl_descrizione.Text = rf.descrizione;
            DocsPaWR.Registro aooColl = UserManager.getRegistroBySistemId(this, rf.idAOOCollegata);
            //codice Aoo Collegata
            this.lbl_AooColl.Text = aooColl.codRegistro;
            //descrizione Aoo Collegata
            this.lbl_DescAooColl.Text = aooColl.descrizione;
            this.panel_Det.Visible    = true;
            #region multi casella

            System.Collections.Generic.List <DocsPAWA.DocsPaWR.CasellaRegistro> listCaselle = DocsPAWA.utils.MultiCasellaManager.GetComboRegisterConsult(GestManager.getRegistroSel().systemId);
            foreach (DocsPAWA.DocsPaWR.CasellaRegistro c in listCaselle)
            {
                System.Text.StringBuilder formatMail = new System.Text.StringBuilder();
                if (c.Principale.Equals("1"))
                {
                    formatMail.Append("* ");
                }
                formatMail.Append(c.EmailRegistro);
                if (!string.IsNullOrEmpty(c.Note))
                {
                    formatMail.Append(" - ");
                    formatMail.Append(c.Note);
                }
                ddl_Caselle.Items.Add(new ListItem(formatMail.ToString(), c.EmailRegistro));
            }

            if (listCaselle.Count == 0)
            {
                ddl_Caselle.Enabled = false;
                ddl_Caselle.Width   = new Unit(200);
                return;
            }
            //imposto la casella principale come selezionata
            foreach (ListItem i in ddl_Caselle.Items)
            {
                if (i.Text.Split(new string[] { "*" }, 2, System.StringSplitOptions.None).Length > 1)
                {
                    ddl_Caselle.SelectedValue = i.Value;
                    break;
                }
            }

            //salvo in sessione l'indirizzo della casella correntemente selezionata
            GestManager.setCasellaSel(ddl_Caselle.SelectedValue);
            #endregion
        }
Exemplo n.º 11
0
        private DocsPAWA.DocsPaWR.Registro GetRegistro(string idRegistro)
        {
            DocsPAWA.DocsPaWR.Registro   retValue = null;
            DocsPAWA.DocsPaWR.Registro[] registri = this.GetRegistri();

            foreach (DocsPAWA.DocsPaWR.Registro registro in registri)
            {
                if (registro.systemId.Equals(idRegistro))
                {
                    retValue = registro;
                    break;
                }
            }

            return(retValue);
        }
Exemplo n.º 12
0
        private bool corrInRegistro(DocsPAWA.DocsPaWR.Corrispondente corr, DocsPAWA.DocsPaWR.Registro reg)
        {
            if (corr == null)
            {
                return(true);
            }

            if (corr.idRegistro == null || corr.idRegistro == reg.systemId || corr.idRegistro == "")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 13
0
        private void CaricaComboRegistri(DropDownList ddl)
        {
            userRegistri = UserManager.getListaRegistri(this);
            string stato;
            string inCondition       = "IN ( ";
            string inConditionSimple = "";
            int    elemento          = 0;

            for (int i = 0; i < userRegistri.Length; i++)
            {
                stato = UserManager.getStatoRegistro(userRegistri[i]);
                {
                    DocsPAWA.DocsPaWR.Registro registro = UserManager.getRegistroBySistemId(this.Page, userRegistri[i].systemId);
                    if (!registro.Sospeso)
                    {
                        //Andrea De Marco - Visibilità registri in creazione documento - i registri di pregresso non devono essere visibili
                        if (!registro.flag_pregresso)
                        {
                            ddl.Items.Add(userRegistri[i].codRegistro);
                            ddl.Items[elemento].Value = userRegistri[i].systemId;
                            elemento++;
                        }
                        //End De Marco - per ripristino, commentare De Marco e decommentare codice sottostante
                        //ddl.Items.Add(userRegistri[i].codRegistro);
                        //ddl.Items[elemento].Value = userRegistri[i].systemId;
                        //elemento++;
                    }
                }
                inCondition       = inCondition + userRegistri[i].systemId;
                inConditionSimple = inConditionSimple + userRegistri[i].systemId;
                if (i < userRegistri.Length - 1)
                {
                    inCondition       = inCondition + " , ";
                    inConditionSimple = inConditionSimple + " , ";
                }
            }
            inCondition = inCondition + " )";

            Session["inRegCondition"]       = inCondition;
            Session["inRegConditionSimple"] = inConditionSimple;
            //setto lo stato del registro
            if (userRegistri.Length > 0)
            {
                setStatoReg(userRegistri[0]);
            }
        }
Exemplo n.º 14
0
        private void setStatoReg_old(DocsPAWA.DocsPaWR.Registro reg)
        {
            // inserisco il registro selezionato in sessione

            UserManager.setRegistroSelezionato(this, reg);

            string   dataApertura = reg.dataApertura;
            string   nomeImg;
            DateTime dt_cor = DateTime.Now;

            CultureInfo ci = new CultureInfo("it-IT");


            string[] formati = { "dd/MM/yyyy", "dd/MM/yyyy HH.mm.ss", "dd/MM/yyyy H.mm.ss", };

            DateTime d_ap = DateTime.ParseExact(dataApertura, formati, ci.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);

            //aggiungo un giorno per fare il confronto con now (che comprende anche minuti e secondi)
            d_ap = d_ap.AddDays(1);

            string mydate = dt_cor.ToString(ci);

            //DateTime dt = DateTime.ParseExact(mydate,formati,ci.DateTimeFormat,DateTimeStyles.AllowWhiteSpaces);

            string StatoAperto = ConfigSettings.getKey("STATO.REG.APERTO");

            if (reg.stato.Equals(StatoAperto))
            {
                if (dt_cor.CompareTo(d_ap) > 0)
                {
                    //data odierna maggiore della data di apertura del registro
                    nomeImg = "stato_giallo.gif";
                }
                else
                {
                    nomeImg = "stato_verde.gif";
                }
            }
            else
            {
                nomeImg = "stato_rosso.gif";
            }

            this.img_statoReg.ImageUrl = "../images/" + nomeImg;
        }
Exemplo n.º 15
0
        private void setStatoReg(DocsPAWA.DocsPaWR.Registro reg)
        {
            // inserisco il registro selezionato in sessione
            UserManager.setRegistroSelezionato(this, reg);
            string nomeImg;

            if (UserManager.getStatoRegistro(reg).Equals("G"))
            {
                nomeImg = "stato_giallo.gif";
            }
            else if (UserManager.getStatoRegistro(reg).Equals("V"))
            {
                nomeImg = "stato_verde.gif";
            }
            else
            {
                nomeImg = "stato_rosso.gif";
            }

            this.img_statoReg.ImageUrl = "../images/" + nomeImg;
        }
Exemplo n.º 16
0
        private void CaricaComboRegistri(DropDownList ddl)
        {
            userRegistri = UserManager.getListaRegistri(this);
            string stato;
            int    elemento = 0;

            for (int i = 0; i < userRegistri.Length; i++)
            {
                stato = UserManager.getStatoRegistro(userRegistri[i]);
                {
                    DocsPAWA.DocsPaWR.Registro registro = UserManager.getRegistroBySistemId(this.Page, userRegistri[i].systemId);
                    if (!registro.Sospeso)
                    {
                        ddl.Items.Add(userRegistri[i].codRegistro);
                        ddl.Items[elemento].Value = userRegistri[i].systemId;
                        elemento++;
                    }
                }
            }
            DocsPAWA.DocsPaWR.Registro reg = UserManager.getRegistroBySistemId(this, this.ddl_registri.Items[0].Value);
            UserManager.setRegistroSelezionato(this, reg);
        }
Exemplo n.º 17
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            this.btn_chiudi.Attributes.Add("onclick", "window.close()");
            tipoGest = Request.QueryString["tipo"];
            if (tipoGest != null)
            {
                if (tipoGest.Equals("M"))
                {
                    registro = GestManager.getRegistroSel(this);
                    if (registro != null)
                    {
                        setDettagli(registro);
                    }
                }
                else
                if (tipoGest.Equals("I"))
                {
                    registro = new DocsPAWA.DocsPaWR.Registro();
                }
            }
        }
Exemplo n.º 18
0
        public DocsPAWA.DocsPaWR.Registro[] GetRegistriAperti()
        {
            DocsPAWA.DocsPaWR.Registro[] registri = this.GetRegistri();

            ArrayList arrayList = new ArrayList();

            bool isUtenteAbilitatoProtGiallo = this.IsUtenteAbilitatoProtGiallo();

            foreach (DocsPAWA.DocsPaWR.Registro registro in registri)
            {
                string statoRegistro = this.GetStatoRegistro(registro);

                // Il registro viene considerato solo se verde
                // o giallo (solo se l'utente è abilitato alla prot in giallo)
                if ((statoRegistro == "G" && isUtenteAbilitatoProtGiallo) || statoRegistro == "V")
                {
                    arrayList.Add(registro);
                }
            }

            DocsPAWA.DocsPaWR.Registro[] retValue = new DocsPAWA.DocsPaWR.Registro[arrayList.Count];
            arrayList.CopyTo(retValue);
            return(retValue);
        }
Exemplo n.º 19
0
 public void SetRegistroCorrente(DocsPAWA.DocsPaWR.Registro registro)
 {
     this._page.Session["ProtocollazioneIngresso.RegistroCorrente"] = registro;
     _page.Session["userRegistro"] = registro;
 }
Exemplo n.º 20
0
 private string GetStatoRegistro(DocsPAWA.DocsPaWR.Registro registro)
 {
     return(DocsPAWA.UserManager.getStatoRegistro(registro));
 }
Exemplo n.º 21
0
        private void caricaDg(ArrayList listaNodi, string tipoChiamata)
        {
            gw_Nodi.Columns[0].Visible = true;

            DataTable dt = new DataTable();

            dt.Columns.Add("ID_TITOLARIO");
            dt.Columns.Add("TITOLARIO");
            dt.Columns.Add("CODICE_NODO");
            dt.Columns.Add("NODO");
            dt.Columns.Add("REGISTRO");
            dt.Columns.Add("NUM_PROTO_TIT");

            switch (tipoChiamata)
            {
            case "IndiceSistematico":

                for (int i = 0; i < listaNodi.Count; i++)
                {
                    DocsPaWR.VoceIndiceSistematico voceIndice = (DocsPaWR.VoceIndiceSistematico)listaNodi[i];
                    DataRow rw = dt.NewRow();
                    rw["ID_TITOLARIO"] = voceIndice.idTitolario;
                    DocsPaWR.OrgTitolario titolario = wws.getTitolarioById(voceIndice.idTitolario);
                    rw["TITOLARIO"]     = titolario.DescrizioneLite;
                    rw["CODICE_NODO"]   = voceIndice.codiceNodo;
                    rw["NODO"]          = voceIndice.descrizioneNodo;
                    rw["REGISTRO"]      = string.Empty;
                    rw["NUM_PROTO_TIT"] = string.Empty;
                    dt.Rows.Add(rw);
                }

                dt.AcceptChanges();
                gw_Nodi.DataSource = dt;
                gw_Nodi.DataBind();
                gw_Nodi.Visible            = true;
                gw_Nodi.Columns[0].Visible = false;
                gw_Nodi.Columns[4].Visible = false;
                gw_Nodi.Columns[5].Visible = false;
                break;

            case "ProtocolloTitolario":
                for (int i = 0; i < listaNodi.Count; i++)
                {
                    DocsPaWR.OrgNodoTitolario nodoTitolario = (DocsPaWR.OrgNodoTitolario)listaNodi[i];
                    DataRow rw = dt.NewRow();
                    rw["ID_TITOLARIO"] = nodoTitolario.ID_Titolario;
                    DocsPaWR.OrgTitolario titolario = wws.getTitolarioById(nodoTitolario.ID_Titolario);
                    rw["TITOLARIO"]   = titolario.DescrizioneLite;
                    rw["CODICE_NODO"] = nodoTitolario.Codice;
                    rw["NODO"]        = nodoTitolario.Descrizione;
                    if (!string.IsNullOrEmpty(nodoTitolario.IDRegistroAssociato))
                    {
                        DocsPAWA.DocsPaWR.Registro reg = UserManager.getRegistroBySistemId(this, nodoTitolario.IDRegistroAssociato);
                        if (reg != null)
                        {
                            rw["REGISTRO"] = reg.descrizione;
                        }
                        else
                        {
                            rw["REGISTRO"] = string.Empty;
                        }
                    }
                    else
                    {
                        rw["REGISTRO"] = string.Empty;
                    }
                    rw["NUM_PROTO_TIT"] = nodoTitolario.numProtoTit;
                    string stringContatoreTitolario = wws.isEnableContatoreTitolario();
                    if (!string.IsNullOrEmpty(stringContatoreTitolario))
                    {
                        gw_Nodi.Columns[5].HeaderText = stringContatoreTitolario;
                    }
                    else
                    {
                        gw_Nodi.Columns[5].HeaderText = string.Empty;
                    }
                    dt.Rows.Add(rw);
                }

                dt.AcceptChanges();
                gw_Nodi.DataSource = dt;
                gw_Nodi.DataBind();
                gw_Nodi.Visible            = true;
                gw_Nodi.Columns[0].Visible = false;
                break;
            }

            //Associo l'evento alle checkBox
            for (int i = 0; i < gw_Nodi.Rows.Count; i++)
            {
                ((System.Web.UI.WebControls.CheckBox)gw_Nodi.Rows[i].Cells[6].Controls[1]).CheckedChanged += new EventHandler(cb_selezione_CheckedChanged);
            }
        }
Exemplo n.º 22
0
 private void getParameterUser()
 {
     userRuolo = UserManager.getRuolo(this);
     userReg   = UserManager.getRegistroSelezionato(this);
 }
Exemplo n.º 23
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="registro"></param>
 /// <returns></returns>
 private bool IsStatoRegistroGiallo(DocsPAWA.DocsPaWR.Registro registro)
 {
     return(DocsPAWA.UserManager.getStatoRegistro(registro) == "G");
 }
Exemplo n.º 24
0
        protected void btn_modifica_Click(object sender, EventArgs e)
        {
            try
            {
                DocsPaWR.Oggetto  oggetto     = new DocsPAWA.DocsPaWR.Oggetto();
                DocsPaWR.Registro registro    = new DocsPAWA.DocsPaWR.Registro();
                DocsPaWR.Registro registroDoc = new DocsPAWA.DocsPaWR.Registro();

                string msg;

                //controllo sull'inserimento dell'oggetto
                if (this.ctrl_oggetto.oggetto_text.Equals("") || this.ctrl_oggetto.oggetto_text == null)
                {
                    msg = "Inserire il valore: oggetto";
                    Response.Write("<script>alert('" + msg + "');</script>");
                    return;
                }

                //controllo sulla lunghezza dell'oggetto (max 2000 car.)
                if (this.ctrl_oggetto.oggetto_text.Length > 2000)
                {
                    msg = "La lunghezza massima del campo oggetto non deve superare i 2000 caratteri.";
                    ctrl_oggetto.oggetto_SetControlFocus();
                    return;
                }

                //replace dell'apice singolo
                oggetto.descrizione = this.ctrl_oggetto.oggetto_text;

                //Aggiunta del codice oggetto se esiste!!!
                if (ctrl_oggetto.cod_oggetto_text != null && ctrl_oggetto.cod_oggetto_text != string.Empty)
                {
                    oggetto.codOggetto = ctrl_oggetto.cod_oggetto_text;
                }
                else
                {
                    oggetto.codOggetto = "";
                }


                #region old selezione registro
                ////if (wnd == "proto" || wnd == "protoSempl")
                ////{
                //if (ddlRegRf.SelectedItem.Value == "")
                //{
                //    if (wnd == "proto") // protocollo
                //    {

                //        registro = UserManager.getRegistroSelezionato(this);
                //    }
                //    else
                //    {
                //        if (wnd == "protoSempl") // protocollo semplificato
                //        {
                //            ProtocollazioneIngresso.Registro.RegistroMng regMng = new ProtocollazioneIngresso.Registro.RegistroMng(this);

                //            registro = regMng.GetRegistroCorrente();
                //        }
                //        else
                //        {
                //            registro = null; // ricerche e profilo
                //        }

                //    }
                //}
                //else
                //{
                //    char[] sep = { '_' };
                //    string[] datiSelezione = ddlRegRf.SelectedValue.Split(sep);
                //    registro.systemId = datiSelezione[0];
                //    registro.codice = ddlRegRf.SelectedItem.Text;
                //}
                #endregion

                DocsPaWR.Registro[] listaRegistri = UserManager.getListaRegistriWithRF(this, "", "");
                DocsPaWR.Oggetto    oggettoDoc    = new DocsPAWA.DocsPaWR.Oggetto();
                int selIndex = this.dg_Oggetti.SelectedIndex;

                string SelectedReg;
                if (selIndex > -1 && selIndex < this.dg_Oggetti.Items.Count)
                {
                    oggettoDoc.systemId     = ((Label)this.dg_Oggetti.Items[selIndex].Cells[2].Controls[1]).Text;
                    oggettoDoc.descrizione  = ((Label)this.dg_Oggetti.Items[selIndex].Cells[1].Controls[1]).Text;
                    oggettoDoc.daAggiornare = true;
                    //devo prendere il registro dell'oggetto selezionato per la modifica!!!

                    registroDoc.codice = ((Label)this.dg_Oggetti.Items[selIndex].Cells[3].Controls[1]).Text;
                    for (int regNum = 0; regNum < listaRegistri.Length; regNum++)
                    {
                        if (listaRegistri[regNum].codRegistro.ToLower() == registroDoc.codice.ToLower())
                        {
                            registroDoc.systemId = listaRegistri[regNum].systemId;

                            break;
                        }
                    }

                    //SelectedReg = ((Label)this.dg_Oggetti.Items[selIndex].Cells[3].Controls[1]).Text;
                    SelectedReg = this.ddlRegRf.SelectedItem.Text;
                    // if(SelectedReg.ToUpper()!= "TUTTI")

                    registro.codice = SelectedReg;
                    //recupero la system_id del registro da modificare
                    for (int regNum = 0; regNum < listaRegistri.Length; regNum++)
                    {
                        if (listaRegistri[regNum].codRegistro.Trim().ToLower() == SelectedReg.Trim().ToLower())
                        {
                            registro.systemId = listaRegistri[regNum].systemId;
                            //if (ddlRegRf != null)
                            //{
                            //    ddlRegRf.SelectedIndex = System.Convert.ToInt32(listaRegistri[regNum].systemId);
                            //}
                            break;
                        }
                    }

                    if (registro.systemId == null || registro.systemId.Equals(""))
                    {
                        registro = null;
                    }

                    string codOgg = ((Label)this.dg_Oggetti.Items[selIndex].Cells[0].Controls[1]).Text;
                    if (codOgg != null && codOgg != string.Empty)
                    {
                        oggettoDoc.codOggetto = codOgg;
                    }
                }
                else
                {
                    msg = "Selezionare un oggetto da modificare";
                    Response.Write("<script>alert('" + msg + "');</script>");
                    return;
                }

                // bool result = DocumentManager.ModificaOggetto(this, oggettoDoc, oggetto, registro,ref errMsg);

                string errMsg = "";
                bool   result = DocumentManager.cancellaOggetto(this, oggettoDoc);
                oggetto = DocumentManager.addOggetto(this, oggetto, registro, ref errMsg);
                //Nel caso di mancato inserimento recupero dalla cancellazione


                if (errMsg != string.Empty)
                {
                    Response.Write("<script>alert('" + errMsg + "');</script>");
                    if (oggetto == null)
                    {
                        oggetto = DocumentManager.addOggetto(this, oggettoDoc, registroDoc, ref errMsg);
                    }
                    return;
                }
                if (oggetto == null)
                {
                    oggetto = DocumentManager.addOggetto(this, oggettoDoc, registroDoc, ref errMsg);
                }

                if (result && oggetto != null)
                {
                    ricerca();
                }
                else
                {
                    Response.Write("<script>alert('Non è stato possibile effettuare la modifica oggetto: verifica il codice e la descrizione oggetto');</script>");
                }
            }
            catch (Exception es)
            {
                ErrorManager.redirectToErrorPage(this, es);
            }
        }
Exemplo n.º 25
0
 /// <summary>
 /// Impostazione del registro corrente
 /// </summary>
 /// <param name="codRegistro"></param>
 public void SetRegistroCorrente(string idRegistro)
 {
     DocsPAWA.DocsPaWR.Registro registro = this.GetRegistro(idRegistro);
     this._page.Session["ProtocollazioneIngresso.RegistroCorrente"] = registro;
     _page.Session["userRegistro"] = registro;
 }
Exemplo n.º 26
0
        /// <summary>
        /// TASTO GESTIONE
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_gest_Click(object sender, System.EventArgs e)
        {
            int msgRtn;

            System.Web.UI.WebControls.CommandEventArgs ev = (System.Web.UI.WebControls.CommandEventArgs)e;
            try
            {
                if (ev.CommandArgument.Equals("GEST_FAX"))
                {
                    DocsPaWR.DocsPaWebService WS = ProxyManager.getWS();
                    infoUt    = UserManager.getInfoUtente(this);
                    userRuolo = UserManager.getRuolo(this);
                    userReg   = userRuolo.registri[0];
                    msgRtn    = WS.FaxProcessaCasella(Utils.getHttpFullPath(this), infoUt, userRuolo, userReg);
                    if (msgRtn < 0)
                    {
                        logger.Error("Errore nella testata (GEST_FAX)");
                        throw new Exception();
                    }
                    switch (msgRtn)
                    {
                    case 0:
                        Response.Write("<script>alert('Nelle caselle Fax controllate,\\nnon risultano nuovi Fax da Processare ')</script>");
                        break;

                    case 1:
                        Response.Write("<script>alert('Trovato " + msgRtn.ToString() + " Fax,\\nconsultare la lista COSE DA FARE per vedere la trasmissione ad esso relativa.')</script>");
                        break;

                    default:
                        Response.Write("<script >alert('Trovati " + msgRtn.ToString() + " Fax,\\nconsultare la lista COSE DA FARE per vedere le trasmissioni ad essi relativa.')</script>");
                        break;
                    }
                }

                if (ev.CommandArgument.Equals("GEST_REGISTRI"))
                {
                    GestManager.removeRegistroSel(this);
                }

                if (!ev.CommandArgument.Equals("GEST_PROSPETTI") &&
                    !ev.CommandArgument.Equals("GEST_RUBRICA") &&
                    !ev.CommandArgument.Equals("GEST_MODELLI") &&
                    !ev.CommandArgument.Equals("GEST_ORGANIGRAMMA") &&
                    !ev.CommandArgument.Equals("GEST_AREA_LAV")
                    )
                {
                    this.CleanSessionMemoria();
                }

                //this.btn_gest.DisabledUrl = utils.InitImagePath.getInstance(idAmm).getPath("GESTIONE_ATTIVO");

                if (!ev.CommandArgument.Equals("GEST_ARCHIVIO_CARTACEO"))
                {
                    // Rimozione risorse
                    FascicolazioneCartacea.SessionManager.Clear();
                }

                //Annullamento variabile in sessione per lo scorrimento delle liste
                //UserControls.ScrollElementsList.ScrollManager.clearSessionObjScrollElementsList();
                UserControls.ScrollElementsList.ScrollManager.clearContextObjScrollElementsList();
            }
            catch (Exception ex)
            {
                string f = ex.Message.ToString();
                ErrorManager.redirectToErrorPage(this, ex);
            }
        }
Exemplo n.º 27
0
        private void setDettagli(DocsPAWA.DocsPaWR.Registro registro)
        {
            this.lbl_registro.Text           = registro.codRegistro;
            this.lbl_descrizione.Text        = registro.descrizione;
            this.lbl_dataApertura.Text       = registro.dataApertura;
            this.lbl_dataChiusura.Text       = registro.dataChiusura;
            this.lbl_dataUltProto.Text       = registro.dataUltimoProtocollo;
            this.lbl_prossimoProtocollo.Text = registro.ultimoNumeroProtocollo;
            this.panel_Det.Visible           = true;
            //modificato da Marco il 20/02/04 su richiesta per salute
            if (registro.stato == "A")
            {
                this.lbl_dataUltProto.Visible       = false;
                this.lbl_prossimoProtocollo.Visible = false;
            }
            #region multi casella

            System.Collections.Generic.List <DocsPAWA.DocsPaWR.CasellaRegistro> listCaselle = DocsPAWA.utils.MultiCasellaManager.GetComboRegisterConsult(registro.systemId);
            foreach (DocsPAWA.DocsPaWR.CasellaRegistro c in listCaselle)
            {
                if (!string.IsNullOrEmpty(c.EmailRegistro) && !c.EmailRegistro.Equals("&nbsp;"))
                {
                    System.Text.StringBuilder formatMail = new System.Text.StringBuilder();
                    if (c.Principale.Equals("1"))
                    {
                        formatMail.Append("* ");
                    }
                    formatMail.Append(c.EmailRegistro);
                    if (!string.IsNullOrEmpty(c.Note))
                    {
                        formatMail.Append(" - ");
                        formatMail.Append(c.Note);
                    }
                    ddl_Caselle.Items.Add(new ListItem(formatMail.ToString(), c.EmailRegistro));
                }
            }

            if (listCaselle.Count == 0)
            {
                ddl_Caselle.Enabled = false;
                ddl_Caselle.Width   = new Unit(200);
                return;
            }
            //imposto la casella principale come selezionata
            foreach (ListItem i in ddl_Caselle.Items)
            {
                if (i.Text.Split(new string[] { "*" }, 2, System.StringSplitOptions.None).Length > 1)
                {
                    ddl_Caselle.SelectedValue = i.Value;
                    break;
                }
            }
            if (Session["TipoRegistro"] != null && Session["TipoRegistro"].Equals("disable"))
            {
                ddl_Caselle.Enabled = false;
            }
            else
            {
                //salvo in sessione l'indirizzo della casella correntemente selezionata
                GestManager.setCasellaSel(ddl_Caselle.SelectedValue);
            }
            #endregion
        }
Exemplo n.º 28
0
        private void btn_aggiungi_Click(object sender, System.EventArgs e)
        {
            try
            {
                DocsPaWR.Oggetto  oggetto  = new DocsPAWA.DocsPaWR.Oggetto();
                DocsPaWR.Registro registro = new DocsPAWA.DocsPaWR.Registro();


                string msg;

                //controllo sull'inserimento dell'oggetto
                if (this.ctrl_oggetto.oggetto_text.Equals("") || this.ctrl_oggetto.oggetto_text == null)
                {
                    msg = "Inserire il valore: oggetto";
                    Response.Write("<script>alert('" + msg + "');</script>");
                    return;
                }

                //controllo sulla lunghezza dell'oggetto (max 2000 car.)
                if (this.ctrl_oggetto.oggetto_text.Length > 2000)
                {
                    msg = "La lunghezza massima del campo oggetto non deve superare i 2000 caratteri.";
                    ctrl_oggetto.oggetto_SetControlFocus();
                    return;
                }

                //replace dell'apice singolo
                oggetto.descrizione = this.ctrl_oggetto.oggetto_text;

                //Aggiunta del codice oggetto se esiste!!!
                if (ctrl_oggetto.cod_oggetto_text != null && ctrl_oggetto.cod_oggetto_text != string.Empty)
                {
                    oggetto.codOggetto = ctrl_oggetto.cod_oggetto_text;
                }
                else
                {
                    oggetto.codOggetto = "";
                }

                //if (wnd == "proto" || wnd == "protoSempl")
                //{
                if (ddlRegRf.SelectedItem.Value == "")
                {
                    if (wnd == "proto") // protocollo
                    {
                        registro = UserManager.getRegistroSelezionato(this);
                    }
                    else
                    {
                        if (wnd == "protoSempl") // protocollo semplificato
                        {
                            ProtocollazioneIngresso.Registro.RegistroMng regMng = new ProtocollazioneIngresso.Registro.RegistroMng(this);
                            registro = regMng.GetRegistroCorrente();
                        }
                        else
                        {
                            registro = null; // ricerche e profilo
                        }
                    }
                }
                else
                {
                    char[]   sep           = { '_' };
                    string[] datiSelezione = ddlRegRf.SelectedValue.Split(sep);
                    registro.systemId = datiSelezione[0];
                    registro.codice   = ddlRegRf.SelectedItem.Text;
                }

                //DocsPaWR.DocsPaWebService wws = new DocsPaWR.DocsPaWebService();
                //DocsPaWR.Registro reg = wws.GetRegistroBySistemId(registro.systemId);
                if (registro != null && registro.Sospeso)
                {
                    RegisterClientScriptBlock("alertRegistroSospeso", "alert('Il registro selezionato è sospeso!');");
                    return;
                }

                string errMsg = "";
                oggetto = DocumentManager.addOggetto(this, oggetto, registro, ref errMsg);
                if (oggetto != null)
                {
                    ricerca();
                }
                else
                {
                    if (codOgg_enable && ctrl_oggetto.cod_oggetto_text != null && !ctrl_oggetto.cod_oggetto_text.Equals(""))
                    {
                        Response.Write("<script>alert('Oggetto o codice oggetto già presenti');</script>");
                    }
                    else
                    {
                        Response.Write("<script>alert('Oggetto già presente');</script>");
                    }
                }
            }
            catch (Exception es)
            {
                ErrorManager.redirectToErrorPage(this, es);
            }
        }