private void AgregarButton_Click(object sender, RoutedEventArgs e) { orden.OrdenDetalle.Add(new OrdenDetalles(Convert.ToInt32(OrdenId_Text.Text), Convert.ToInt32(ProductoId_Text.Text), Descripcion_Text.Text, Convert.ToDecimal(Cantidad_Text.Text), Convert.ToDecimal(Precio_Text.Text), Convert.ToDecimal(Monto_Text.Text))); orden.MontoTotal += Convert.ToDecimal(Monto_Text.Text); MontoTotal_Text.Text = Convert.ToString(orden.MontoTotal); Actualizar(); ProductoId_Text.Clear(); Descripcion_Text.Clear(); Precio_Text.Clear(); Cantidad_Text.Clear(); Monto_Text.Clear(); ProductoId_Text.Focus(); }
private bool Validar() { bool paso = true; if (Id_Text.Text == String.Empty) { MessageBox.Show("El Id esta Vacio"); Id_Text.Focus(); paso = false; } if (Descripcion_Text.Text == String.Empty) { MessageBox.Show("La Descripcion esta Vacia"); Descripcion_Text.Focus(); paso = false; } if (Existencia_Text.Text == String.Empty) { MessageBox.Show("La Existencia esta Vacia"); Existencia_Text.Focus(); paso = false; } if (Costo_Text.Text == String.Empty) { MessageBox.Show("El Costo esta Vacio"); Costo_Text.Focus(); paso = false; } if (ValorInventario_Text.Text == String.Empty) { MessageBox.Show("El ValorInventario esta Vacio"); ValorInventario_Text.Focus(); paso = false; } return(paso); }