Exemple #1
0
        protected void loadFields()
        {
            InfoUtente infoUtente = UserManager.getInfoUtente(this);

            DocsPaWR.DocsPaWebService    docspaws = ProxyManager.getWS();
            DocsPAWA.DocsPaWR.SearchItem itemOld  = docspaws.RecuperaRicerca(Int32.Parse(idRicercaSalvata));
            txt_titolo.Text    = itemOld.descrizione;
            schedaRicerca.Tipo = itemOld.tipo;
            if (!string.IsNullOrEmpty(itemOld.owner_idPeople.ToString()))
            {
                this.rbl_share.SelectedValue = "usr";
            }
            else
            {
                this.rbl_share.SelectedValue = "grp";
            }

            DocsPAWA.DocsPaWR.Utente userHome  = (DocsPAWA.DocsPaWR.Utente)Session["userData"];
            DocsPAWA.DocsPaWR.Ruolo  userRuolo = (DocsPAWA.DocsPaWR.Ruolo)Session["userRuolo"];

            rbl_share.Items[0].Text = rbl_share.Items[0].Text.Replace("@usr@", userHome.descrizione);
            rbl_share.Items[1].Text = rbl_share.Items[1].Text.Replace("@grp@", userRuolo.descrizione);

            if (schedaRicerca.ProprietaNuovaRicerca.Condivisione == SchedaRicerca.NuovaRicerca.ModoCondivisione.Utente)
            {
                rbl_share.Items[0].Selected = true;
                rbl_share.Items[1].Selected = false;
            }
            else
            {
                rbl_share.Items[0].Selected = false;
                rbl_share.Items[1].Selected = true;
            }

            this.pnl_griglie_custom.Visible = this.showGridPersonalization;
            if (!IsPostBack && this.showGridPersonalization)
            {
                this.ddl_ric_griglie.Items.Clear();
                //Vuol dire c'è una griglia temporanea
                if (GridManager.SelectedGrid != null && string.IsNullOrEmpty(GridManager.SelectedGrid.GridId))
                {
                    ListItem it = new ListItem("Griglia temporanea", "-2");
                    this.ddl_ric_griglie.Items.Add(it);
                }

                string visibility = rbl_share.SelectedValue;
                bool   allGrids   = true;

                if (visibility.Equals("grp"))
                {
                    allGrids = false;
                }

                GridBaseInfo[] listGrid = GridManager.GetGridsBaseInfo(infoUtente, GridManager.SelectedGrid.GridType, allGrids);

                Dictionary <string, GridBaseInfo> tempIdGrid = new Dictionary <string, GridBaseInfo>();

                if (listGrid != null && listGrid.Length > 0)
                {
                    foreach (GridBaseInfo gb in listGrid)
                    {
                        ListItem it = new ListItem(gb.GridName, gb.GridId);
                        this.ddl_ric_griglie.Items.Add(it);
                        tempIdGrid.Add(gb.GridId, gb);
                    }
                    if (!string.IsNullOrEmpty(schedaRicerca.gridId) && tempIdGrid != null && tempIdGrid.Count > 0)
                    {
                        if (tempIdGrid.ContainsKey(schedaRicerca.gridId))
                        {
                            this.ddl_ric_griglie.SelectedValue = schedaRicerca.gridId;
                        }
                    }
                }
            }
        }
Exemple #2
0
        public void Modifica(string type, bool custumGrid, string gridId, Grid tempGrid, GridTypeEnumeration gridType)
        {
            logger.Debug("SchedaRicerca.Modifica");

            try
            {
                DocsPaWR.DocsPaWebService docspaws = ProxyManager.getWS();
                DocsPaWR.SearchItem       item     = new DocsPAWA.DocsPaWR.SearchItem();
                item.system_id   = nuovaRic.Id;
                item.descrizione = nuovaRic.Titolo;
                item.tipo        = this.tipo;

                switch (nuovaRic.Condivisione)
                {
                case NuovaRicerca.ModoCondivisione.Utente:
                    item.owner_idPeople = Int32.Parse(this.utente.idPeople);
                    break;

                case NuovaRicerca.ModoCondivisione.Ruolo:
                    item.owner_idGruppo = Int32.Parse(this.ruolo.idGruppo);
                    break;

                default:
                    break;
                }

                if (string.IsNullOrEmpty(this._searchKey))
                {
                    item.pagina = this.currentPg.ToString();
                }
                else
                {
                    item.pagina = this._searchKey;
                }

                logger.Debug("SchedaRicerca.Modifica - Serializzazione dei filtri");
                item.filtri = SchedaRicerca.FiltersToString(this.filters);
                logger.Debug("SchedaRicerca.Modifica - Filtri serializzati");

                logger.Debug("SchedaRicerca.Modifica - Sto per modificare la ricerca: " + item.ToString());

                DocsPaWR.InfoUtente infoUtente = UserManager.getInfoUtente();

                item = docspaws.ModificaRicerca(item, infoUtente, custumGrid, gridId, tempGrid, gridType);

                if (custumGrid)
                {
                    if (!string.IsNullOrEmpty(item.gridId))
                    {
                        GridManager.SelectedGrid = GridManager.GetGridFromSearchId(item.gridId, gridType);
                    }
                }

                logger.Debug("SchedaRicerca.Modifica - Ricerca salvata");
            }
            catch (Exception ex)
            {
                logger.Debug("SchedaRicerca.Salva - Errore nel salvataggio della ricerca: " + ex.Message);
                throw ex;
            }
        }