Primeiro commit do projeto
21
.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Build
|
||||
bin/
|
||||
obj/
|
||||
|
||||
# Visual Studio
|
||||
.vs/
|
||||
*.user
|
||||
*.suo
|
||||
|
||||
# Rider / VSCode (opcional)
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
# Arquivos temporários
|
||||
*.tmp
|
||||
|
||||
# Windows
|
||||
Thumbs.db
|
||||
9
App.xaml
Normal file
@ -0,0 +1,9 @@
|
||||
<Application x:Class="UI.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:UI"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
14
App.xaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Windows;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
10
AssemblyInfo.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
BIN
Assets/Images/Logo_simples.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
Assets/Images/avatar_user.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
Assets/Images/background_preview.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
Assets/Images/background_texture.png
Normal file
|
After Width: | Height: | Size: 540 KiB |
BIN
Assets/Images/icon_email.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
Assets/Images/icon_eye.png
Normal file
|
After Width: | Height: | Size: 457 B |
BIN
Assets/Images/icon_password.png
Normal file
|
After Width: | Height: | Size: 465 B |
BIN
Assets/Images/logo_levelcode.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
43
Assets/Images/logo_levelcode.svg
Normal file
@ -0,0 +1,43 @@
|
||||
<svg viewBox="0 0 420 200" width="420" height="200" xmlns="http://www.w3.org/2000/svg" font-family="Segoe UI, sans-serif">
|
||||
<defs>
|
||||
<linearGradient id="g1" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#60A5FA"/>
|
||||
<stop offset="100%" stop-color="#1D4ED8"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="g2" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#93C5FD"/>
|
||||
<stop offset="100%" stop-color="#3B82F6"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="g3" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#3B82F6"/>
|
||||
<stop offset="100%" stop-color="#1E40AF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="g4" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#2563EB"/>
|
||||
<stop offset="100%" stop-color="#1E3A8A"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<!-- 4 losangos formando o ícone diamante -->
|
||||
<polygon points="70,20 100,50 70,80 40,50" fill="url(#g2)"/>
|
||||
<polygon points="40,50 70,80 40,110 10,80" fill="url(#g3)"/>
|
||||
<polygon points="100,50 130,80 100,110 70,80" fill="url(#g1)"/>
|
||||
<polygon points="70,80 100,110 70,140 40,110" fill="url(#g4)"/>
|
||||
|
||||
<!-- brilho sutil -->
|
||||
<polygon points="70,24 96,48 70,72 44,48" fill="white" opacity="0.08"/>
|
||||
|
||||
<!-- nome -->
|
||||
<text x="150" y="90" font-size="38" font-weight="700" font-family="Segoe UI, sans-serif">
|
||||
<tspan fill="#FFFFFF">Levelcode</tspan><tspan fill="#3B82F6" dx="8">SGI</tspan>
|
||||
</text>
|
||||
|
||||
<!-- subtítulo -->
|
||||
<text x="151" y="114" font-size="11" fill="#64748B" letter-spacing="3"
|
||||
font-family="Segoe UI, sans-serif" font-weight="400">SISTEMA DE GESTÃO INTEGRADO</text>
|
||||
|
||||
<!-- linha decorativa -->
|
||||
<rect x="151" y="124" width="50" height="2" rx="1" fill="#3B82F6" opacity="0.7"/>
|
||||
<rect x="207" y="124" width="18" height="2" rx="1" fill="#3B82F6" opacity="0.35"/>
|
||||
<rect x="231" y="124" width="7" height="2" rx="1" fill="#3B82F6" opacity="0.15"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Assets/Images/logo_levelcode2.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
786
Cadastro/FrmCadastroClientes.xaml
Normal file
@ -0,0 +1,786 @@
|
||||
<Window x:Class="UI.Cadastro.FrmCadastroClientes"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="CanResize"
|
||||
WindowStyle="None"
|
||||
Height="950" Width="1480"
|
||||
MinHeight="800" MinWidth="1100"
|
||||
Background="#0D1117">
|
||||
|
||||
<Window.Resources>
|
||||
|
||||
<SolidColorBrush x:Key="BgBase" Color="#0D1117"/>
|
||||
<SolidColorBrush x:Key="BgCard" Color="#111827"/>
|
||||
<SolidColorBrush x:Key="BgInput" Color="#1A2235"/>
|
||||
<SolidColorBrush x:Key="BorderSubtle" Color="#1E2D4A"/>
|
||||
<SolidColorBrush x:Key="TextPrimary" Color="#F1F5F9"/>
|
||||
<SolidColorBrush x:Key="TextMuted" Color="#64748B"/>
|
||||
|
||||
<!-- LABEL -->
|
||||
<Style x:Key="FieldLabel" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#94A3B8"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Margin" Value="0 0 0 6"/>
|
||||
</Style>
|
||||
|
||||
<!-- ASTERISCO OBRIGATÓRIO -->
|
||||
<Style x:Key="RequiredStar" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#EF4444"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Margin" Value="2 0 0 6"/>
|
||||
</Style>
|
||||
|
||||
<!-- TEXTBOX -->
|
||||
<Style x:Key="InputStyle" TargetType="TextBox">
|
||||
<Setter Property="Background" Value="#1A2235"/>
|
||||
<Setter Property="Foreground" Value="#64748B"/>
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CaretBrush" Value="#3B82F6"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Height" Value="40"/>
|
||||
<Setter Property="Padding" Value="12 0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Border x:Name="bd"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8">
|
||||
<ScrollViewer x:Name="PART_ContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#3B82F6"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#2D4A7A"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- COMBOBOX -->
|
||||
<Style x:Key="ComboStyle" TargetType="ComboBox">
|
||||
<Setter Property="Background" Value="#1A2235"/>
|
||||
<Setter Property="Foreground" Value="#CBD5E1"/>
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Height" Value="40"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Border x:Name="bd"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="36"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
Margin="12 0 0 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="1" Text="▾" Foreground="#64748B"
|
||||
FontSize="12" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<Popup x:Name="Popup" Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True" Focusable="False">
|
||||
<Border Background="#1A2235" BorderBrush="#1E2D4A"
|
||||
BorderThickness="1" CornerRadius="8"
|
||||
MinWidth="{TemplateBinding ActualWidth}">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="#000" Opacity="0.5"
|
||||
BlurRadius="16" ShadowDepth="4"/>
|
||||
</Border.Effect>
|
||||
<ItemsPresenter/>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#3B82F6"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- RADIOBUTTON -->
|
||||
<Style x:Key="RadioStyle" TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="#CBD5E1"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Border x:Name="circle" Width="18" Height="18"
|
||||
CornerRadius="9" BorderThickness="2"
|
||||
BorderBrush="#334155" Background="Transparent">
|
||||
<Ellipse x:Name="dot" Width="8" Height="8"
|
||||
Fill="#3B82F6" Visibility="Collapsed"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ContentPresenter Margin="8 0 0 0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="circle" Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter TargetName="dot" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- BOTÃO PRIMÁRIO -->
|
||||
<Style x:Key="BtnPrimary" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Height" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" CornerRadius="10"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.85"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.7"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- BOTÃO OUTLINE -->
|
||||
<Style x:Key="BtnOutline" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="#94A3B8"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="Background" Value="#111827"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Height" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" CornerRadius="10"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Foreground" Value="#F1F5F9"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- SIDEBAR BTN -->
|
||||
<Style x:Key="SidebarBtn" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Height" Value="44"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" Background="{TemplateBinding Background}"
|
||||
CornerRadius="10" Padding="12 0">
|
||||
<ContentPresenter VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Background" Value="#111827"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SidebarBtnActive" TargetType="Button" BasedOn="{StaticResource SidebarBtn}">
|
||||
<Setter Property="Background" Value="#162035"/>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="56"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ══════════════════════════════════ -->
|
||||
<!-- TOP BAR -->
|
||||
<!-- ══════════════════════════════════ -->
|
||||
<Border Grid.Row="0" BorderThickness="0 0 0 1" BorderBrush="#1E2D4A">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#0A1020" Offset="0"/>
|
||||
<GradientStop Color="#0D1117" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
|
||||
</Border.Background>
|
||||
<Grid Margin="20 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="220"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Logo -->
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Viewbox Width="26" Height="26">
|
||||
<Grid Width="100" Height="100">
|
||||
<Path Fill="#3B82F6">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="50,5" IsClosed="True">
|
||||
<LineSegment Point="78,33"/>
|
||||
<LineSegment Point="50,47"/>
|
||||
<LineSegment Point="22,33"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<Path Fill="#60A5FA">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="53,50" IsClosed="True">
|
||||
<LineSegment Point="78,33"/>
|
||||
<LineSegment Point="95,50"/>
|
||||
<LineSegment Point="78,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<Path Fill="#2563EB">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="50,53" IsClosed="True">
|
||||
<LineSegment Point="78,67"/>
|
||||
<LineSegment Point="50,95"/>
|
||||
<LineSegment Point="22,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<Path Fill="#3B82F6">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="47,50" IsClosed="True">
|
||||
<LineSegment Point="22,33"/>
|
||||
<LineSegment Point="5,50"/>
|
||||
<LineSegment Point="22,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
<TextBlock Text="Levelcode SGI" Foreground="White" FontSize="17"
|
||||
FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Search -->
|
||||
<Border Grid.Column="1" Background="#111827" BorderBrush="#1E2D4A"
|
||||
BorderThickness="1" CornerRadius="10" Height="36"
|
||||
MaxWidth="380" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<StackPanel Orientation="Horizontal" Margin="12 0">
|
||||
<TextBlock Text="🔍" FontSize="13" Foreground="#334155"
|
||||
VerticalAlignment="Center" Margin="0 0 8 0"/>
|
||||
<TextBlock Text="Pesquisar..." Foreground="#334155"
|
||||
FontSize="13" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Direita -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal"
|
||||
VerticalAlignment="Center" Margin="0 0 4 0">
|
||||
<Grid Width="36" Height="36" Margin="0 0 6 0" Cursor="Hand">
|
||||
<Border CornerRadius="9" Background="#111827" BorderBrush="#1E2D4A" BorderThickness="1"/>
|
||||
<TextBlock Text="🔔" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Border Width="16" Height="16" CornerRadius="8" Background="#EF4444"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -4 -4 0">
|
||||
<TextBlock Text="3" Foreground="White" FontSize="9" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<Border Width="36" Height="36" CornerRadius="9" Background="#111827"
|
||||
BorderBrush="#1E2D4A" BorderThickness="1" Cursor="Hand" Margin="0 0 10 0">
|
||||
<Path Fill="#64748B" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Width="16" Height="16" Stretch="Uniform"
|
||||
Data="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94zM12,15.6c-1.98,0-3.6-1.62-3.6-3.6s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
|
||||
</Border>
|
||||
<Border CornerRadius="10" Background="#111827" BorderBrush="#1E2D4A"
|
||||
BorderThickness="1" Padding="10 0 12 0" Height="36" Cursor="Hand">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border Width="26" Height="26" CornerRadius="13" Background="#1E3A5F">
|
||||
<TextBlock Text="A" Foreground="#60A5FA" FontSize="12" FontWeight="Bold"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Name="lblUsserName" Text="Administrador" Foreground="#CBD5E1" FontSize="13"
|
||||
Margin="8 0 6 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="▾" Foreground="#334155" FontSize="10" VerticalAlignment="Center"/>
|
||||
|
||||
<!-- BOTÃO SAIR -->
|
||||
<Button Height="38"
|
||||
Padding="12 0"
|
||||
Style="{StaticResource BtnOutline}"
|
||||
Click="BtnSair_Click">
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="" FontSize="13"
|
||||
Margin="0 0 12 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Sair" FontSize="12" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ══════════════════════════════════ -->
|
||||
<!-- BODY -->
|
||||
<!-- ══════════════════════════════════ -->
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="190"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- SIDEBAR -->
|
||||
<Border BorderThickness="0 0 1 0" BorderBrush="#1E2D4A">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#0A1020" Offset="0"/>
|
||||
<GradientStop Color="#0D1117" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Margin="12 16 12 0">
|
||||
<Button Style="{StaticResource SidebarBtn}" Margin="0 0 0 2">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="⊞" FontSize="16" Width="28" TextAlignment="Center"
|
||||
Margin="0 0 10 0" Foreground="#64748B" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Dashboard" Foreground="#64748B" FontSize="14" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Style="{StaticResource SidebarBtnActive}" Margin="0 0 0 2">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border Width="28" Height="28" CornerRadius="8" Background="#1A3A6E" Margin="0 0 10 0">
|
||||
<TextBlock Text="👤" FontSize="13" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Pessoas" Foreground="#F1F5F9" FontWeight="SemiBold"
|
||||
FontSize="14" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Style="{StaticResource SidebarBtn}" Margin="0 0 0 2">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="📋" FontSize="14" Width="28" TextAlignment="Center"
|
||||
Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Relatórios" Foreground="#64748B" FontSize="14" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Style="{StaticResource SidebarBtn}" Margin="0 0 0 2">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="⚙" FontSize="14" Width="28" TextAlignment="Center"
|
||||
Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Configurações" Foreground="#64748B" FontSize="14" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Style="{StaticResource SidebarBtn}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="❓" FontSize="14" Width="28" TextAlignment="Center"
|
||||
Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Ajuda" Foreground="#64748B" FontSize="14" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Margin="16 0 16 16">
|
||||
<Rectangle Height="1" Fill="#1E2D4A" Margin="0 0 0 12"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 4">
|
||||
<Ellipse Width="8" Height="8" Fill="#22C55E" Margin="0 0 6 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Usuários Ativos" Foreground="#334155" FontSize="12"/>
|
||||
</StackPanel>
|
||||
<TextBlock Foreground="#22C55E" FontSize="14" FontWeight="Bold" Margin="14 0 0 0">
|
||||
<Run Text="1 "/><Run Text="Online" FontWeight="Normal"/>
|
||||
</TextBlock>
|
||||
<TextBlock Text="© 2024 Levelcode" Foreground="#1E2D4A" FontSize="11" Margin="0 10 0 0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ══════════════════════════════════ -->
|
||||
<!-- CONTEÚDO PRINCIPAL -->
|
||||
<!-- ══════════════════════════════════ -->
|
||||
<ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto" Background="#0D1117">
|
||||
<StackPanel Margin="24 20 24 24">
|
||||
|
||||
<!-- Breadcrumb -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 14">
|
||||
<TextBlock Text="‹" Foreground="#64748B" FontSize="16"
|
||||
VerticalAlignment="Center" Margin="0 0 6 0" Cursor="Hand"/>
|
||||
<TextBlock Text="Dashboard" Foreground="#64748B" FontSize="13"
|
||||
VerticalAlignment="Center" Cursor="Hand"/>
|
||||
<TextBlock Text=" › " Foreground="#334155" FontSize="13" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Cadastro Pessoal" Foreground="#F1F5F9"
|
||||
FontSize="13" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Título -->
|
||||
<TextBlock Text="Cadastro Pessoal" Foreground="#F1F5F9"
|
||||
FontSize="22" FontWeight="Bold" Margin="0 0 0 20"/>
|
||||
|
||||
<!-- ══ CARD PRINCIPAL ══ -->
|
||||
<Border CornerRadius="14" BorderThickness="1" BorderBrush="#1E2D4A" Padding="24">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0F1A2E" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
|
||||
<!-- Layout: coluna esquerda (foto+dados) | coluna direita (form) -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="230"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ─────────────────────────────── -->
|
||||
<!-- COLUNA ESQUERDA -->
|
||||
<!-- ─────────────────────────────── -->
|
||||
<StackPanel Margin="0 0 28 0">
|
||||
|
||||
<!-- Upload de foto -->
|
||||
<Border Height="190" CornerRadius="12" BorderThickness="1.5"
|
||||
BorderBrush="#1E2D4A" Background="#0D1525"
|
||||
Cursor="Hand" Margin="0 0 0 20">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid>
|
||||
<Rectangle StrokeDashArray="6 3" StrokeThickness="1.5"
|
||||
Stroke="#334155" Margin="8" RadiusX="8" RadiusY="8"/>
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Grid Width="54" Height="54" HorizontalAlignment="Center" Margin="0 0 0 6">
|
||||
<Border Width="54" Height="54" CornerRadius="27" Background="#1A2235"/>
|
||||
<Path Fill="#64748B" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" Width="26" Height="26"
|
||||
Stretch="Uniform"
|
||||
Data="M12 15.2A3.2 3.2 0 0 1 8.8 12 3.2 3.2 0 0 1 12 8.8 3.2 3.2 0 0 1 15.2 12 3.2 3.2 0 0 1 12 15.2M9 2L7.17 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6C22 4.9 21.1 4 20 4H16.83L15 2H9Z"/>
|
||||
<Border Width="20" Height="20" CornerRadius="10"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
Margin="0 0 -3 -3">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<TextBlock Text="+" Foreground="White" FontSize="14"
|
||||
FontWeight="Bold" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Telefone -->
|
||||
<TextBlock Text="Telefone" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBox x:Name="TxtTelefone" Style="{StaticResource InputStyle}"
|
||||
Text="(xx)-xxxxx-xxxx" Margin="0 0 0 16"/>
|
||||
|
||||
<!-- Data de Nascimento -->
|
||||
<TextBlock Text="Data de Nascimento" Style="{StaticResource FieldLabel}"/>
|
||||
<Border Background="#1A2235" BorderBrush="#1E2D4A" BorderThickness="1"
|
||||
CornerRadius="8" Height="40" Margin="0 0 0 16" Cursor="Hand">
|
||||
<Grid Margin="12 0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="28"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="dd/mm/aaaa" Foreground="#64748B"
|
||||
FontSize="13" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="1" Text="📅" FontSize="14"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Sexo vertical -->
|
||||
<TextBlock Text="Sexo" Style="{StaticResource FieldLabel}"/>
|
||||
<StackPanel Margin="0 4 0 0">
|
||||
<RadioButton Content="Masculino" Style="{StaticResource RadioStyle}"
|
||||
IsChecked="True" GroupName="SexoEsq" Margin="0 0 0 10"/>
|
||||
<RadioButton Content="Feminino" Style="{StaticResource RadioStyle}"
|
||||
GroupName="SexoEsq" Margin="0 0 0 10"/>
|
||||
<RadioButton Content="Outro" Style="{StaticResource RadioStyle}"
|
||||
GroupName="SexoEsq"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ─────────────────────────────── -->
|
||||
<!-- COLUNA DIREITA: StackPanel -->
|
||||
<!-- (evita o Height="*" colapsando) -->
|
||||
<!-- ─────────────────────────────── -->
|
||||
<StackPanel Grid.Column="1">
|
||||
|
||||
<!-- Row A: Nome Completo + CEP -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="220"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0 0 16 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Nome Completo" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBlock Text=" *" Style="{StaticResource RequiredStar}"/>
|
||||
</StackPanel>
|
||||
<TextBox x:Name="TxtNome" Style="{StaticResource InputStyle}"
|
||||
Text="Digite o nome completo"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="CEP" Style="{StaticResource FieldLabel}"/>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="TxtCep" Style="{StaticResource InputStyle}"
|
||||
Text="xxxxx-xxxx" Margin="0 0 8 0"/>
|
||||
<Button Grid.Column="1" Content="Buscar"
|
||||
Style="{StaticResource BtnPrimary}" Height="40" Padding="0">
|
||||
<Button.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Button.Background>
|
||||
</Button>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Row B: Email + Endereço -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="220"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0 0 16 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Email" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBlock Text=" *" Style="{StaticResource RequiredStar}"/>
|
||||
</StackPanel>
|
||||
<TextBox x:Name="TxtEmail" Style="{StaticResource InputStyle}"
|
||||
Text="exemplo@email.com"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="Endereço" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBox x:Name="TxtEndereco" Style="{StaticResource InputStyle}"
|
||||
Text="Rua São Paulo, 123" Foreground="#CBD5E1"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Row C: Sexo (horizontal) + Número + Bairro -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="106"/>
|
||||
<ColumnDefinition Width="114"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0 0 16 0">
|
||||
<TextBlock Text="Sexo" Style="{StaticResource FieldLabel}"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 6 0 0">
|
||||
<RadioButton Content="Masculino" Style="{StaticResource RadioStyle}"
|
||||
IsChecked="True" GroupName="SexoDir" Margin="0 0 18 0"/>
|
||||
<RadioButton Content="Feminino" Style="{StaticResource RadioStyle}"
|
||||
GroupName="SexoDir" Margin="0 0 18 0"/>
|
||||
<RadioButton Content="Outro" Style="{StaticResource RadioStyle}"
|
||||
GroupName="SexoDir"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Margin="0 0 10 0">
|
||||
<TextBlock Text="Número" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBox x:Name="TxtNumero" Style="{StaticResource InputStyle}"
|
||||
Text="123" Foreground="#CBD5E1"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="Bairro" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBox x:Name="TxtBairro" Style="{StaticResource InputStyle}"
|
||||
Text="Centro" Foreground="#CBD5E1"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Row D: CEP (form) + Cidade -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="220"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0 0 16 0">
|
||||
<TextBlock Text="CEP" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBox x:Name="TxtCep2" Style="{StaticResource InputStyle}"
|
||||
Text="xxxxx-xxxx"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="Cidade" Style="{StaticResource FieldLabel}"/>
|
||||
<ComboBox x:Name="CmbCidade" Style="{StaticResource ComboStyle}">
|
||||
<ComboBoxItem Content="São Paulo" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Rio de Janeiro"/>
|
||||
<ComboBoxItem Content="Belo Horizonte"/>
|
||||
<ComboBoxItem Content="Curitiba"/>
|
||||
<ComboBoxItem Content="Fortaleza"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Row E: Cargo + Estado -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="220"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0 0 16 0">
|
||||
<TextBlock Text="Cargo" Style="{StaticResource FieldLabel}"/>
|
||||
<TextBox x:Name="TxtCargo" Style="{StaticResource InputStyle}"
|
||||
Text="Analista de Sistemas" Foreground="#CBD5E1"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="Estado" Style="{StaticResource FieldLabel}"/>
|
||||
<ComboBox x:Name="CmbEstado" Style="{StaticResource ComboStyle}">
|
||||
<ComboBoxItem Content="São Paulo" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Rio de Janeiro"/>
|
||||
<ComboBoxItem Content="Minas Gerais"/>
|
||||
<ComboBoxItem Content="Paraná"/>
|
||||
<ComboBoxItem Content="Bahia"/>
|
||||
<ComboBoxItem Content="Ceará"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Row F: Data de Cadastro -->
|
||||
<StackPanel HorizontalAlignment="Left" Width="210" Margin="0 0 0 32">
|
||||
<TextBlock Text="Data de Cadastro" Style="{StaticResource FieldLabel}"/>
|
||||
<Border Background="#1A2235" BorderBrush="#1E2D4A"
|
||||
BorderThickness="1" CornerRadius="8" Height="40">
|
||||
<StackPanel Orientation="Horizontal" Margin="12 0">
|
||||
<TextBlock Text="📅" FontSize="13" Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock x:Name="TxtDataCadastro" Text="24/04/2024"
|
||||
Foreground="#CBD5E1" FontSize="13"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ✅ BOTÕES — dentro do StackPanel, sempre visíveis -->
|
||||
<Border BorderThickness="0 1 0 0" BorderBrush="#1E2D4A" Padding="0 20 0 0">
|
||||
<Grid HorizontalAlignment="Right">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180"/>
|
||||
<ColumnDefinition Width="130"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Salvar Pessoa -->
|
||||
<Button x:Name="BtnSalvar"
|
||||
Style="{StaticResource BtnPrimary}"
|
||||
Padding="0" Margin="0 0 12 0">
|
||||
<Button.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Button.Background>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Path Fill="White" Width="14" Height="14"
|
||||
Stretch="Uniform" Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"
|
||||
Data="M17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V7L17 3M19 19H5V5H16.17L19 7.83V19M12 12C10.34 12 9 13.34 9 15S10.34 18 12 18 15 16.66 15 15 13.66 12 12 12M6 6H15V10H6V6Z"/>
|
||||
<TextBlock Text="Salvar cadastro" FontSize="14"
|
||||
FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<!-- Limpar -->
|
||||
<Button x:Name="BtnLimpar" Grid.Column="1"
|
||||
Style="{StaticResource BtnOutline}" Padding="0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Path Fill="#94A3B8" Width="13" Height="13"
|
||||
Stretch="Uniform" Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"
|
||||
Data="M17 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V7L17 3M19 19H5V5H16.17L19 7.83V19M12 12C10.34 12 9 13.34 9 15S10.34 18 12 18 15 16.66 15 15 13.66 12 12 12M6 6H15V10H6V6Z"/>
|
||||
<TextBlock Text="Limpar" FontSize="13"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</StackPanel>
|
||||
<!-- fim coluna direita -->
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- fim card -->
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
32
Cadastro/FrmCadastroClientes.xaml.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace UI.Cadastro
|
||||
{
|
||||
/// <summary>
|
||||
/// Lógica interna para FrmCadastroClientes.xaml
|
||||
/// </summary>
|
||||
public partial class FrmCadastroClientes : Window
|
||||
{
|
||||
public FrmCadastroClientes()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BtnSair_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
707
Configuracao/ConfiguracaoBanco.xaml
Normal file
@ -0,0 +1,707 @@
|
||||
<Window x:Class="UI.Configuracao.ConfiguracaoBanco"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="NoResize"
|
||||
WindowStyle="None"
|
||||
Height="600"
|
||||
Width="800"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
MouseDown="Window_MouseDown">
|
||||
|
||||
<Window.Resources>
|
||||
|
||||
<!-- Estilo TextBox padrão -->
|
||||
<Style x:Key="InputStyle" TargetType="TextBox">
|
||||
<Setter Property="Background" Value="#1E2D4A"/>
|
||||
<Setter Property="Foreground" Value="#CBD5E1"/>
|
||||
<Setter Property="BorderBrush" Value="#2E4270"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Height" Value="42"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="CaretBrush" Value="White"/>
|
||||
<Setter Property="Padding" Value="10 0 0 0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8">
|
||||
<ScrollViewer x:Name="PART_ContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Estilo PasswordBox -->
|
||||
<Style x:Key="PasswordStyle" TargetType="PasswordBox">
|
||||
<Setter Property="Background" Value="#1E2D4A"/>
|
||||
<Setter Property="Foreground" Value="#CBD5E1"/>
|
||||
<Setter Property="BorderBrush" Value="#2E4270"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Height" Value="42"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="CaretBrush" Value="White"/>
|
||||
<Setter Property="Padding" Value="10 0 0 0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="PasswordBox">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8">
|
||||
<ScrollViewer x:Name="PART_ContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsFocused" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Estilo ComboBox -->
|
||||
<Style x:Key="ComboStyle" TargetType="ComboBox">
|
||||
<Setter Property="Background" Value="#1E2D4A"/>
|
||||
<Setter Property="Foreground" Value="#CBD5E1"/>
|
||||
<Setter Property="BorderBrush" Value="#2E4270"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Height" Value="42"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Padding" Value="10 0 0 0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="36"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter Grid.Column="0"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
Margin="12 0 0 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<Path Grid.Column="1"
|
||||
Data="M0,0 L6,6 L12,0"
|
||||
Stroke="#64748B"
|
||||
StrokeThickness="1.5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Fill="Transparent"/>
|
||||
<Popup x:Name="PART_Popup"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Placement="Bottom"
|
||||
PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<Border Background="#1A2540"
|
||||
BorderBrush="#2E4270"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8"
|
||||
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ComboBox}}">
|
||||
<ItemsPresenter/>
|
||||
</Border>
|
||||
</Popup>
|
||||
<ToggleButton Grid.ColumnSpan="2"
|
||||
IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Resources>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="Foreground" Value="#CBD5E1"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Padding" Value="12 8"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#2C395B"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#1D4ED8"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
|
||||
<!-- Estilo botão primário -->
|
||||
<Style x:Key="BtnPrimary" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Height" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
CornerRadius="8"
|
||||
Height="{TemplateBinding Height}">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#2563EB" Offset="0"/>
|
||||
<GradientStop Color="#1D4ED8" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.85"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.7"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Estilo botão secundário -->
|
||||
<Style x:Key="BtnSecondary" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="#94A3B8"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#2E4270"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Height" Value="44"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
Background="#1E2D4A"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8"
|
||||
Height="{TemplateBinding Height}">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#263550"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Opacity" Value="0.7"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Toggle Switch style -->
|
||||
<Style x:Key="ToggleStyle" TargetType="ToggleButton">
|
||||
<Setter Property="Width" Value="50"/>
|
||||
<Setter Property="Height" Value="26"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<Border x:Name="track"
|
||||
CornerRadius="13"
|
||||
Background="#2E4270"/>
|
||||
<Ellipse x:Name="thumb"
|
||||
Width="20" Height="20"
|
||||
Fill="White"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="3 0 0 0"
|
||||
VerticalAlignment="Center">
|
||||
<Ellipse.RenderTransform>
|
||||
<TranslateTransform x:Name="thumbTranslate" X="0"/>
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="track" Property="Background" Value="#2563EB"/>
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="thumbTranslate"
|
||||
Storyboard.TargetProperty="X"
|
||||
To="24" Duration="0:0:0.15"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="thumbTranslate"
|
||||
Storyboard.TargetProperty="X"
|
||||
To="0" Duration="0:0:0.15"/>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<!-- Sombra externa -->
|
||||
<Border CornerRadius="14" Margin="10">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="#000000" Opacity="0.6" BlurRadius="30" ShadowDepth="6"/>
|
||||
</Border.Effect>
|
||||
|
||||
<Border CornerRadius="14" ClipToBounds="True">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1A2D50" Offset="0"/>
|
||||
<GradientStop Color="#142240" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="54"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="68"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ===== TÍTULO ===== -->
|
||||
<Border Grid.Row="0"
|
||||
BorderBrush="#1E3A6A"
|
||||
BorderThickness="0 0 0 1">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1A2D50" Offset="0"/>
|
||||
<GradientStop Color="#162540" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
|
||||
<Grid Margin="20 0">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<Viewbox Width="26" Height="26" Margin="0 0 10 0">
|
||||
<Canvas Width="100" Height="100">
|
||||
<Ellipse Canvas.Left="10" Canvas.Top="5" Width="60" Height="20" Fill="#4A90D9"/>
|
||||
<Rectangle Canvas.Left="10" Canvas.Top="14" Width="60" Height="35" Fill="#3A7AC8"/>
|
||||
<Ellipse Canvas.Left="10" Canvas.Top="34" Width="60" Height="18" Fill="#4A90D9"/>
|
||||
<Rectangle Canvas.Left="10" Canvas.Top="42" Width="60" Height="25" Fill="#3A7AC8"/>
|
||||
<Ellipse Canvas.Left="10" Canvas.Top="54" Width="60" Height="18" Fill="#4A90D9"/>
|
||||
<Ellipse Canvas.Left="50" Canvas.Top="52" Width="44" Height="44" Fill="#1A2D50"/>
|
||||
<Path Canvas.Left="52" Canvas.Top="54" Fill="#7CB9F0" Width="40" Height="40" Stretch="Uniform"
|
||||
Data="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<TextBlock Text="Conexão com Banco de Dados"
|
||||
Foreground="White"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Botão fechar -->
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center">
|
||||
<Button Width="32" Height="32"
|
||||
Cursor="Hand"
|
||||
Click="BtnFechar_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="b" Background="#1E2D4A"
|
||||
BorderBrush="#2E4270" BorderThickness="1"
|
||||
CornerRadius="6">
|
||||
<TextBlock Text="✕" FontSize="13"
|
||||
Foreground="#94A3B8"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="b" Property="Background" Value="#E53E3E"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ===== CONTEÚDO ===== -->
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="30 24 30 16">
|
||||
|
||||
<!-- SGBD + ícone -->
|
||||
<Grid Margin="0 0 0 24">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Viewbox Width="72" Height="72" Margin="0 0 20 0" VerticalAlignment="Center">
|
||||
<Canvas Width="100" Height="100">
|
||||
<Ellipse Canvas.Left="10" Canvas.Top="5" Width="60" Height="20" Fill="#5BA3E0"/>
|
||||
<Rectangle Canvas.Left="10" Canvas.Top="14" Width="60" Height="30" Fill="#4A8ED0"/>
|
||||
<Ellipse Canvas.Left="10" Canvas.Top="30" Width="60" Height="18" Fill="#5BA3E0"/>
|
||||
<Rectangle Canvas.Left="10" Canvas.Top="38" Width="60" Height="25" Fill="#4A8ED0"/>
|
||||
<Ellipse Canvas.Left="10" Canvas.Top="50" Width="60" Height="18" Fill="#5BA3E0"/>
|
||||
<Ellipse Canvas.Left="48" Canvas.Top="50" Width="46" Height="46" Fill="#1A2D50"/>
|
||||
<Path Canvas.Left="50" Canvas.Top="52" Fill="#7CB9F0" Width="42" Height="42" Stretch="Uniform"
|
||||
Data="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94zM12,15.6c-1.98,0-3.6-1.62-3.6-3.6s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<TextBlock Text="SGBD"
|
||||
Foreground="#94A3B8"
|
||||
FontSize="12"
|
||||
Margin="0 0 0 6"/>
|
||||
<ComboBox x:Name="CmbSgbd"
|
||||
Style="{StaticResource ComboStyle}"
|
||||
Width="280"
|
||||
HorizontalAlignment="Left"
|
||||
SelectionChanged="CmbSgbd_SelectionChanged">
|
||||
<ComboBoxItem Content="SQL Server" IsSelected="True"/>
|
||||
<ComboBoxItem Content="MySQL"/>
|
||||
<ComboBoxItem Content="PostgreSQL"/>
|
||||
<ComboBoxItem Content="SQLite"/>
|
||||
<ComboBoxItem Content="Oracle"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Linha 1: Endereço + Nome do Banco -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Endereço do Servidor"
|
||||
Foreground="#94A3B8"
|
||||
FontSize="12"
|
||||
Margin="0 0 0 6"/>
|
||||
<Border Background="#1E2D4A" CornerRadius="8"
|
||||
BorderBrush="#2E4270" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Path Grid.Column="0"
|
||||
Fill="#4A6FA5" Width="18" Height="18"
|
||||
Stretch="Uniform" HorizontalAlignment="Center"
|
||||
Data="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>
|
||||
<TextBox x:Name="TxtServidor"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource InputStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Text="localhost"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="Nome do Banco de Dados"
|
||||
Foreground="#94A3B8"
|
||||
FontSize="12"
|
||||
Margin="0 0 0 6"/>
|
||||
<Border Background="#1E2D4A" CornerRadius="8"
|
||||
BorderBrush="#2E4270" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Path Grid.Column="0"
|
||||
Fill="#4A6FA5" Width="16" Height="16"
|
||||
Stretch="Uniform" HorizontalAlignment="Center"
|
||||
Data="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
|
||||
<TextBox x:Name="TxtBancoDados"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource InputStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Linha 2: Usuário + Senha -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Nome do Usuário"
|
||||
Foreground="#94A3B8"
|
||||
FontSize="12"
|
||||
Margin="0 0 0 6"/>
|
||||
<Border Background="#1E2D4A" CornerRadius="8"
|
||||
BorderBrush="#2E4270" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Path Grid.Column="0"
|
||||
Fill="#4A6FA5" Width="16" Height="16"
|
||||
Stretch="Uniform" HorizontalAlignment="Center"
|
||||
Data="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
|
||||
<TextBox x:Name="TxtUsuario"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource InputStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ===== CAMPO SENHA COM MOSTRAR/OCULTAR ===== -->
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="Senha"
|
||||
Foreground="#94A3B8"
|
||||
FontSize="12"
|
||||
Margin="0 0 0 6"/>
|
||||
<Border x:Name="BorderSenha"
|
||||
Background="#1E2D4A"
|
||||
CornerRadius="8"
|
||||
BorderBrush="#2E4270"
|
||||
BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="44"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Ícone cadeado -->
|
||||
<Path Grid.Column="0"
|
||||
Fill="#4A6FA5" Width="16" Height="16"
|
||||
Stretch="Uniform" HorizontalAlignment="Center"
|
||||
Data="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
|
||||
|
||||
<!-- PasswordBox padrão (senha oculta) -->
|
||||
<PasswordBox x:Name="PboxSenha"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource PasswordStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Visibility="Visible"/>
|
||||
|
||||
<!-- TextBox sobreposto (senha visível) -->
|
||||
<TextBox x:Name="TxtSenhaVisivel"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource InputStyle}"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Visibility="Collapsed"/>
|
||||
|
||||
<!-- Botão olho: mostrar / ocultar senha -->
|
||||
<Button Grid.Column="2"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
ToolTip="Mostrar / ocultar senha"
|
||||
Click="BtnVerSenha_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="btnBorder"
|
||||
Background="Transparent"
|
||||
CornerRadius="0 8 8 0">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnBorder" Property="Background" Value="#263550"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
<!-- Ícone olho — trocado via code-behind -->
|
||||
<Path x:Name="IconeOlho"
|
||||
Fill="#4A6FA5"
|
||||
Width="16" Height="16"
|
||||
Stretch="Uniform"
|
||||
Data="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Linha 3: Provedor + info provedor -->
|
||||
<Grid Margin="0 0 0 16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Provedor"
|
||||
Foreground="#94A3B8"
|
||||
FontSize="12"
|
||||
Margin="0 0 0 6"/>
|
||||
<ComboBox x:Name="CmbProvedor"
|
||||
Style="{StaticResource ComboStyle}">
|
||||
<ComboBoxItem Content="System.Data.SqlClient" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Microsoft.Data.SqlClient"/>
|
||||
<ComboBoxItem Content="MySql.Data.MySqlClient"/>
|
||||
<ComboBoxItem Content="Npgsql"/>
|
||||
<ComboBoxItem Content="System.Data.SQLite"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Bottom" Margin="0 0 0 10">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Path Fill="#4A8ED0" Width="16" Height="16"
|
||||
Stretch="Uniform" Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"
|
||||
Data="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
|
||||
<TextBlock x:Name="TxtProvedorInfo"
|
||||
Text="System.Data.SqlClient"
|
||||
Foreground="#64748B"
|
||||
FontSize="13"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Linha 4: Autenticação integrada + Testar conexão -->
|
||||
<Grid Margin="0 0 0 8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock Text="Autenticação Integrada"
|
||||
Foreground="#CBD5E1"
|
||||
FontSize="13"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0 0 14 0"/>
|
||||
<ToggleButton x:Name="ToggleAutenticacao"
|
||||
Style="{StaticResource ToggleStyle}"
|
||||
IsChecked="True"
|
||||
Checked="ToggleAutenticacao_Changed"
|
||||
Unchecked="ToggleAutenticacao_Changed"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2">
|
||||
<Button Content="Testar Conexão"
|
||||
Style="{StaticResource BtnPrimary}"
|
||||
Click="BtnTestarConexao_Click"/>
|
||||
|
||||
<StackPanel x:Name="PanelResultado"
|
||||
Orientation="Horizontal"
|
||||
Margin="0 10 0 0"
|
||||
Visibility="Collapsed">
|
||||
<Ellipse Width="10" Height="10"
|
||||
x:Name="EllipseResultado"
|
||||
Fill="#22C55E"
|
||||
Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock x:Name="TxtResultado"
|
||||
Text="Conexão bem-sucedida!"
|
||||
Foreground="#22C55E"
|
||||
FontSize="12"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- ===== RODAPÉ ===== -->
|
||||
<Border Grid.Row="2"
|
||||
BorderBrush="#1E3A6A"
|
||||
BorderThickness="0 1 0 0">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#142240" Offset="0"/>
|
||||
<GradientStop Color="#1A2D50" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
|
||||
<Grid Margin="30 0">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center">
|
||||
<Button Content="Cancelar"
|
||||
Style="{StaticResource BtnSecondary}"
|
||||
Width="120"
|
||||
Margin="0 0 12 0"
|
||||
Click="BtnFechar_Click"/>
|
||||
<Button Content="Salvar"
|
||||
Style="{StaticResource BtnPrimary}"
|
||||
Width="120"
|
||||
Click="BtnSalvar_Click"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
251
Configuracao/ConfiguracaoBanco.xaml.cs
Normal file
@ -0,0 +1,251 @@
|
||||
using System;
|
||||
using System.Data.SqlClient;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using UI.Database;
|
||||
|
||||
namespace UI.Configuracao
|
||||
{
|
||||
public partial class ConfiguracaoBanco : Window
|
||||
{
|
||||
// ── Estado do mostrar/ocultar senha ──────────────────────────
|
||||
private bool _senhaVisivel = false;
|
||||
|
||||
private const string IconeOlhoAberto =
|
||||
"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 " +
|
||||
"11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 " +
|
||||
"5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 " +
|
||||
"3-1.34 3-3-1.34-3-3-3z";
|
||||
|
||||
private const string IconeOlhoFechado =
|
||||
"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 " +
|
||||
"2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 " +
|
||||
"2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 " +
|
||||
"10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 " +
|
||||
"22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 " +
|
||||
"1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 " +
|
||||
"0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z";
|
||||
|
||||
public ConfiguracaoBanco()
|
||||
{
|
||||
InitializeComponent();
|
||||
CarregarConfiguracoes();
|
||||
AtualizarCamposAutenticacao();
|
||||
}
|
||||
|
||||
// ── Arrastar janela ─────────────────────────────────────────
|
||||
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
DragMove();
|
||||
}
|
||||
|
||||
// ── Fechar janela ────────────────────────────────────────────
|
||||
private void BtnFechar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// ── Mostrar/ocultar senha ────────────────────────────────────
|
||||
private void BtnVerSenha_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_senhaVisivel = !_senhaVisivel;
|
||||
|
||||
if (_senhaVisivel)
|
||||
{
|
||||
TxtSenhaVisivel.Text = PboxSenha.Password;
|
||||
PboxSenha.Visibility = Visibility.Collapsed;
|
||||
TxtSenhaVisivel.Visibility = Visibility.Visible;
|
||||
TxtSenhaVisivel.Focus();
|
||||
TxtSenhaVisivel.CaretIndex = TxtSenhaVisivel.Text.Length;
|
||||
|
||||
IconeOlho.Data = Geometry.Parse(IconeOlhoFechado);
|
||||
IconeOlho.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#3B82F6"));
|
||||
}
|
||||
else
|
||||
{
|
||||
PboxSenha.Password = TxtSenhaVisivel.Text;
|
||||
TxtSenhaVisivel.Visibility = Visibility.Collapsed;
|
||||
PboxSenha.Visibility = Visibility.Visible;
|
||||
PboxSenha.Focus();
|
||||
|
||||
IconeOlho.Data = Geometry.Parse(IconeOlhoAberto);
|
||||
IconeOlho.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#4A6FA5"));
|
||||
}
|
||||
}
|
||||
|
||||
// ── Carrega configurações salvas ao abrir a janela ───────────
|
||||
private void CarregarConfiguracoes()
|
||||
{
|
||||
DBConfig config = ConfiguracaoService.Carregar();
|
||||
|
||||
TxtServidor.Text = config.Servidor;
|
||||
TxtBancoDados.Text = config.Banco;
|
||||
TxtUsuario.Text = config.Usuario;
|
||||
PboxSenha.Password = config.Senha;
|
||||
ToggleAutenticacao.IsChecked = config.Integrada;
|
||||
|
||||
foreach (ComboBoxItem item in CmbSgbd.Items)
|
||||
{
|
||||
if (item.Content?.ToString() == config.Sgbd)
|
||||
{
|
||||
CmbSgbd.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ComboBoxItem item in CmbProvedor.Items)
|
||||
{
|
||||
if (item.Content?.ToString() == config.Provedor)
|
||||
{
|
||||
CmbProvedor.SelectedItem = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Atualiza provedor ao trocar o SGBD ───────────────────────
|
||||
private void CmbSgbd_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (CmbProvedor == null) return;
|
||||
|
||||
string sgbd = (CmbSgbd.SelectedItem as ComboBoxItem)?.Content?.ToString() ?? "";
|
||||
|
||||
switch (sgbd)
|
||||
{
|
||||
case "SQL Server":
|
||||
CmbProvedor.SelectedIndex = 0;
|
||||
if (TxtProvedorInfo != null) TxtProvedorInfo.Text = "System.Data.SqlClient";
|
||||
break;
|
||||
case "MySQL":
|
||||
CmbProvedor.SelectedIndex = 2;
|
||||
if (TxtProvedorInfo != null) TxtProvedorInfo.Text = "MySql.Data.MySqlClient";
|
||||
break;
|
||||
case "PostgreSQL":
|
||||
CmbProvedor.SelectedIndex = 3;
|
||||
if (TxtProvedorInfo != null) TxtProvedorInfo.Text = "Npgsql";
|
||||
break;
|
||||
case "SQLite":
|
||||
CmbProvedor.SelectedIndex = 4;
|
||||
if (TxtProvedorInfo != null) TxtProvedorInfo.Text = "System.Data.SQLite";
|
||||
break;
|
||||
default:
|
||||
CmbProvedor.SelectedIndex = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Toggle autenticação integrada ────────────────────────────
|
||||
private void ToggleAutenticacao_Changed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AtualizarCamposAutenticacao();
|
||||
}
|
||||
|
||||
private void AtualizarCamposAutenticacao()
|
||||
{
|
||||
bool integrada = ToggleAutenticacao.IsChecked == true;
|
||||
|
||||
if (TxtUsuario != null)
|
||||
{
|
||||
TxtUsuario.IsEnabled = !integrada;
|
||||
TxtUsuario.Opacity = integrada ? 0.4 : 1.0;
|
||||
}
|
||||
|
||||
if (PboxSenha != null)
|
||||
{
|
||||
PboxSenha.IsEnabled = !integrada;
|
||||
PboxSenha.Opacity = integrada ? 0.4 : 1.0;
|
||||
}
|
||||
|
||||
// Sincroniza o TxtSenhaVisivel junto com o PboxSenha
|
||||
if (TxtSenhaVisivel != null)
|
||||
{
|
||||
TxtSenhaVisivel.IsEnabled = !integrada;
|
||||
TxtSenhaVisivel.Opacity = integrada ? 0.4 : 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Testar conexão ───────────────────────────────────────────
|
||||
private void BtnTestarConexao_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string servidor = TxtServidor.Text.Trim();
|
||||
string banco = TxtBancoDados.Text.Trim();
|
||||
string usuario = TxtUsuario.Text.Trim();
|
||||
string senha = _senhaVisivel ? TxtSenhaVisivel.Text : PboxSenha.Password;
|
||||
bool integrada = ToggleAutenticacao.IsChecked == true;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(servidor) || string.IsNullOrWhiteSpace(banco))
|
||||
{
|
||||
MostrarResultado(false, "Preencha o servidor e o banco de dados.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string connStr = integrada
|
||||
? $"Server={servidor};Database={banco};Integrated Security=True;TrustServerCertificate=True;"
|
||||
: $"Server={servidor};Database={banco};User Id={usuario};Password={senha};TrustServerCertificate=True;";
|
||||
|
||||
using (var conn = new SqlConnection(connStr))
|
||||
{
|
||||
conn.Open();
|
||||
MostrarResultado(true, "Conexão bem-sucedida!");
|
||||
DadosConexao.Servidor = servidor;
|
||||
DadosConexao.Banco = banco;
|
||||
DadosConexao.Usuario = usuario;
|
||||
DadosConexao.Senha = senha;
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MostrarResultado(false, $"Falha: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void MostrarResultado(bool sucesso, string mensagem)
|
||||
{
|
||||
PanelResultado.Visibility = Visibility.Visible;
|
||||
TxtResultado.Text = mensagem;
|
||||
|
||||
var cor = sucesso ? "#22C55E" : "#EF4444";
|
||||
TxtResultado.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(cor));
|
||||
EllipseResultado.Fill = new SolidColorBrush((Color)ColorConverter.ConvertFromString(cor));
|
||||
}
|
||||
|
||||
// ── Salvar configurações ─────────────────────────────────────
|
||||
private void BtnSalvar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(TxtServidor.Text) ||
|
||||
string.IsNullOrWhiteSpace(TxtBancoDados.Text))
|
||||
{
|
||||
MessageBox.Show("Preencha o servidor e o nome do banco.",
|
||||
"Atenção", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
// Garante a senha correta independente de qual controle está visível
|
||||
string senha = _senhaVisivel ? TxtSenhaVisivel.Text : PboxSenha.Password;
|
||||
|
||||
var config = new DBConfig
|
||||
{
|
||||
Servidor = TxtServidor.Text.Trim(),
|
||||
Banco = TxtBancoDados.Text.Trim(),
|
||||
Usuario = TxtUsuario.Text.Trim(),
|
||||
Senha = senha,
|
||||
Integrada = ToggleAutenticacao.IsChecked == true,
|
||||
Sgbd = (CmbSgbd.SelectedItem as ComboBoxItem)?.Content?.ToString() ?? "SQL Server",
|
||||
Provedor = (CmbProvedor.SelectedItem as ComboBoxItem)?.Content?.ToString() ?? "System.Data.SqlClient"
|
||||
};
|
||||
|
||||
ConfiguracaoService.Salvar(config);
|
||||
|
||||
MessageBox.Show("Configurações salvas com sucesso!",
|
||||
"Salvo", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
70
Configuracao/ConfiguracaoService.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Windows;
|
||||
|
||||
namespace UI.Configuracao
|
||||
{
|
||||
public class DBConfig
|
||||
{
|
||||
public string Servidor { get; set; } = "localhost";
|
||||
public string Banco { get; set; } = "";
|
||||
public string Usuario { get; set; } = "";
|
||||
public string Senha { get; set; } = "";
|
||||
public bool Integrada { get; set; } = true;
|
||||
public string Sgbd { get; set; } = "SQL Server";
|
||||
public string Provedor { get; set; } = "System.Data.SqlClient";
|
||||
}
|
||||
|
||||
public static class ConfiguracaoService
|
||||
{
|
||||
private static readonly string CaminhoConfig =
|
||||
Path.Combine(@"C:\Levelcode\LevelcodeSGI\Config", "settingsdb.json");
|
||||
|
||||
public static DBConfig Carregar()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(CaminhoConfig))
|
||||
{
|
||||
string json = File.ReadAllText(CaminhoConfig);
|
||||
return JsonSerializer.Deserialize<DBConfig>(json) ?? new DBConfig();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Erro ao carregar configurações:\n{ex.Message}",
|
||||
"Aviso", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
|
||||
return new DBConfig();
|
||||
}
|
||||
|
||||
public static void Salvar(DBConfig config)
|
||||
{
|
||||
try
|
||||
{
|
||||
string pasta = Path.GetDirectoryName(CaminhoConfig)!;
|
||||
if (!Directory.Exists(pasta))
|
||||
Directory.CreateDirectory(pasta);
|
||||
|
||||
var options = new JsonSerializerOptions { WriteIndented = true };
|
||||
string json = JsonSerializer.Serialize(config, options);
|
||||
File.WriteAllText(CaminhoConfig, json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Erro ao salvar configurações:\n{ex.Message}",
|
||||
"Erro", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GerarConnectionString(DBConfig config)
|
||||
{
|
||||
if (config.Integrada)
|
||||
return $"Server={config.Servidor};Database={config.Banco};Integrated Security=True;TrustServerCertificate=True;";
|
||||
else
|
||||
return $"Server={config.Servidor};Database={config.Banco};User Id={config.Usuario};Password={config.Senha};TrustServerCertificate=True;";
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Configuracao/DatabaseConfig.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace UI.Configuracao
|
||||
{
|
||||
public class DatabaseConfig
|
||||
{
|
||||
public string Servidor { get; set; }
|
||||
public string Banco { get; set; }
|
||||
public string Usuario { get; set; }
|
||||
public string Senha { get; set; }
|
||||
public bool Integrada { get; set; }
|
||||
public string Sgbd { get; set; }
|
||||
public string Provedor { get; set; }
|
||||
|
||||
public static DatabaseConfig Load()
|
||||
{
|
||||
string path = @"C:\Levelcode\LevelcodeSGI\Config\settingsdb.json";
|
||||
|
||||
string json = File.ReadAllText(path);
|
||||
|
||||
return JsonSerializer.Deserialize<DatabaseConfig>(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
1497
Dashboard/DashboardMain.xaml
Normal file
460
Dashboard/DashboardMain.xaml.cs
Normal file
@ -0,0 +1,460 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.Xml;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using UI.Database;
|
||||
|
||||
|
||||
namespace UI.Dashboard
|
||||
{
|
||||
// ─────────────────────────────────────────
|
||||
// MODEL
|
||||
// ─────────────────────────────────────────
|
||||
public class PessoaViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string NomeCompleto { get; set; } = "";
|
||||
public string Email { get; set; } = "";
|
||||
public string Telefone { get; set; } = "";
|
||||
public string Cidade { get; set; } = "";
|
||||
public string Cargo { get; set; } = "";
|
||||
public DateTime? DataNascimento { get; set; }
|
||||
|
||||
public string DataNascFormatada =>
|
||||
DataNascimento.HasValue ? DataNascimento.Value.ToString("dd/MM/yyyy") : "-";
|
||||
|
||||
public string Iniciais
|
||||
{
|
||||
get
|
||||
{
|
||||
var p = NomeCompleto.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (p.Length >= 2) return $"{p[0][0]}{p[^1][0]}".ToUpper();
|
||||
return NomeCompleto.Length >= 2 ? NomeCompleto[..2].ToUpper() : NomeCompleto.ToUpper();
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly (string Bg, string Fg)[] Paleta =
|
||||
{
|
||||
("#1A3A6E","#60A5FA"), ("#3A1A3A","#C084FC"), ("#1A3A20","#4ADE80"),
|
||||
("#3A2A10","#FCD34D"), ("#1A2A3A","#38BDF8"), ("#3A1A20","#FB7185"),
|
||||
("#1A3A35","#34D399"),
|
||||
};
|
||||
|
||||
public string AvatarBackground => Paleta[Math.Abs(Id) % Paleta.Length].Bg;
|
||||
public string AvatarForeground => Paleta[Math.Abs(Id) % Paleta.Length].Fg;
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// MODEL DA PAGINACAO
|
||||
// ─────────────────────────────────────────
|
||||
public class PaginaItem
|
||||
{
|
||||
public string Label { get; set; } = "";
|
||||
public bool IsActive { get; set; }
|
||||
public string FontWeight => IsActive ? "Bold" : "Normal";
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// REPOSITORIO
|
||||
// ─────────────────────────────────────────
|
||||
public class PessoaRepository
|
||||
{
|
||||
private readonly string _connectionString;
|
||||
|
||||
public PessoaRepository(string connectionString)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
}
|
||||
|
||||
public (List<PessoaViewModel> Itens, int TotalRegistros) Buscar(
|
||||
string filtro, int pagina, int itensPorPagina)
|
||||
{
|
||||
using var conn = new SqlConnection(_connectionString);
|
||||
conn.Open();
|
||||
|
||||
var filtroParam = string.IsNullOrWhiteSpace(filtro) ? "%" : $"%{filtro}%";
|
||||
var offset = (pagina - 1) * itensPorPagina;
|
||||
|
||||
int total;
|
||||
|
||||
using (var cmdCount = new SqlCommand(@"
|
||||
SELECT COUNT(*)
|
||||
FROM Pessoas
|
||||
WHERE @filtro = '%'
|
||||
OR NomeCompleto LIKE @filtro
|
||||
OR Email LIKE @filtro
|
||||
OR Telefone LIKE @filtro", conn))
|
||||
{
|
||||
cmdCount.Parameters.AddWithValue("@filtro", filtroParam);
|
||||
total = (int)cmdCount.ExecuteScalar();
|
||||
}
|
||||
|
||||
var itens = new List<PessoaViewModel>();
|
||||
|
||||
using (var cmd = new SqlCommand(@"
|
||||
SELECT Id, NomeCompleto, Email, Telefone, Cidade, Cargo, DataNascimento
|
||||
FROM Pessoas
|
||||
WHERE @filtro = '%'
|
||||
OR NomeCompleto LIKE @filtro
|
||||
OR Email LIKE @filtro
|
||||
OR Cidade LIKE @filtro
|
||||
OR Cargo LIKE @filtro
|
||||
ORDER BY NomeCompleto
|
||||
OFFSET @offset ROWS FETCH NEXT @qtd ROWS ONLY", conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@filtro", filtroParam);
|
||||
cmd.Parameters.AddWithValue("@offset", offset);
|
||||
cmd.Parameters.AddWithValue("@qtd", itensPorPagina);
|
||||
|
||||
using var reader = cmd.ExecuteReader();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
itens.Add(new PessoaViewModel
|
||||
{
|
||||
Id = reader.GetInt32(0),
|
||||
NomeCompleto = reader.IsDBNull(1) ? "" : reader.GetString(1),
|
||||
Email = reader.IsDBNull(2) ? "" : reader.GetString(2),
|
||||
Telefone = reader.IsDBNull(3) ? "" : reader.GetString(3),
|
||||
Cidade = reader.IsDBNull(4) ? "" : reader.GetString(4),
|
||||
Cargo = reader.IsDBNull(5) ? "" : reader.GetString(5),
|
||||
DataNascimento = reader.IsDBNull(6) ? null : reader.GetDateTime(6)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return (itens, total);
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// CODE-BEHIND
|
||||
// ─────────────────────────────────────────
|
||||
public partial class DashboardMain : Window
|
||||
{
|
||||
private PessoaRepository? _repo;
|
||||
private int _paginaAtual = 1;
|
||||
private int _itensPorPagina = 10;
|
||||
private int _totalRegistros = 0;
|
||||
private string _filtroAtual = "";
|
||||
|
||||
// Controles da tabela — resolvidos via FindName no OnLoaded
|
||||
private System.Windows.Controls.Border? _loadingPanel;
|
||||
private System.Windows.Controls.Border? _emptyPanel;
|
||||
private System.Windows.Controls.ItemsControl? _listaPessoas;
|
||||
private System.Windows.Controls.ItemsControl? _paginacaoPanel;
|
||||
private System.Windows.Controls.Button? _btnAnterior;
|
||||
private System.Windows.Controls.Button? _btnProximo;
|
||||
private System.Windows.Controls.TextBlock? _runPaginaInfo;
|
||||
|
||||
// ✅ Barras do gráfico de Distribuição por Sexo
|
||||
private System.Windows.Controls.Border? _barMasc;
|
||||
private System.Windows.Controls.Border? _barFem;
|
||||
private System.Windows.Controls.Border? _barOutros;
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// CONSTRUTOR
|
||||
// ─────────────────────────────────────────
|
||||
public DashboardMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += OnLoaded;
|
||||
|
||||
this.lblCadHoje.Text = ObterCadastrosHoje().ToString();
|
||||
this.CarregarResumo();
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// QUERIES — inalteradas em relação ao original
|
||||
// ─────────────────────────────────────────
|
||||
public int ObterCadastrosHoje()
|
||||
{
|
||||
using var conn = new SqlConnection(DadosConexao.ObterStringConexao());
|
||||
conn.Open();
|
||||
using var cmd = new SqlCommand(
|
||||
"SELECT TotalHoje FROM vw_CadastrosHoje", conn);
|
||||
var resultado = cmd.ExecuteScalar();
|
||||
return resultado != null ? Convert.ToInt32(resultado) : 0;
|
||||
}
|
||||
|
||||
public (string total, string crescimento) ObterResumoCadastros()
|
||||
{
|
||||
using var conn = new SqlConnection(DadosConexao.ObterStringConexao());
|
||||
conn.Open();
|
||||
using var cmd = new SqlCommand(
|
||||
"SELECT TotalCadastros, CrescimentoPercentual FROM vw_ResumoCadastros", conn);
|
||||
using var reader = cmd.ExecuteReader();
|
||||
if (reader.Read())
|
||||
{
|
||||
int total = reader.GetInt32(0);
|
||||
decimal crescimento = reader.GetDecimal(1);
|
||||
return (total.ToString("N0"), $"↑ {Math.Round(crescimento)}%");
|
||||
}
|
||||
return ("0", "0%");
|
||||
}
|
||||
|
||||
public (string ativos, string inativos) ObterStatusPessoas()
|
||||
{
|
||||
using var conn = new SqlConnection(DadosConexao.ObterStringConexao());
|
||||
conn.Open();
|
||||
using var cmd = new SqlCommand(
|
||||
"SELECT Ativos, Inativos FROM vw_StatusPessoas", conn);
|
||||
using var reader = cmd.ExecuteReader();
|
||||
if (reader.Read())
|
||||
{
|
||||
int ativos = reader.GetInt32(0);
|
||||
int inativos = reader.GetInt32(1);
|
||||
return (ativos.ToString("N0"), inativos.ToString("N0"));
|
||||
}
|
||||
return ("0", "0");
|
||||
}
|
||||
|
||||
// ✅ Query original preservada — apenas 3 colunas, sem alterar a view
|
||||
public (string masc, string fem, string outros) ObterDistribuicaoSexo()
|
||||
{
|
||||
using var conn = new SqlConnection(DadosConexao.ObterStringConexao());
|
||||
conn.Open();
|
||||
using var cmd = new SqlCommand(
|
||||
"SELECT PercentMasculino, PercentFeminino, PercentOutros FROM vw_DistribuicaoSexo",
|
||||
conn);
|
||||
using var reader = cmd.ExecuteReader();
|
||||
if (reader.Read())
|
||||
{
|
||||
decimal masc = reader.GetDecimal(0);
|
||||
decimal fem = reader.GetDecimal(1);
|
||||
decimal outros = reader.GetDecimal(2);
|
||||
return (
|
||||
$"{Math.Round(masc)}%",
|
||||
$"{Math.Round(fem)}%",
|
||||
$"{Math.Round(outros)}%"
|
||||
);
|
||||
}
|
||||
return ("0%", "0%", "0%");
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// CARREGA RESUMO (cards + gráfico)
|
||||
// ─────────────────────────────────────────
|
||||
private void CarregarResumo()
|
||||
{
|
||||
var resumo = ObterResumoCadastros();
|
||||
var status = ObterStatusPessoas();
|
||||
var sexo = ObterDistribuicaoSexo();
|
||||
|
||||
TxtTotalCadastros.Text = resumo.total;
|
||||
TxtCrescimento.Text = resumo.crescimento;
|
||||
TxtAtivos.Text = status.ativos;
|
||||
TxtInativos.Text = status.inativos;
|
||||
|
||||
// Percentuais nos TextBlocks do gráfico
|
||||
TxtMasc.Text = sexo.masc;
|
||||
TxtFem.Text = sexo.fem;
|
||||
TxtOutros.Text = sexo.outros;
|
||||
|
||||
// Tenta atualizar as barras — se Loaded ainda não rodou,
|
||||
// os campos serão null e a chamada é no-op.
|
||||
// O OnLoaded chama novamente para garantir.
|
||||
AtualizarBarrasGrafico(sexo.masc, sexo.fem, sexo.outros);
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// GRÁFICO DE BARRAS — DISTRIBUIÇÃO POR SEXO
|
||||
// ─────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Recebe as strings de percentual ("52%", "43%", "5%")
|
||||
/// e ajusta a largura de cada barra proporcionalmente.
|
||||
/// </summary>
|
||||
private void AtualizarBarrasGrafico(string mascPct, string femPct, string outrosPct)
|
||||
{
|
||||
const double BarMaxWidth = 250; // px — ajuste se o card mudar de tamanho
|
||||
const double BarMinWidth = 4; // evita barra invisível quando valor é 0
|
||||
|
||||
double m = ParsePct(mascPct);
|
||||
double f = ParsePct(femPct);
|
||||
double o = ParsePct(outrosPct);
|
||||
|
||||
// Normaliza caso a soma não seja exatamente 100
|
||||
double soma = m + f + o;
|
||||
if (soma > 0) { m = m / soma * 100; f = f / soma * 100; o = o / soma * 100; }
|
||||
|
||||
if (_barMasc != null) _barMasc.Width = Math.Max(BarMinWidth, m / 100 * BarMaxWidth);
|
||||
if (_barFem != null) _barFem.Width = Math.Max(BarMinWidth, f / 100 * BarMaxWidth);
|
||||
if (_barOutros != null) _barOutros.Width = Math.Max(BarMinWidth, o / 100 * BarMaxWidth);
|
||||
}
|
||||
|
||||
/// <summary>Converte "52%" → 52.0 com segurança.</summary>
|
||||
private static double ParsePct(string pct)
|
||||
{
|
||||
var limpo = pct.Replace("%", "").Replace(",", ".").Trim();
|
||||
return double.TryParse(limpo,
|
||||
System.Globalization.NumberStyles.Any,
|
||||
System.Globalization.CultureInfo.InvariantCulture,
|
||||
out double v) ? v : 0;
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// LOADED
|
||||
// ─────────────────────────────────────────
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Controles da tabela
|
||||
_loadingPanel = FindName("LoadingPanel") as System.Windows.Controls.Border;
|
||||
_emptyPanel = FindName("EmptyPanel") as System.Windows.Controls.Border;
|
||||
_listaPessoas = FindName("ListaPessoas") as System.Windows.Controls.ItemsControl;
|
||||
_paginacaoPanel = FindName("PaginacaoPanel") as System.Windows.Controls.ItemsControl;
|
||||
_btnAnterior = FindName("BtnAnterior") as System.Windows.Controls.Button;
|
||||
_btnProximo = FindName("BtnProximo") as System.Windows.Controls.Button;
|
||||
_runPaginaInfo = FindName("RunPaginaInfo") as System.Windows.Controls.TextBlock;
|
||||
|
||||
// ✅ Barras do gráfico
|
||||
_barMasc = FindName("BarMasc") as System.Windows.Controls.Border;
|
||||
_barFem = FindName("BarFem") as System.Windows.Controls.Border;
|
||||
_barOutros = FindName("BarOutros") as System.Windows.Controls.Border;
|
||||
|
||||
// Aplica as barras agora que os controles estão resolvidos
|
||||
AtualizarBarrasGrafico(TxtMasc.Text, TxtFem.Text, TxtOutros.Text);
|
||||
|
||||
// Inicializa repositório e carrega a tabela
|
||||
try
|
||||
{
|
||||
string conexao = DadosConexao.ObterStringConexao();
|
||||
if (string.IsNullOrWhiteSpace(conexao))
|
||||
{
|
||||
MessageBox.Show(
|
||||
"String de conexão não configurada.\nVerifique DadosConexao.ObterStringConexao().",
|
||||
"Configuração", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
_repo = new PessoaRepository(conexao);
|
||||
CarregarPessoas();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Erro ao inicializar conexão:\n{ex.Message}",
|
||||
"Erro", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// JANELA
|
||||
// ─────────────────────────────────────────
|
||||
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left) DragMove();
|
||||
}
|
||||
|
||||
private void BtnFechar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────
|
||||
// TABELA / PAGINAÇÃO
|
||||
// ─────────────────────────────────────────
|
||||
private void CarregarPessoas()
|
||||
{
|
||||
if (_repo == null) return;
|
||||
|
||||
if (_loadingPanel != null) _loadingPanel.Visibility = Visibility.Visible;
|
||||
if (_emptyPanel != null) _emptyPanel.Visibility = Visibility.Collapsed;
|
||||
if (_listaPessoas != null) _listaPessoas.ItemsSource = null;
|
||||
|
||||
try
|
||||
{
|
||||
var (itens, total) = _repo.Buscar(_filtroAtual, _paginaAtual, _itensPorPagina);
|
||||
_totalRegistros = total;
|
||||
|
||||
if (itens.Count == 0)
|
||||
{
|
||||
if (_emptyPanel != null) _emptyPanel.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_listaPessoas != null) _listaPessoas.ItemsSource = itens;
|
||||
}
|
||||
|
||||
AtualizarPaginacao();
|
||||
AtualizarInfoRegistros();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Erro ao carregar pessoas:\n{ex.Message}",
|
||||
"Erro", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_loadingPanel != null) _loadingPanel.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
private void AtualizarPaginacao()
|
||||
{
|
||||
int totalPaginas = (int)Math.Ceiling(_totalRegistros / (double)_itensPorPagina);
|
||||
if (totalPaginas < 1) totalPaginas = 1;
|
||||
|
||||
int inicio = Math.Max(1, _paginaAtual - 2);
|
||||
int fim = Math.Min(totalPaginas, inicio + 4);
|
||||
inicio = Math.Max(1, fim - 4);
|
||||
|
||||
var paginas = new List<PaginaItem>();
|
||||
|
||||
if (inicio > 1)
|
||||
paginas.Add(new PaginaItem { Label = "..." });
|
||||
|
||||
for (int i = inicio; i <= fim; i++)
|
||||
paginas.Add(new PaginaItem { Label = i.ToString(), IsActive = i == _paginaAtual });
|
||||
|
||||
if (fim < totalPaginas)
|
||||
paginas.Add(new PaginaItem { Label = "..." });
|
||||
|
||||
if (_paginacaoPanel != null) _paginacaoPanel.ItemsSource = paginas;
|
||||
if (_btnAnterior != null) _btnAnterior.IsEnabled = _paginaAtual > 1;
|
||||
if (_btnProximo != null) _btnProximo.IsEnabled = _paginaAtual < totalPaginas;
|
||||
}
|
||||
|
||||
private void AtualizarInfoRegistros()
|
||||
{
|
||||
if (_runPaginaInfo == null) return;
|
||||
|
||||
int ini = (_paginaAtual - 1) * _itensPorPagina + 1;
|
||||
int fim = Math.Min(_paginaAtual * _itensPorPagina, _totalRegistros);
|
||||
|
||||
_runPaginaInfo.Text = _totalRegistros == 0
|
||||
? "0 registros"
|
||||
: $"{ini}-{fim} de {_totalRegistros:N0}";
|
||||
}
|
||||
|
||||
private void BtnAnterior_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_paginaAtual > 1) { _paginaAtual--; CarregarPessoas(); }
|
||||
}
|
||||
|
||||
private void BtnProximo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int totalPaginas = (int)Math.Ceiling(_totalRegistros / (double)_itensPorPagina);
|
||||
if (_paginaAtual < totalPaginas) { _paginaAtual++; CarregarPessoas(); }
|
||||
}
|
||||
|
||||
private void CmbItensPorPagina_SelectionChanged(object sender,
|
||||
System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
if (CmbItensPorPagina?.SelectedItem is System.Windows.Controls.ComboBoxItem item
|
||||
&& int.TryParse(item.Content?.ToString(), out int qtd))
|
||||
{
|
||||
_itensPorPagina = qtd;
|
||||
_paginaAtual = 1;
|
||||
CarregarPessoas();
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnNovoCadastro_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var cp = new UI.Cadastro.FrmCadastroClientes();
|
||||
cp.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Database/DadosConexao.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UI.Database
|
||||
{
|
||||
public static class DadosConexao
|
||||
{
|
||||
public static string Servidor { get; set; }
|
||||
public static string Banco { get; set; }
|
||||
public static string Usuario { get; set; }
|
||||
public static string Senha { get; set; }
|
||||
public static string ObterStringConexao()
|
||||
{
|
||||
return $"Server={Servidor};Database={Banco};User Id={Usuario};Password={Senha};";
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Database/DatabaseService.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System.Data.SqlClient;
|
||||
using UI.Configuracao;
|
||||
|
||||
namespace UI.Database
|
||||
{
|
||||
public class DatabaseService
|
||||
{
|
||||
public static SqlConnection GetConnection()
|
||||
{
|
||||
var cfg = DatabaseConfig.Load();
|
||||
|
||||
string connectionString;
|
||||
|
||||
if (cfg.Integrada)
|
||||
{
|
||||
connectionString =
|
||||
$"Server={cfg.Servidor};Database={cfg.Banco};Trusted_Connection=True;TrustServerCertificate=True;";
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionString =
|
||||
$"Server={cfg.Servidor};Database={cfg.Banco};User Id={cfg.Usuario};Password={cfg.Senha};TrustServerCertificate=True;";
|
||||
}
|
||||
|
||||
return new SqlConnection(connectionString);
|
||||
}
|
||||
}
|
||||
}
|
||||
898
MainWindow.xaml
Normal file
@ -0,0 +1,898 @@
|
||||
<Window x:Class="UI.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="NoResize"
|
||||
WindowStyle="None"
|
||||
Height="660"
|
||||
Width="1080"
|
||||
Background="#0D1117"
|
||||
MouseDown="Window_MouseDown">
|
||||
|
||||
<Window.Resources>
|
||||
|
||||
<!-- Animação de fade-in -->
|
||||
<Storyboard x:Key="FadeIn">
|
||||
<DoubleAnimation Storyboard.TargetProperty="Opacity"
|
||||
From="0" To="1" Duration="0:0:0.5"
|
||||
EasingFunction="{x:Null}"/>
|
||||
</Storyboard>
|
||||
|
||||
<!-- Estilo dos itens do menu popup -->
|
||||
<Style x:Key="MenuItemStyle" TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="#8B9CC8"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12 10"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="8"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#1C2944"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#131E35"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Estilo do campo de input -->
|
||||
<Style x:Key="InputFieldBorder" TargetType="Border">
|
||||
<Setter Property="Background" Value="#131E35"/>
|
||||
<Setter Property="CornerRadius" Value="12"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
</Style>
|
||||
|
||||
</Window.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.15*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ====================== -->
|
||||
<!-- LADO ESQUERDO -->
|
||||
<!-- ====================== -->
|
||||
|
||||
<Grid>
|
||||
<!-- Fundo com gradiente rico -->
|
||||
<Grid.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#0A1628" Offset="0"/>
|
||||
<GradientStop Color="#0F1F3D" Offset="0.5"/>
|
||||
<GradientStop Color="#0D1525" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Grid.Background>
|
||||
|
||||
<!-- Círculo decorativo de fundo (grande) -->
|
||||
<Ellipse Width="500" Height="500"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Bottom"
|
||||
Margin="-150 0 0 -180"
|
||||
Opacity="0.08">
|
||||
<Ellipse.Fill>
|
||||
<RadialGradientBrush>
|
||||
<GradientStop Color="#4F8EF7" Offset="0"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</RadialGradientBrush>
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
|
||||
<!-- Círculo decorativo superior -->
|
||||
<Ellipse Width="300" Height="300"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0 -80 -60 0"
|
||||
Opacity="0.06">
|
||||
<Ellipse.Fill>
|
||||
<RadialGradientBrush>
|
||||
<GradientStop Color="#6366F1" Offset="0"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</RadialGradientBrush>
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
|
||||
<!-- Linha vertical decorativa -->
|
||||
<Rectangle Width="1" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch" Margin="0">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="Transparent" Offset="0"/>
|
||||
<GradientStop Color="#1E3A6E" Offset="0.4"/>
|
||||
<GradientStop Color="#1E3A6E" Offset="0.6"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
|
||||
<StackPanel Margin="70 0 80 0" VerticalAlignment="Center">
|
||||
|
||||
<!-- LOGO + NOME -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<!-- Logo recreada em XAML: 4 losangos azuis em grade 2x2 -->
|
||||
<Viewbox Width="44" Height="44">
|
||||
<Grid Width="100" Height="100">
|
||||
<Grid.Effect>
|
||||
<DropShadowEffect Color="#4F8EF7" BlurRadius="18"
|
||||
ShadowDepth="0" Opacity="0.6"/>
|
||||
</Grid.Effect>
|
||||
<!-- Quadrante superior -->
|
||||
<Path Fill="#3B82F6" RenderTransformOrigin="0.5,0.5">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="50,5" IsClosed="True">
|
||||
<LineSegment Point="78,33"/>
|
||||
<LineSegment Point="50,47"/>
|
||||
<LineSegment Point="22,33"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<!-- Quadrante direito -->
|
||||
<Path RenderTransformOrigin="0.5,0.5">
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#60A5FA" Offset="0"/>
|
||||
<GradientStop Color="#3B82F6" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="53,50" IsClosed="True">
|
||||
<LineSegment Point="78,33"/>
|
||||
<LineSegment Point="95,50"/>
|
||||
<LineSegment Point="78,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<!-- Quadrante inferior -->
|
||||
<Path RenderTransformOrigin="0.5,0.5">
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
|
||||
<GradientStop Color="#2563EB" Offset="0"/>
|
||||
<GradientStop Color="#3B82F6" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="50,53" IsClosed="True">
|
||||
<LineSegment Point="78,67"/>
|
||||
<LineSegment Point="50,95"/>
|
||||
<LineSegment Point="22,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<!-- Quadrante esquerdo -->
|
||||
<Path RenderTransformOrigin="0.5,0.5">
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="47,50" IsClosed="True">
|
||||
<LineSegment Point="22,33"/>
|
||||
<LineSegment Point="5,50"/>
|
||||
<LineSegment Point="22,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
<StackPanel Margin="14 0 0 0" VerticalAlignment="Center">
|
||||
<TextBlock Text="Levelcode" Foreground="White"
|
||||
FontSize="22" FontWeight="Bold"/>
|
||||
<TextBlock Text="SGI — Gestão Integrada"
|
||||
Foreground="#4F6A99" FontSize="11"
|
||||
Margin="1 2 0 0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<!-- SEPARADOR SUTIL -->
|
||||
<Rectangle Height="1" Margin="0 22 0 28">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1E3A6E" Offset="0"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
|
||||
<!-- TAGLINE -->
|
||||
<TextBlock Text="Seu negócio,
inteligente e conectado."
|
||||
Foreground="White"
|
||||
FontSize="30"
|
||||
FontWeight="Bold"
|
||||
LineHeight="42"
|
||||
Margin="0 0 0 16"/>
|
||||
|
||||
<TextBlock Text="Gerencie processos, pessoas e decisões
com clareza e velocidade."
|
||||
Foreground="#4F6A99"
|
||||
FontSize="14"
|
||||
LineHeight="24"
|
||||
Margin="0 0 0 36"/>
|
||||
|
||||
<!-- PILLS DE FEATURE -->
|
||||
<StackPanel Margin="0 0 0 40">
|
||||
<Border Background="#101D33" CornerRadius="30"
|
||||
Padding="14 8" HorizontalAlignment="Left"
|
||||
Margin="0 0 0 10">
|
||||
<Border.BorderBrush>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1E3A6E" Offset="0"/>
|
||||
<GradientStop Color="#1A3055" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.BorderBrush>
|
||||
<Border.BorderThickness>1</Border.BorderThickness>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="✦" Foreground="#4F8EF7"
|
||||
FontSize="10" Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Dashboards e relatórios em tempo real"
|
||||
Foreground="#7B93B8" FontSize="13"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Background="#101D33" CornerRadius="30"
|
||||
Padding="14 8" HorizontalAlignment="Left">
|
||||
<Border.BorderBrush>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1E3A6E" Offset="0"/>
|
||||
<GradientStop Color="#1A3055" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.BorderBrush>
|
||||
<Border.BorderThickness>1</Border.BorderThickness>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="✦" Foreground="#6366F1"
|
||||
FontSize="10" Margin="0 0 8 0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Gestão de pessoas e processos"
|
||||
Foreground="#7B93B8" FontSize="13"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- CARD PREVIEW COM BLUR/GLASS -->
|
||||
<Border CornerRadius="16" Height="180"
|
||||
BorderThickness="1">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#0E1C33" Offset="0"/>
|
||||
<GradientStop Color="#0B1525" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<Border.BorderBrush>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#243D6B" Offset="0"/>
|
||||
<GradientStop Color="#1A2D50" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.BorderBrush>
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="#000000" Opacity="0.4"
|
||||
BlurRadius="20" ShadowDepth="4"/>
|
||||
</Border.Effect>
|
||||
|
||||
<Grid Margin="24 20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header do card -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 16">
|
||||
<Ellipse Width="8" Height="8" Fill="#4F8EF7" Margin="0 0 6 0"/>
|
||||
<Ellipse Width="8" Height="8" Fill="#6366F1" Margin="0 0 6 0"/>
|
||||
<Ellipse Width="8" Height="8" Fill="#22C55E" Margin="0 0 0 0"/>
|
||||
<TextBlock Text="Dashboard · Visão Geral"
|
||||
Foreground="#3A5480" FontSize="11"
|
||||
Margin="16 0 0 0" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Barras de preview -->
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal"
|
||||
VerticalAlignment="Bottom">
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="60" Fill="#1A3A6E"
|
||||
RadiusX="4" RadiusY="4"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="90" Fill="#1E4080"
|
||||
RadiusX="4" RadiusY="4"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="50" Fill="#1A3A6E"
|
||||
RadiusX="4" RadiusY="4"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="110" Fill="#4F8EF7"
|
||||
RadiusX="4" RadiusY="4">
|
||||
<Rectangle.Effect>
|
||||
<DropShadowEffect Color="#4F8EF7" BlurRadius="10"
|
||||
ShadowDepth="0" Opacity="0.6"/>
|
||||
</Rectangle.Effect>
|
||||
</Rectangle>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="75" Fill="#1E4080"
|
||||
RadiusX="4" RadiusY="4"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="95" Fill="#243D6B"
|
||||
RadiusX="4" RadiusY="4"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0 0 8 0" VerticalAlignment="Bottom">
|
||||
<Rectangle Width="22" Height="130" Fill="#6366F1"
|
||||
RadiusX="4" RadiusY="4">
|
||||
<Rectangle.Effect>
|
||||
<DropShadowEffect Color="#6366F1" BlurRadius="10"
|
||||
ShadowDepth="0" Opacity="0.5"/>
|
||||
</Rectangle.Effect>
|
||||
</Rectangle>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Stats à direita -->
|
||||
<StackPanel Margin="24 0 0 0" VerticalAlignment="Center">
|
||||
<TextBlock Text="+24.5%" Foreground="#22C55E"
|
||||
FontSize="22" FontWeight="Bold"/>
|
||||
<TextBlock Text="Crescimento mensal"
|
||||
Foreground="#3A5480" FontSize="11"
|
||||
Margin="0 4 0 0"/>
|
||||
<Rectangle Height="1" Fill="#1E3A6E" Margin="0 10"/>
|
||||
<TextBlock Text="↑ 1.284 registros"
|
||||
Foreground="#4F6A99" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- ====================== -->
|
||||
<!-- LADO DIREITO - LOGIN -->
|
||||
<!-- ====================== -->
|
||||
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#0D1117" Offset="0"/>
|
||||
<GradientStop Color="#0A1020" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Grid.Background>
|
||||
|
||||
<!-- Círculo de luz suave atrás do form -->
|
||||
<Ellipse Width="420" Height="420"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0.04">
|
||||
<Ellipse.Fill>
|
||||
<RadialGradientBrush>
|
||||
<GradientStop Color="#4F8EF7" Offset="0"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</RadialGradientBrush>
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
|
||||
<StackPanel Width="340"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
|
||||
<!-- AVATAR COM ANEL GRADIENTE -->
|
||||
<Grid Width="100" Height="100"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0 0 0 24">
|
||||
<!-- Anel externo com gradiente -->
|
||||
<Ellipse Width="100" Height="100">
|
||||
<Ellipse.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#4F8EF7" Offset="0"/>
|
||||
<GradientStop Color="#6366F1" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Ellipse.Fill>
|
||||
<Ellipse.Effect>
|
||||
<DropShadowEffect Color="#4F8EF7" BlurRadius="18"
|
||||
ShadowDepth="0" Opacity="0.5"/>
|
||||
</Ellipse.Effect>
|
||||
</Ellipse>
|
||||
<!-- Inner border -->
|
||||
<Ellipse Width="93" Height="93" Fill="#0D1117"/>
|
||||
<!-- Avatar: logo recreada em XAML -->
|
||||
<Border Width="86" Height="86" CornerRadius="43" ClipToBounds="True">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#1A2D50" Offset="0"/>
|
||||
<GradientStop Color="#131E35" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<Viewbox Width="54" Height="54"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<Grid Width="100" Height="100">
|
||||
<!-- Quadrante superior -->
|
||||
<Path Fill="#3B82F6">
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="50,5" IsClosed="True">
|
||||
<LineSegment Point="78,33"/>
|
||||
<LineSegment Point="50,47"/>
|
||||
<LineSegment Point="22,33"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<!-- Quadrante direito -->
|
||||
<Path>
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#60A5FA" Offset="0"/>
|
||||
<GradientStop Color="#3B82F6" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="53,50" IsClosed="True">
|
||||
<LineSegment Point="78,33"/>
|
||||
<LineSegment Point="95,50"/>
|
||||
<LineSegment Point="78,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<!-- Quadrante inferior -->
|
||||
<Path>
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
|
||||
<GradientStop Color="#2563EB" Offset="0"/>
|
||||
<GradientStop Color="#3B82F6" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="50,53" IsClosed="True">
|
||||
<LineSegment Point="78,67"/>
|
||||
<LineSegment Point="50,95"/>
|
||||
<LineSegment Point="22,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
<!-- Quadrante esquerdo -->
|
||||
<Path>
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.Data>
|
||||
<PathGeometry>
|
||||
<PathFigure StartPoint="47,50" IsClosed="True">
|
||||
<LineSegment Point="22,33"/>
|
||||
<LineSegment Point="5,50"/>
|
||||
<LineSegment Point="22,67"/>
|
||||
</PathFigure>
|
||||
</PathGeometry>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- SAUDAÇÃO -->
|
||||
<TextBlock HorizontalAlignment="Center" Margin="0 0 0 6">
|
||||
<Run Text="Bem-vindo" Foreground="White"
|
||||
FontSize="26" FontWeight="Bold"/>
|
||||
<Run Text=" de volta!" Foreground="#4F6A99" FontSize="26"/>
|
||||
</TextBlock>
|
||||
<TextBlock Text="Faça login para continuar"
|
||||
Foreground="#2F4570"
|
||||
FontSize="13"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0 0 0 34"/>
|
||||
|
||||
<!-- EMAIL -->
|
||||
<TextBlock Text="EMAIL" Foreground="#2F4570"
|
||||
FontSize="10"
|
||||
Margin="4 0 0 6"/>
|
||||
<Border Style="{StaticResource InputFieldBorder}"
|
||||
Margin="0 0 0 18">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="✉" Foreground="#2F4570"
|
||||
FontSize="15"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBox x:Name="TxtEmail"
|
||||
Grid.Column="1" Height="46"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="0 10 12 10"
|
||||
Foreground="White"
|
||||
FontSize="14"
|
||||
CaretBrush="#4F8EF7"
|
||||
VerticalContentAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- SENHA -->
|
||||
<TextBlock Text="SENHA" Foreground="#2F4570"
|
||||
FontSize="10"
|
||||
Margin="4 0 0 6"/>
|
||||
<Border Style="{StaticResource InputFieldBorder}"
|
||||
Margin="0 0 0 10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="44"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="🔒" Foreground="#2F4570"
|
||||
FontSize="14"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
<PasswordBox x:Name="PboxSenha"
|
||||
Grid.Column="1" Height="46"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="0 10 12 10"
|
||||
Foreground="White"
|
||||
VerticalContentAlignment="Center"/>
|
||||
<Button Grid.Column="2" Background="Transparent"
|
||||
BorderThickness="0" Cursor="Hand"
|
||||
Click="BtnMostrarSenha_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="Transparent"
|
||||
Width="44" Height="46">
|
||||
<TextBlock x:Name="eyeIcon"
|
||||
Text="👁" FontSize="14"
|
||||
Foreground="#2F4570"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="eyeIcon"
|
||||
Property="Foreground"
|
||||
Value="#4F8EF7"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ESQUECEU SENHA -->
|
||||
<TextBlock Text="Esqueceu sua senha?"
|
||||
Foreground="#4F8EF7"
|
||||
HorizontalAlignment="Right"
|
||||
Cursor="Hand"
|
||||
FontSize="12"
|
||||
Margin="0 6 4 28"/>
|
||||
|
||||
<!-- BOTÃO ENTRAR -->
|
||||
<Button Content="Entrar"
|
||||
Height="50" FontSize="15"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="White"
|
||||
BorderThickness="0"
|
||||
Cursor="Hand"
|
||||
Click="BtnEntrar_Click">
|
||||
<Button.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#6366F1" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Button.Background>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="btnBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="12"
|
||||
Height="{TemplateBinding Height}">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect x:Name="btnShadow"
|
||||
Color="#3B82F6"
|
||||
BlurRadius="18"
|
||||
ShadowDepth="0"
|
||||
Opacity="0.45"/>
|
||||
</Border.Effect>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock Text="Entrar"
|
||||
Foreground="White"
|
||||
FontSize="15"
|
||||
FontWeight="SemiBold"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text=" →"
|
||||
Foreground="#A5C8FF"
|
||||
FontSize="15"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="btnBorder"
|
||||
Property="Opacity" Value="0.88"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="btnBorder"
|
||||
Property="Opacity" Value="0.72"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
|
||||
<!-- DIVISOR -->
|
||||
<Grid Margin="0 22 0 22">
|
||||
<Rectangle Height="1" Fill="#131E35"/>
|
||||
<Border Background="#0D1117"
|
||||
HorizontalAlignment="Center"
|
||||
Padding="12 0">
|
||||
<TextBlock Text="ou" Foreground="#1E3050" FontSize="12"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<!-- CRIAR CONTA -->
|
||||
<Border CornerRadius="12" BorderThickness="1"
|
||||
Cursor="Hand" Padding="0 13">
|
||||
<Border.BorderBrush>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1E3A6E" Offset="0"/>
|
||||
<GradientStop Color="#1A2D50" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.BorderBrush>
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="#0E1828"/>
|
||||
</Border.Background>
|
||||
<TextBlock HorizontalAlignment="Center" FontSize="13">
|
||||
<Run Text="Não tem conta? " Foreground="#3A5480"/>
|
||||
<Run Text="Criar conta grátis" Foreground="#4F8EF7"
|
||||
FontWeight="SemiBold"/>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
|
||||
<!-- VERSÃO DO SISTEMA -->
|
||||
<TextBlock Text="v2.4.1 · Levelcode SGI"
|
||||
Foreground="#1A2D45"
|
||||
FontSize="10"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0 22 0 0"/>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- ====================== -->
|
||||
<!-- BOTÃO FECHAR -->
|
||||
<!-- ====================== -->
|
||||
|
||||
<Button x:Name="BtnFechar"
|
||||
Width="32" Height="32"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0 14 14 0"
|
||||
Grid.ColumnSpan="2"
|
||||
BorderThickness="0" Cursor="Hand"
|
||||
Click="BtnFechar_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="8" Width="32" Height="32">
|
||||
<TextBlock Text="✕" FontSize="12"
|
||||
Foreground="#2F4570"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border"
|
||||
Property="Background" Value="#C53030"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border"
|
||||
Property="Background" Value="#9B2C2C"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
|
||||
<!-- ====================== -->
|
||||
<!-- BOTÃO CONFIGURAÇÕES -->
|
||||
<!-- ====================== -->
|
||||
|
||||
<Button x:Name="BtnConfiguracoes"
|
||||
Width="36" Height="36"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
Margin="0 0 14 14"
|
||||
Grid.ColumnSpan="2"
|
||||
BorderThickness="0" Cursor="Hand"
|
||||
Click="BtnConfiguracoes_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#101A2E"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="10"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#1E3A6E"
|
||||
Width="36" Height="36">
|
||||
<Path x:Name="gear"
|
||||
Fill="#2F4570"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Width="16" Height="16"
|
||||
Stretch="Uniform"
|
||||
Data="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58
|
||||
c0.18-0.14,0.23-0.41,0.12-0.61l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96
|
||||
c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41h-3.84
|
||||
c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33
|
||||
c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58
|
||||
C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58c-0.18,0.14-0.23,0.41-0.12,0.61
|
||||
l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54
|
||||
c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54
|
||||
c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32
|
||||
c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z
|
||||
M12,15.6c-1.98,0-3.6-1.62-3.6-3.6s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#1A2D50"/>
|
||||
<Setter TargetName="gear" Property="Fill" Value="#4F8EF7"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="#0D1525"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
|
||||
<!-- ====================== -->
|
||||
<!-- POPUP CONFIGURAÇÕES -->
|
||||
<!-- ====================== -->
|
||||
|
||||
<Popup x:Name="PopupConfiguracoes"
|
||||
PlacementTarget="{Binding ElementName=BtnConfiguracoes}"
|
||||
Placement="Top"
|
||||
HorizontalOffset="-170"
|
||||
VerticalOffset="-8"
|
||||
StaysOpen="False"
|
||||
AllowsTransparency="True">
|
||||
|
||||
<Border Background="#0C1628"
|
||||
CornerRadius="14"
|
||||
BorderBrush="#1E3A6E"
|
||||
BorderThickness="1"
|
||||
Width="220"
|
||||
Padding="8">
|
||||
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="#000000"
|
||||
Opacity="0.7"
|
||||
BlurRadius="28"
|
||||
ShadowDepth="6"/>
|
||||
</Border.Effect>
|
||||
|
||||
<StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="12 10 12 4">
|
||||
<TextBlock Text="C O N F I G U R A Ç Õ E S"
|
||||
Foreground="#4F8EF7"
|
||||
FontSize="10"
|
||||
FontWeight="SemiBold"/>
|
||||
</StackPanel>
|
||||
|
||||
<Rectangle Height="1" Margin="0 8 0 6">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1E3A6E" Offset="0"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
|
||||
<Button Style="{StaticResource MenuItemStyle}" Click="MenuAparencia_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="🎨" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Aparência" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource MenuItemStyle}" Click="MenuIdioma_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="🌐" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Idioma" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource MenuItemStyle}" Click="MenuConexao_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="🔌" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Conexão com banco" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource MenuItemStyle}" Click="MenuSobre_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="ℹ" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Sobre o sistema" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<Rectangle Height="1" Margin="0 6">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#1E3A6E" Offset="0"/>
|
||||
<GradientStop Color="Transparent" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
|
||||
<Button Style="{StaticResource MenuItemStyle}" Click="BtnFechar_Click">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="🚪" FontSize="13" Margin="0 0 10 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Fechar sistema" Foreground="#FC8181" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
|
||||
</Popup>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
96
MainWindow.xaml.cs
Normal file
@ -0,0 +1,96 @@
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using UI.Services;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}//Movimentando o formulario
|
||||
|
||||
private void BtnFechar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}//fechar aplicativo
|
||||
|
||||
private void BtnEntrar_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string email = TxtEmail.Text;
|
||||
string senha = PboxSenha.Password;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(email) || string.IsNullOrWhiteSpace(senha))
|
||||
{
|
||||
MessageBox.Show("Informe email e senha.");
|
||||
return;
|
||||
}
|
||||
|
||||
bool login = AuthService.Login(email, senha);
|
||||
|
||||
if (login)
|
||||
{
|
||||
MessageBox.Show("Login realizado com sucesso!");
|
||||
|
||||
// abrir dashboard futuramente
|
||||
// new Dashboard().Show();
|
||||
// this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Usuário ou senha inválidos.");
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnMostrarSenha_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnConfiguracoes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PopupConfiguracoes.IsOpen = !PopupConfiguracoes.IsOpen;
|
||||
}
|
||||
|
||||
private void MenuAparencia_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dh = new UI.Dashboard.DashboardMain();
|
||||
dh.ShowDialog();
|
||||
}
|
||||
|
||||
private void MenuConexao_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var db = new UI.Configuracao.ConfiguracaoBanco();
|
||||
db.ShowDialog();
|
||||
}
|
||||
|
||||
private void MenuIdioma_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void MenuSobre_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
449
Outros/FrmAjuda.xaml
Normal file
@ -0,0 +1,449 @@
|
||||
<UserControl x:Class="UI.Outros.FrmAjuda"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="#0D1117">
|
||||
|
||||
<UserControl.Resources>
|
||||
|
||||
<Style x:Key="BtnPrimary" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="bd" CornerRadius="9"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Height="{TemplateBinding Height}">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.85"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="bd" Property="Opacity" Value="0.7"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="InputBusca" TargetType="TextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Foreground" Value="#64748B"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="CaretBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<Grid Margin="28 20 28 28">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="16"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- BREADCRUMB -->
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<TextBlock Text="‹" Foreground="#334155" FontSize="14"
|
||||
Margin="0 0 4 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Início" Foreground="#334155" FontSize="13"
|
||||
VerticalAlignment="Center" Cursor="Hand"/>
|
||||
<TextBlock Text=" › " Foreground="#334155" FontSize="13" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Ajuda" Foreground="#F1F5F9" FontSize="13"
|
||||
FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- TÍTULO -->
|
||||
<TextBlock Grid.Row="1" Text="Ajuda"
|
||||
Foreground="#F1F5F9" FontSize="26" FontWeight="Bold"/>
|
||||
|
||||
<!-- CARD PRINCIPAL -->
|
||||
<Border Grid.Row="3" CornerRadius="16" BorderThickness="1"
|
||||
BorderBrush="#1E2D4A" Padding="20">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0D1525" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<StackPanel>
|
||||
|
||||
<!-- BARRA DE BUSCA -->
|
||||
<Border Background="#131E35" BorderBrush="#1E2D4A" BorderThickness="1"
|
||||
CornerRadius="10" Height="42" Margin="0 0 0 20">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="44"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="🔍" FontSize="14" Foreground="#334155"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBox Grid.Column="1" Style="{StaticResource InputBusca}"
|
||||
Text="Buscar por resposta..." Foreground="#334155"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- GRID DE CARDS 3x2 -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="12"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- CARD 1: Começando -->
|
||||
<Border Grid.Column="0" Grid.Row="0"
|
||||
BorderThickness="1" CornerRadius="12" Padding="16" Cursor="Hand">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0F1A2E" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#162035" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<Border Width="44" Height="44" CornerRadius="10"
|
||||
Background="#1A3A6E" Margin="0 0 12 0">
|
||||
<TextBlock Text="❓" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Começando com o
Sistema SGI"
|
||||
Foreground="#F1F5F9" FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Aprenda os primeiros passos para uso do sistema."
|
||||
Foreground="#64748B" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
|
||||
<TextBlock Text="Ver artigos" Foreground="#3B82F6" FontSize="12" Cursor="Hand"/>
|
||||
<TextBlock Text=" ›" Foreground="#3B82F6" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- CARD 2: Gerenciamento -->
|
||||
<Border Grid.Column="2" Grid.Row="0"
|
||||
BorderThickness="1" CornerRadius="12" Padding="16" Cursor="Hand">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0F1A2E" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#162035" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<Border Width="44" Height="44" CornerRadius="10"
|
||||
Background="#1A2A3A" Margin="0 0 12 0">
|
||||
<TextBlock Text="👥" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Gerenciamento de
Usuários"
|
||||
Foreground="#F1F5F9" FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Saiba como adicionar, editar e remover usuários."
|
||||
Foreground="#64748B" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
|
||||
<TextBlock Text="Ver artigos" Foreground="#3B82F6" FontSize="12" Cursor="Hand"/>
|
||||
<TextBlock Text=" ›" Foreground="#3B82F6" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- CARD 3: Configurações -->
|
||||
<Border Grid.Column="4" Grid.Row="0"
|
||||
BorderThickness="1" CornerRadius="12" Padding="16" Cursor="Hand">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0F1A2E" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#162035" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<Border Width="44" Height="44" CornerRadius="10"
|
||||
Background="#1A3A20" Margin="0 0 12 0">
|
||||
<TextBlock Text="⚙" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Configurações
do Sistema"
|
||||
Foreground="#F1F5F9" FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Personalize as configurações de acordo com suas necessidades."
|
||||
Foreground="#64748B" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
|
||||
<TextBlock Text="Ver artigos" Foreground="#3B82F6" FontSize="12" Cursor="Hand"/>
|
||||
<TextBlock Text=" ›" Foreground="#3B82F6" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- CARD 4: Segurança -->
|
||||
<Border Grid.Column="0" Grid.Row="2"
|
||||
BorderThickness="1" CornerRadius="12" Padding="16" Cursor="Hand">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0F1A2E" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#162035" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<Border Width="44" Height="44" CornerRadius="10"
|
||||
Background="#3A2A10" Margin="0 0 12 0">
|
||||
<TextBlock Text="🔒" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Segurança e Acesso"
|
||||
Foreground="#F1F5F9" FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Mantenha suas informações seguras e controle o acesso."
|
||||
Foreground="#64748B" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
|
||||
<TextBlock Text="Ver artigos" Foreground="#3B82F6" FontSize="12" Cursor="Hand"/>
|
||||
<TextBlock Text=" ›" Foreground="#3B82F6" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- CARD 5: Resolução de Problemas -->
|
||||
<Border Grid.Column="2" Grid.Row="2"
|
||||
BorderThickness="1" CornerRadius="12" Padding="16" Cursor="Hand">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="#1E2D4A"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#111827" Offset="0"/>
|
||||
<GradientStop Color="#0F1A2E" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#3B82F6"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#162035" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<Border Width="44" Height="44" CornerRadius="10"
|
||||
Background="#1A2A3A" Margin="0 0 12 0">
|
||||
<TextBlock Text="🖥" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Resolução de
Problemas"
|
||||
Foreground="#F1F5F9" FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Soluções para problemas comuns no uso do sistema."
|
||||
Foreground="#64748B" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
|
||||
<TextBlock Text="Ver artigos" Foreground="#3B82F6" FontSize="12" Cursor="Hand"/>
|
||||
<TextBlock Text=" ›" Foreground="#3B82F6" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- CARD 6: Contato e Suporte -->
|
||||
<Border Grid.Column="4" Grid.Row="2"
|
||||
BorderThickness="1" CornerRadius="12" Padding="16" Cursor="Hand">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="#1A3A2A"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#0D1F16" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="BorderBrush" Value="#22C55E"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
|
||||
<GradientStop Color="#0D2A1A" Offset="0"/>
|
||||
<GradientStop Color="#111827" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 0 0 10">
|
||||
<Border Width="44" Height="44" CornerRadius="10"
|
||||
Background="#1A3A20" Margin="0 0 12 0">
|
||||
<TextBlock Text="💬" FontSize="20"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
<TextBlock Text="Contato e Suporte"
|
||||
Foreground="#F1F5F9" FontSize="14" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="Entre em contato com a equipe de suporte para obter ajuda."
|
||||
Foreground="#64748B" FontSize="12" TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0">
|
||||
<TextBlock Text="Entrar em contato" Foreground="#22C55E" FontSize="12" Cursor="Hand"/>
|
||||
<TextBlock Text=" ›" Foreground="#22C55E" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- SEPARADOR -->
|
||||
<Rectangle Height="1" Fill="#1E2D4A" Margin="0 24 0 20"/>
|
||||
|
||||
<!-- BOTÃO FEEDBACK + RODAPÉ -->
|
||||
<StackPanel HorizontalAlignment="Center">
|
||||
<Button Height="42" Padding="28 0"
|
||||
Style="{StaticResource BtnPrimary}"
|
||||
Click="BtnFeedback_Click">
|
||||
<Button.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
||||
<GradientStop Color="#3B82F6" Offset="0"/>
|
||||
<GradientStop Color="#2563EB" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
</Button.Background>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="📋" FontSize="14" Margin="0 0 8 0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="Enviar Feedback" FontSize="13"
|
||||
FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<TextBlock Margin="0 14 0 0" HorizontalAlignment="Center"
|
||||
TextAlignment="Center" TextWrapping="Wrap" MaxWidth="600">
|
||||
<Run Text="Ainda precisa de ajuda? "
|
||||
Foreground="#64748B" FontSize="12"/>
|
||||
<Run Text="Estamos disponíveis para ajuda com qualquer dúvida ou problema que você possa ter."
|
||||
Foreground="#334155" FontSize="12"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
24
Outros/FrmAjuda.xaml.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
// ✅ Namespace deve bater exatamente com x:Class do XAML: UI.Ajuda.PaginaAjuda
|
||||
// Se o seu projeto usar outro namespace raiz, ajuste aqui e no x:Class do XAML.
|
||||
namespace UI.Outros
|
||||
{
|
||||
public partial class FrmAjuda : UserControl
|
||||
{
|
||||
public FrmAjuda()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BtnFeedback_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show(
|
||||
"Obrigado pelo seu feedback!\nEm breve nossa equipe entrará em contato.",
|
||||
"Feedback Enviado",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Services/AuthService.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Data.SqlClient;
|
||||
using UI.Database;
|
||||
|
||||
namespace UI.Services
|
||||
{
|
||||
public class AuthService
|
||||
{
|
||||
public static bool Login(string email, string senha)
|
||||
{
|
||||
using (SqlConnection conn = DatabaseService.GetConnection())
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
string sql =
|
||||
@"SELECT Id
|
||||
FROM Usuarios
|
||||
WHERE Email = @Email
|
||||
AND SenhaHash = @Senha
|
||||
AND Status = 1";
|
||||
|
||||
SqlCommand cmd = new SqlCommand(sql, conn);
|
||||
|
||||
cmd.Parameters.AddWithValue("@Email", email);
|
||||
cmd.Parameters.AddWithValue("@Senha", senha);
|
||||
|
||||
object result = cmd.ExecuteScalar();
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
int userId = (int)result;
|
||||
|
||||
AtualizarUltimoLogin(conn, userId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AtualizarUltimoLogin(SqlConnection conn, int userId)
|
||||
{
|
||||
string update =
|
||||
@"UPDATE Usuarios
|
||||
SET UltimoLogin = GETDATE()
|
||||
WHERE Id = @Id";
|
||||
|
||||
SqlCommand cmd = new SqlCommand(update, conn);
|
||||
|
||||
cmd.Parameters.AddWithValue("@Id", userId);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
63
UI.csproj
Normal file
@ -0,0 +1,63 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\Images\avatar_user.png" />
|
||||
<None Remove="Assets\Images\background_preview.png" />
|
||||
<None Remove="Assets\Images\background_texture.png" />
|
||||
<None Remove="Assets\Images\icon_email.png" />
|
||||
<None Remove="Assets\Images\icon_eye.png" />
|
||||
<None Remove="Assets\Images\icon_password.png" />
|
||||
<None Remove="Assets\Images\logo_levelcode.png" />
|
||||
<None Remove="Assets\Images\logo_levelcode.svg" />
|
||||
<None Remove="Assets\Images\logo_levelcode2.png" />
|
||||
<None Remove="Assets\Images\Logo_simples.png" />
|
||||
<None Remove="background_preview.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.4" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.9.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Assets\Images\avatar_user.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\background_preview.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\background_texture.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\icon_email.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\icon_eye.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\icon_password.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\logo_levelcode.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\logo_levelcode.svg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Assets\Images\logo_levelcode2.png" />
|
||||
<Resource Include="Assets\Images\Logo_simples.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="background_preview.png" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
BIN
background_preview.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |