Ejemplo n.º 1
0
        private bool IsUsersConnected(string idGruppoDaSpostare, string idAmm)
        {
            bool retValue = false;

            Manager.OrganigrammaManager manager = new Amministrazione.Manager.OrganigrammaManager();
            manager.ListaUtenti(idGruppoDaSpostare);
            ArrayList listaUtenti = manager.getListaUtenti();

            if (manager.getListaUtenti() != null && manager.getListaUtenti().Count > 0)
            {
                DocsPAWA.DocsPaWR.EsitoOperazione esito = new DocsPAWA.DocsPaWR.EsitoOperazione();

                foreach (DocsPAWA.DocsPaWR.OrgUtente utente in manager.getListaUtenti())
                {
                    manager.VerificaUtenteLoggato(utente.CodiceRubrica, idAmm);
                    esito = manager.getEsitoOperazione();
                    if (esito.Codice > 0)
                    {
                        _listaUtentiConnessi += "- " + utente.Cognome + " " + utente.Nome + "\\n";
                    }
                }
            }

            if (!_listaUtentiConnessi.Equals(string.Empty))
            {
                retValue = true;
            }

            return(retValue);
        }
Ejemplo n.º 2
0
        private void LoadUtentiAttuali()
        {
            try
            {
                Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();

                theManager.ListaUtenti(Request.QueryString["idGruppo"]);

                if (theManager.getListaUtenti() != null && theManager.getListaUtenti().Count > 0)
                {
                    this.dg_utenti.Visible = true;
                    this.lbl_risultatoUtentiRuolo.Visible = false;

                    this.InitializeDataSetUtenti();

                    DataRow row;
                    foreach (SAAdminTool.DocsPaWR.OrgUtente utente in theManager.getListaUtenti())
                    {
                        row                      = dsUtenti.Tables[0].NewRow();
                        row["IDUtente"]          = utente.IDCorrGlobale;
                        row["codice"]            = utente.CodiceRubrica;
                        row["descrizione"]       = utente.Cognome + " " + utente.Nome;
                        row["IDAmministrazione"] = utente.IDAmministrazione;
                        row["IDPeople"]          = utente.IDPeople;

                        dsUtenti.Tables["UTENTI"].Rows.Add(row);
                    }

                    DataView dv = dsUtenti.Tables["UTENTI"].DefaultView;
                    dv.Sort = "descrizione ASC";
                    dg_utenti.DataSource = dv;
                    dg_utenti.DataBind();
                }
                else
                {
                    this.dg_utenti.Visible = false;
                    this.lbl_risultatoUtentiRuolo.Visible = true;
                }
            }
            catch
            {
                this.gestErrori();
            }
        }
Ejemplo n.º 3
0
        private void RicercaUtenti()
        {
            try
            {
                string ricerca = this.txt_ricerca.Text.Trim();

                if ((ricerca != null && ricerca != string.Empty && ricerca != "") || (this.ddl_ricerca.SelectedValue.ToString().Equals("*")))
                {
                    string listaDaEscludere = string.Empty;

                    // prende le IDUtente da escludere nella ricerca
                    if (this.dg_utenti.Items.Count > 0)
                    {
                        foreach (DataGridItem item in this.dg_utenti.Items)
                        {
                            listaDaEscludere += "," + item.Cells[0].Text;
                        }
                        listaDaEscludere = "(" + listaDaEscludere.Substring(1, listaDaEscludere.Length - 1) + ")";
                    }

                    Manager.OrganigrammaManager theManager = new Amministrazione.Manager.OrganigrammaManager();
                    theManager.ListaUtenti(Request.QueryString["idAmm"], this.ddl_ricerca.SelectedValue.ToString(), ricerca, listaDaEscludere);

                    if (theManager.getListaUtenti() != null && theManager.getListaUtenti().Count > 0)
                    {
                        this.dg_utentiTrovati.Visible = true;
                        this.lbl_avviso.Text          = "";

                        this.InitializeDataSetUtenti();

                        DataRow row;
                        foreach (SAAdminTool.DocsPaWR.OrgUtente utente in theManager.getListaUtenti())
                        {
                            row                      = dsUtenti.Tables[0].NewRow();
                            row["IDUtente"]          = utente.IDCorrGlobale;
                            row["codice"]            = utente.CodiceRubrica;
                            row["descrizione"]       = utente.Cognome + " " + utente.Nome;
                            row["IDAmministrazione"] = utente.IDAmministrazione;
                            row["IDPeople"]          = utente.IDPeople;

                            dsUtenti.Tables["UTENTI"].Rows.Add(row);
                        }

                        // Impostazione dataset in sessione
                        this.SetSessionDataSetUtenti(dsUtenti);
                        dg_utentiTrovati.CurrentPageIndex = 0;
                        DataView dv = dsUtenti.Tables["UTENTI"].DefaultView;
                        dv.Sort = "descrizione ASC";
                        this.dg_utentiTrovati.DataSource = dv;
                        this.dg_utentiTrovati.DataBind();
                    }
                    else
                    {
                        this.dg_utentiTrovati.Visible = false;
                        this.lbl_avviso.Text          = "Nessun dato trovato.";
                    }
                }
            }
            catch
            {
                this.gestErrori();
            }
        }