Ejemplo n.º 1
0
        public override string ToString()
        {
            const int max = 30;

            if (Testo.Length <= max)
            {
                return(Testo);
            }

            return(Testo.Substring(0, 30) + "...");
        }
Ejemplo n.º 2
0
        public InfoDetailPage(Testo testo = null)
        {
            InitializeComponent();
            RegisterWebViewEvents();

            vm             = new InfoDetailViewModel();
            BindingContext = vm;


            if (testo != null)
            {
                vm.Info = testo;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Salvataggio dei dati
        /// </summary>
        public virtual void Save()
        {
            if (Testo.Length > 2000)
            {
                throw new Exception("Il numero di caratteri inseriti per il campo note e superiore al limite massimo");
            }
            else
            {
                if (this.IsDirtyControl)
                {
                    // Se la nota non contiene testo, viene ripristinato il vecchio valore
                    // e viene mostrato un messaggio di errore
                    if (String.IsNullOrEmpty(Testo.Trim()) && this.NoteManager.GetUltimaNota() != null)
                    {
                        this.txtNote.Text = this.NoteManager.GetUltimaNota().Testo;
                        throw new Exception("Attenzione. Non è possibile impostare un testo vuoto per la nota.");
                    }

                    Ruolo ruoloUtente = UserManager.getRuolo();
                    DocsPaWR.Registro[] registriRf = UserManager.getListaRegistriWithRF(ruoloUtente.systemId, "1", "");
                    // verifico se è stata selezionata una nota di RF e se si sia selezionato un RF corretto nel caso di utenti con 2 RF almeno
                    if (registriRf != null && registriRf.Length > 1 && rblTipiVisibilita.SelectedValue.Equals("RF"))
                    {
                        if (this.ddl_regRF.SelectedIndex == 0)
                        {
                            throw new Exception("Attenzione. Selezionare un RF per la Nota");
                        }
                    }


                    // Se i dati risultano modificati, viene creata una nuova nota
                    this.InsertNota();

                    this.newNota = true;

                    this.Fetch();
                }
            }
        }
Ejemplo n.º 4
0
 public void LoadDataSource(string ID, string IDCliente, string IDSessione)
 {
     Testo.Load(ID, IDCliente, IDSessione);
 }