361 lines
20 KiB
XML
361 lines
20 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
xmlns:vm="clr-namespace:MIES_System.ViewModels"
|
||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||
x:DataType="vm:ExpedienteViewModel"
|
||
x:Name="ExpedienteControl"
|
||
x:Class="MIES_System.Views.ExpedienteView">
|
||
|
||
<Design.DataContext>
|
||
<vm:ExpedienteViewModel/>
|
||
</Design.DataContext>
|
||
|
||
<Grid Background="#F3F3F3">
|
||
|
||
<!-- CONTENIDO PRINCIPAL -->
|
||
<StackPanel Margin="20" Spacing="15">
|
||
|
||
<!-- HEADER -->
|
||
<StackPanel>
|
||
<TextBlock Text="Expediente de Niños"
|
||
FontSize="24"
|
||
FontWeight="Bold"
|
||
Foreground="#2C3E50"/>
|
||
<TextBlock Text="Gestión de expedientes infantiles"
|
||
FontSize="14"
|
||
Foreground="#7F8C8D"/>
|
||
</StackPanel>
|
||
|
||
<!-- BARRA DE BÚSQUEDA Y BOTONES -->
|
||
<Grid ColumnDefinitions="*, Auto">
|
||
<!-- BARRA DE BÚSQUEDA -->
|
||
<Border Grid.Column="0"
|
||
Background="White"
|
||
CornerRadius="8"
|
||
Padding="10"
|
||
Margin="0,0,10,0">
|
||
<StackPanel Orientation="Horizontal" Spacing="10">
|
||
<TextBlock Text="🔍"
|
||
FontSize="16"
|
||
VerticalAlignment="Center"/>
|
||
<TextBox Text="{Binding TextoBusqueda}"
|
||
Watermark="Buscar por nombre, responsable o localidad..."
|
||
BorderThickness="0"
|
||
Background="Transparent"
|
||
Width="600"/>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<!-- BOTONES DE ACCIÓN -->
|
||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="10">
|
||
<Button Content="➕ Nuevo Niño"
|
||
Command="{Binding NuevoCommand}"
|
||
Background="#27AE60"
|
||
Foreground="White"
|
||
Padding="15 8"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
|
||
<!-- LISTA DE NIÑOS -->
|
||
<Border Background="White"
|
||
CornerRadius="12"
|
||
Padding="0"
|
||
BoxShadow="0 2 8 #00000030">
|
||
|
||
<ListBox ItemsSource="{Binding ListaNinosFiltrados}"
|
||
SelectedItem="{Binding NinoSeleccionado}"
|
||
BorderThickness="0">
|
||
<ListBox.ItemTemplate>
|
||
<DataTemplate>
|
||
<Border Padding="15" Margin="0" Background="White"
|
||
BorderThickness="0 0 0 1" BorderBrush="#ECF0F1">
|
||
<Grid ColumnDefinitions="*, 200, 150, 175">
|
||
<StackPanel Grid.Column="0">
|
||
<TextBlock Text="{Binding Nombre}"
|
||
FontWeight="Bold"
|
||
FontSize="16"
|
||
Foreground="#2C3E50"/>
|
||
<TextBlock Text="{Binding Responsable}"
|
||
FontSize="12"
|
||
Foreground="#7F8C8D"/>
|
||
</StackPanel>
|
||
<TextBlock Grid.Column="1"
|
||
Text="{Binding Localidad}"
|
||
FontSize="12"
|
||
Foreground="#34495E"
|
||
VerticalAlignment="Center"/>
|
||
<TextBlock Grid.Column="2"
|
||
Text="{Binding Edad, StringFormat='{} {0} años'}"
|
||
FontSize="12"
|
||
Foreground="#34495E"
|
||
VerticalAlignment="Center"/>
|
||
|
||
<!-- Columna 4: Botón Editar -->
|
||
<StackPanel Grid.Column="3" Spacing="5" Orientation="Horizontal">
|
||
<Button Content="✏️ Editar"
|
||
Click="Editar"
|
||
Background="#2980B9"
|
||
Foreground="White"
|
||
BorderThickness="0"
|
||
Padding="10 5"
|
||
VerticalAlignment="Center"
|
||
Cursor="Hand">
|
||
<Button.Styles>
|
||
<Style Selector="Button">
|
||
<Setter Property="Background" Value="Transparent"/>
|
||
</Style>
|
||
</Button.Styles>
|
||
</Button>
|
||
|
||
<Button Content="🗑️ Eliminar"
|
||
Click="Eliminar"
|
||
Background="#C62828"
|
||
Foreground="White"
|
||
BorderThickness="0"
|
||
Padding="10 5"
|
||
VerticalAlignment="Center"
|
||
Cursor="Hand">
|
||
<Button.Styles>
|
||
<Style Selector="Button">
|
||
<Setter Property="Background" Value="Transparent"/>
|
||
</Style>
|
||
</Button.Styles>
|
||
</Button>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Border>
|
||
</DataTemplate>
|
||
</ListBox.ItemTemplate>
|
||
</ListBox>
|
||
</Border>
|
||
|
||
</StackPanel>
|
||
|
||
<!-- MODAL DEL FORMULARIO -->
|
||
<Border Background="#80000000"
|
||
IsVisible="{Binding MostrarModal}"
|
||
ZIndex="1000">
|
||
<Border Background="White"
|
||
Width="600"
|
||
Height="750"
|
||
CornerRadius="12"
|
||
Padding="20"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
BoxShadow="0 4 20 #00000050">
|
||
|
||
<StackPanel Spacing="15">
|
||
|
||
<!-- HEADER DEL MODAL -->
|
||
<StackPanel>
|
||
<TextBlock Text="{Binding TituloModal}"
|
||
FontSize="18"
|
||
FontWeight="Bold"
|
||
Foreground="#2C3E50"/>
|
||
<TextBlock Text="Complete la información del expediente"
|
||
FontSize="12"
|
||
Foreground="#7F8C8D"/>
|
||
</StackPanel>
|
||
|
||
<!-- FORMULARIO -->
|
||
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="650">
|
||
<StackPanel Spacing="15">
|
||
|
||
<!-- SECCIÓN 1: INFORMACIÓN DEL NIÑO -->
|
||
<Border Background="#F8F9FA"
|
||
CornerRadius="8"
|
||
Padding="15"
|
||
BorderThickness="1"
|
||
BorderBrush="#E9ECEF">
|
||
<StackPanel Spacing="12">
|
||
<TextBlock Text="👶 INFORMACIÓN DEL NIÑO"
|
||
FontWeight="Bold"
|
||
FontSize="14"
|
||
Foreground="#2C3E50"/>
|
||
|
||
<TextBlock Text="Nombre Completo *" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormNombre}"
|
||
Watermark="Ingrese el nombre completo"/>
|
||
|
||
<Grid ColumnDefinitions="*, 10,*" RowDefinitions="Auto, Auto">
|
||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical">
|
||
<TextBlock Text="Fecha Nacimiento" FontWeight="SemiBold"/>
|
||
<DatePicker SelectedDate="{Binding FormFechaNacimiento}" Width="75"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical">
|
||
<TextBlock Text="Fecha de Ingreso" FontWeight="SemiBold"/>
|
||
<DatePicker SelectedDate="{Binding FormFechaIngreso}"/>
|
||
</StackPanel>
|
||
|
||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical">
|
||
<TextBlock Text="Género" FontWeight="SemiBold"/>
|
||
<ComboBox ItemsSource="{Binding Generos}"
|
||
SelectedItem="{Binding FormGenero}"
|
||
Margin="0,5,0,0"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical">
|
||
<TextBlock Text="Localidad / Colonia" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormLocalidad}"
|
||
Watermark="Localidad de residencia"
|
||
Margin="0,5,0,0"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<!-- SECCIÓN 2: INFORMACIÓN DE LOS PADRES -->
|
||
<Border Background="#F8F9FA"
|
||
CornerRadius="8"
|
||
Padding="15"
|
||
BorderThickness="1"
|
||
BorderBrush="#E9ECEF">
|
||
<StackPanel Spacing="12">
|
||
<TextBlock Text="👨👩👧👦 INFORMACIÓN DE LOS PADRES"
|
||
FontWeight="Bold"
|
||
FontSize="14"
|
||
Foreground="#2C3E50"/>
|
||
|
||
<Grid ColumnDefinitions="*,5, *" RowDefinitions="Auto, Auto, Auto">
|
||
<!-- Fila 1 -->
|
||
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical">
|
||
<TextBlock Text="Nombre del Padre" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormNombrePadre}"
|
||
Watermark="Nombre completo del padre"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical">
|
||
<TextBlock Text="Teléfono del Padre" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormTelefonoPadre}"
|
||
Watermark="Número de teléfono"/>
|
||
</StackPanel>
|
||
|
||
<!-- Fila 2 -->
|
||
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical">
|
||
<TextBlock Text="Nombre de la Madre" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormNombreMadre}"
|
||
Watermark="Nombre completo de la madre"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical">
|
||
<TextBlock Text="Teléfono de la Madre" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormTelefonoMadre}"
|
||
Watermark="Número de teléfono"/>
|
||
</StackPanel>
|
||
|
||
<!-- Fila 3 -->
|
||
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Vertical">
|
||
<TextBlock Text="DUI del Responsable *" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormDui}"
|
||
Watermark="Número de DUI"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Row="2" Grid.Column="2" Orientation="Vertical">
|
||
<TextBlock Text="Nombre del Responsable *" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormResponsable}"
|
||
Watermark="Nombre del responsable"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<!-- SECCIÓN 3: INFORMACIÓN DEL TUTOR -->
|
||
<Border Background="#F8F9FA"
|
||
CornerRadius="8"
|
||
Padding="15"
|
||
BorderThickness="1"
|
||
BorderBrush="#E9ECEF">
|
||
<StackPanel Spacing="12">
|
||
<TextBlock Text="👤 INFORMACIÓN DEL TUTOR O RESPONSABLE ADICIONAL"
|
||
FontWeight="Bold"
|
||
FontSize="14"
|
||
Foreground="#2C3E50"/>
|
||
|
||
<Grid ColumnDefinitions="*,5, *">
|
||
<StackPanel Grid.Column="0" Orientation="Vertical">
|
||
<TextBlock Text="Nombre del Tutor" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormNombreTutor}"
|
||
Watermark="Nombre completo del tutor"/>
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="2" Orientation="Vertical">
|
||
<TextBlock Text="Teléfono del Tutor" FontWeight="SemiBold"/>
|
||
<TextBox Text="{Binding FormTelefonoTutor}"
|
||
Watermark="Número de teléfono del tutor"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
</StackPanel>
|
||
</ScrollViewer>
|
||
|
||
<!-- BOTONES DEL MODAL -->
|
||
<StackPanel Orientation="Horizontal"
|
||
HorizontalAlignment="Right"
|
||
Spacing="10"
|
||
Margin="0 15">
|
||
<Button Content="Cancelar"
|
||
Command="{Binding CancelarCommand}"
|
||
Background="#95A5A6"
|
||
Foreground="White"
|
||
Padding="20 8"/>
|
||
|
||
<Button Content="Guardar"
|
||
Command="{Binding GuardarCommand}"
|
||
Background="#27AE60"
|
||
Foreground="White"
|
||
Padding="20 8"
|
||
IsEnabled="{Binding PuedeGuardar}"/>
|
||
</StackPanel>
|
||
|
||
</StackPanel>
|
||
</Border>
|
||
</Border>
|
||
|
||
<!-- Modal de Confirmación Eliminar -->
|
||
<Border Background="#80000000" IsVisible="{Binding MostrarConfirmacionEliminar}" ZIndex="1001">
|
||
<Border Background="White"
|
||
Width="400"
|
||
Height="200"
|
||
CornerRadius="12"
|
||
Padding="25"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
BoxShadow="0 4 20 #00000050">
|
||
|
||
<StackPanel Spacing="20" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||
<StackPanel HorizontalAlignment="Center">
|
||
<TextBlock Text="⚠️ Confirmar Eliminación"
|
||
FontSize="18"
|
||
FontWeight="Bold"
|
||
Foreground="#C62828"
|
||
HorizontalAlignment="Center"/>
|
||
<TextBlock Text="{Binding NinoAEliminar.Nombre, StringFormat='¿Eliminar a {0}?'}"
|
||
FontSize="14"
|
||
Foreground="#2C3E50"
|
||
HorizontalAlignment="Center"
|
||
TextWrapping="Wrap"/>
|
||
<TextBlock Text="Esta acción no se puede deshacer"
|
||
FontSize="12"
|
||
Foreground="#7F8C8D"
|
||
HorizontalAlignment="Center"/>
|
||
</StackPanel>
|
||
|
||
<StackPanel Orientation="Horizontal" Spacing="15" HorizontalAlignment="Center">
|
||
<Button Content="Cancelar"
|
||
Command="{Binding CancelarEliminacionCommand}"
|
||
Background="#95A5A6"
|
||
Foreground="White"
|
||
Padding="20 8"/>
|
||
|
||
<Button Content="Eliminar"
|
||
Command="{Binding ConfirmarEliminacionCommand}"
|
||
Background="#C62828"
|
||
Foreground="White"
|
||
Padding="20 8"/>
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</Border>
|
||
</Border>
|
||
|
||
</Grid>
|
||
</UserControl>
|