Exemple #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 void AgregarButton_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidarAgregarButton())
            {
                return;
            }

            contenedor.llamada.LlamadasDetalle.Add(new LlamadaDetalle(contenedor.llamada.LlamadaId, ProblemaTextBox.Text, SolucionTextBox.Text));

            Recargar();

            ProblemaTextBox.Clear();
            SolucionTextBox.Clear();
            ProblemaTextBox.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);
        }
        private void AgregarButton_Click(object sender, RoutedEventArgs e)
        {
            if (DetalleDataGrid.ItemsSource != null)
            {
                this.llamadas.Detalles = (List <LlamadasDetalle>)DetalleDataGrid.ItemsSource;
            }

            //Agregar un nuevo detalle con los datos introducidos

            this.llamadas.Detalles.Add(new LlamadasDetalle
            {
                id       = IdTextBox.Text.ToInt(),
                Problema = ProblemaTextBox.Text,
                Solucion = SolucionTextBox.Text,
            });
            Refrescar();
            ProblemaTextBox.Focus();
            ProblemaTextBox.Clear();
            SolucionTextBox.Clear();
        }