Esempio n. 1
0
        private void AgregarButton_Click(object sender, RoutedEventArgs e)
        {
            llamadas.LlamadasDetalle.Add(new LlamadasDetalle(llamadas.LlamadaId, ProblemaTextBox.Text, SolucionTextBox.Text));

            Cargar();

            ProblemaTextBox.Clear();
            SolucionTextBox.Clear();
            SolucionTextBox.Focus();
        }
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(DescripcionTextBox.Text))
            {
                MessageBox.Show("EL campo Descripcion no puede estar vacio", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                DescripcionTextBox.Focus();
                paso = false;
            }
            if (this.llamadas.Detalles.Count == 0)
            {
                MessageBox.Show("Debe agregar una Llamada", "Aviso", MessageBoxButton.OKCancel, MessageBoxImage.Information);
                ProblemaTextBox.Focus();
                SolucionTextBox.Focus();
                paso = false;
            }
            return(paso);
        }