This commit is contained in:
Your Name 2025-01-28 11:20:02 +03:00
commit 3db87ed23d
235 changed files with 6737 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/modules.xml
/.idea.demo15012025.iml
/contentModel.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AvaloniaProject">
<option name="projectPerEditor">
<map>
<entry key="demo15012025/MainWindow.axaml" value="demo15012025/demo15012025.csproj" />
</map>
</option>
</component>
</project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings" defaultProject="true" />
</project>

16
demo15012025.sln Normal file
View File

@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "demo15012025", "demo15012025\demo15012025.csproj", "{F0AAD8ED-C3E3-43D4-81C5-8CA17457E498}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0AAD8ED-C3E3-43D4-81C5-8CA17457E498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0AAD8ED-C3E3-43D4-81C5-8CA17457E498}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0AAD8ED-C3E3-43D4-81C5-8CA17457E498}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0AAD8ED-C3E3-43D4-81C5-8CA17457E498}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

BIN
demo15012025/.DS_Store vendored Normal file

Binary file not shown.

10
demo15012025/App.axaml Normal file
View File

@ -0,0 +1,10 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="demo15012025.App"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>

23
demo15012025/App.axaml.cs Normal file
View File

@ -0,0 +1,23 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
namespace demo15012025;
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}
base.OnFrameworkInitializationCompleted();
}
}

15
demo15012025/Auth.axaml Normal file
View File

@ -0,0 +1,15 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo15012025.Auth"
Title="Auth">
<DockPanel Background="Bisque">
<StackPanel Spacing="5" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBox x:Name="Email" Width="200" Watermark="login"/>
<TextBox x:Name="Password" Width="200" Watermark="password"/>
<Button Click="AuthButton_OnClick" Content="auth" Foreground="Black" Background="LightGray"/>
</StackPanel>
</DockPanel>
</Window>

View File

@ -0,0 +1,38 @@
using System;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
namespace demo15012025;
public partial class Auth : Window
{
public Auth()
{
InitializeComponent();
}
private void AuthButton_OnClick(object? sender, RoutedEventArgs e)
{
var email = Email?.Text;
var password = Password?.Text;
var client = MainWindow.ClientAuthList?.FirstOrDefault(it => it.Email == email);
if (client != null && client.Password == password)
{
Console.WriteLine("success");
if (client.Role == 1)
{
OrganizatorWindow organizatorWindow = new OrganizatorWindow();
organizatorWindow.ShowDialog(this);
}
}
else
{
Console.WriteLine("wrong");
}
}
}

View File

@ -0,0 +1,49 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo15012025.MainWindow"
x:CompileBindings="False"
Title="demo15012025">
<DockPanel>
<Border DockPanel.Dock="Top" Background="Aqua" Height="50">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="10">
<ComboBox x:Name="DirectionComboBox" Width="150" SelectionChanged="DirectionComboBox_OnSelectionChanged"/>
<ComboBox x:Name="DateComboBox" Width="150" SelectionChanged="DateComboBox_OnSelectionChanged"/>
</StackPanel>
<Button Grid.Column="2" Content="Auth" HorizontalAlignment="Right" Margin="10,0,10,0" VerticalAlignment="Center" Foreground="Black" Background="LightGray" Click="AuthButton_OnClick" />
</Grid>
</Border>
<ListBox x:Name = "EventListBox" Background="Beige">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="3" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Gray" BorderThickness="1" Padding="5" Margin="5">
<Grid ColumnDefinitions="Auto, 1*" VerticalAlignment="Center">
<Image Source="{Binding Image}" Width="100" Height="100" Margin="0,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Left" Stretch="UniformToFill"/>
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" MaxWidth="250">
<TextBlock Text="{Binding Sobitie}" TextWrapping="Wrap" TextAlignment="Left" Foreground="Black" FontSize="14" Margin="0,0,0,5"/>
<TextBlock Text="{Binding Date}" TextWrapping="Wrap" TextAlignment="Left" Foreground="Black" FontSize="12" Margin="0,0,0,5"/>
<TextBlock Text="{Binding DirectionId}" TextWrapping="Wrap" TextAlignment="Left" Foreground="Black" FontSize="12"/>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DockPanel>
</Window>

View File

@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media.Imaging;
using demo15012025.Models;
using demo15012025.ModelsMine;
namespace demo15012025;
public partial class MainWindow : Window
{
ObservableCollection<EventPresenter> events = new ObservableCollection<EventPresenter>();
List<EventPresenter> dataSourceEvent;
ObservableCollection<ClientAuth> authClients = new ObservableCollection<ClientAuth>();
List<ClientAuth> dataSourceClient;
public List<string> DirectionsList { get; }
public List<DateTime> DatesList { get; }
public static ObservableCollection<ClientAuth> ClientAuthList { get; set; }
public MainWindow()
{
InitializeComponent();
using var context = new DatabaseContext();
dataSourceEvent = context.Events.Select(it => new EventPresenter
{
Sobitie = it.Sobitie,
Date = it.Date,
Days = it.Days,
City = it.City,
Photopath = it.Photopath,
DirectionId = it.DirectionId,
}).ToList();
EventListBox.ItemsSource = events;
dataSourceClient = context.Clients.Select(it => new ClientAuth
{
Email = it.Email,
Password = it.Password,
Role = it.Role,
FIO = it.Fio,
}).ToList();
DirectionsList = context.Directions.Select(it => it.Name).ToList();
DirectionComboBox.ItemsSource = DirectionsList;
DatesList = dataSourceEvent.Select(s => s.Date).ToList();
DateComboBox.ItemsSource = DatesList;
DisplayServices();
}
public class EventPresenter() : Event
{
Bitmap? Image
{
get
{
try
{
string absolutePath = Path.Combine(AppContext.BaseDirectory, Photopath);
return new Bitmap(absolutePath);
}
catch
{
return null;
}
}
}
}
public void DisplayServices()
{
var temp = dataSourceEvent;
var temp2 = dataSourceClient;
events.Clear();
if (DirectionComboBox != null)
{
temp = temp.Where(it => it.Direction == DirectionComboBox.SelectedItem).ToList();
}
if (DateComboBox.SelectedItem != null)
{
DateTime selectedDate = (DateTime)DateComboBox.SelectedItem;
temp = temp.Where(it => it.Date.Date == selectedDate.Date).ToList();
}
foreach (var item in temp)
{
events.Add(item);
}
foreach (var item in temp2)
{
authClients.Add(item);
}
ClientAuthList = authClients;
}
private void AuthButton_OnClick(object? sender, RoutedEventArgs e)
{
Auth auth = new Auth();
auth.ShowDialog(this);
}
private void DirectionComboBox_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
DisplayServices();
}
private void DateComboBox_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
{
DisplayServices();
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Activity
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Client> Moderators { get; set; } = new List<Client>();
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class City
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Event> Events { get; set; } = new List<Event>();
}

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Client
{
public int Id { get; set; }
public string Fio { get; set; } = null!;
public string Email { get; set; } = null!;
public DateTime Date { get; set; }
public int Country { get; set; }
public string Phone { get; set; } = null!;
public string Password { get; set; } = null!;
public string? Spec { get; set; }
public string? Meropriyatie { get; set; }
public string Photopath { get; set; } = null!;
public char Gender { get; set; }
public int Role { get; set; }
public virtual Country CountryNavigation { get; set; } = null!;
public virtual Role RoleNavigation { get; set; } = null!;
public virtual ICollection<Activity> Activities { get; set; } = new List<Activity>();
public virtual ICollection<Event> Events { get; set; } = new List<Event>();
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Country
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string EnName { get; set; } = null!;
public string Code { get; set; } = null!;
public int Code2 { get; set; }
public virtual ICollection<Client> Clients { get; set; } = new List<Client>();
}

View File

@ -0,0 +1,297 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace demo15012025.Models;
public partial class DatabaseContext : DbContext
{
public DatabaseContext()
{
}
public DatabaseContext(DbContextOptions<DatabaseContext> options)
: base(options)
{
}
public virtual DbSet<Activity> Activities { get; set; }
public virtual DbSet<City> Cities { get; set; }
public virtual DbSet<Client> Clients { get; set; }
public virtual DbSet<Country> Countries { get; set; }
public virtual DbSet<Direction> Directions { get; set; }
public virtual DbSet<Event> Events { get; set; }
public virtual DbSet<Eventactivity> Eventactivities { get; set; }
public virtual DbSet<Jhuriactivity> Jhuriactivities { get; set; }
public virtual DbSet<Role> Roles { get; set; }
public virtual DbSet<ValidActivityJhuri> ValidActivityJhuris { get; set; }
public virtual DbSet<ValidActivityModerator> ValidActivityModerators { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseNpgsql("Host=localhost;Database=postgres;Username=postgres;Password=5432");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Activity>(entity =>
{
entity.HasKey(e => e.Id).HasName("activity_pkey");
entity.ToTable("activity");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Name)
.HasMaxLength(100)
.HasColumnName("name");
entity.HasMany(d => d.Moderators).WithMany(p => p.Activities)
.UsingEntity<Dictionary<string, object>>(
"Activitymoderator",
r => r.HasOne<Client>().WithMany()
.HasForeignKey("Moderatorid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_moderator"),
l => l.HasOne<Activity>().WithMany()
.HasForeignKey("Activityid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_activity"),
j =>
{
j.HasKey("Activityid", "Moderatorid").HasName("activitymoderator_pkey");
j.ToTable("activitymoderator");
j.IndexerProperty<int>("Activityid").HasColumnName("activityid");
j.IndexerProperty<int>("Moderatorid").HasColumnName("moderatorid");
});
});
modelBuilder.Entity<City>(entity =>
{
entity.HasKey(e => e.Id).HasName("city_pkey");
entity.ToTable("city");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Name)
.HasMaxLength(100)
.HasColumnName("name");
});
modelBuilder.Entity<Client>(entity =>
{
entity.HasKey(e => e.Id).HasName("clients_pkey");
entity.ToTable("clients");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Country).HasColumnName("country");
entity.Property(e => e.Date)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("date");
entity.Property(e => e.Email)
.HasMaxLength(100)
.HasColumnName("email");
entity.Property(e => e.Fio)
.HasMaxLength(200)
.HasColumnName("fio");
entity.Property(e => e.Gender)
.HasMaxLength(1)
.HasColumnName("gender");
entity.Property(e => e.Meropriyatie)
.HasMaxLength(50)
.HasColumnName("meropriyatie");
entity.Property(e => e.Password)
.HasMaxLength(50)
.HasColumnName("password");
entity.Property(e => e.Phone)
.HasMaxLength(20)
.HasColumnName("phone");
entity.Property(e => e.Photopath)
.HasMaxLength(100)
.HasColumnName("photopath");
entity.Property(e => e.Role).HasColumnName("role");
entity.Property(e => e.Spec)
.HasMaxLength(50)
.HasColumnName("spec");
entity.HasOne(d => d.CountryNavigation).WithMany(p => p.Clients)
.HasForeignKey(d => d.Country)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_country");
entity.HasOne(d => d.RoleNavigation).WithMany(p => p.Clients)
.HasForeignKey(d => d.Role)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_role");
});
modelBuilder.Entity<Country>(entity =>
{
entity.HasKey(e => e.Id).HasName("country_pkey");
entity.ToTable("country");
entity.HasIndex(e => e.Code2, "country_code2_key").IsUnique();
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Code)
.HasMaxLength(5)
.HasColumnName("code");
entity.Property(e => e.Code2).HasColumnName("code2");
entity.Property(e => e.EnName)
.HasMaxLength(100)
.HasColumnName("en_name");
entity.Property(e => e.Name)
.HasMaxLength(100)
.HasColumnName("name");
});
modelBuilder.Entity<Direction>(entity =>
{
entity.HasKey(e => e.Id).HasName("direction_pkey");
entity.ToTable("direction");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Name)
.HasMaxLength(255)
.HasColumnName("name");
});
modelBuilder.Entity<Event>(entity =>
{
entity.HasKey(e => e.Id).HasName("event_pkey");
entity.ToTable("event");
entity.HasIndex(e => e.Date, "event_date_key").IsUnique();
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.City).HasColumnName("city");
entity.Property(e => e.Date)
.HasColumnType("timestamp(6) without time zone")
.HasColumnName("date");
entity.Property(e => e.Days).HasColumnName("days");
entity.Property(e => e.DirectionId).HasColumnName("direction_id");
entity.Property(e => e.Photopath)
.HasMaxLength(255)
.HasColumnName("photopath");
entity.Property(e => e.Sobitie)
.HasMaxLength(200)
.HasColumnName("sobitie");
entity.HasOne(d => d.CityNavigation).WithMany(p => p.Events)
.HasForeignKey(d => d.City)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_city");
entity.HasOne(d => d.Direction).WithMany(p => p.Events)
.HasForeignKey(d => d.DirectionId)
.OnDelete(DeleteBehavior.SetNull)
.HasConstraintName("fk_event_direction");
entity.HasMany(d => d.Winners).WithMany(p => p.Events)
.UsingEntity<Dictionary<string, object>>(
"Eventwinner",
r => r.HasOne<Client>().WithMany()
.HasForeignKey("Winnerid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_moderator"),
l => l.HasOne<Event>().WithMany()
.HasForeignKey("Eventid")
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_event"),
j =>
{
j.HasKey("Eventid", "Winnerid").HasName("eventwinner_pkey");
j.ToTable("eventwinner");
j.IndexerProperty<int>("Eventid").HasColumnName("eventid");
j.IndexerProperty<int>("Winnerid").HasColumnName("winnerid");
});
});
modelBuilder.Entity<Eventactivity>(entity =>
{
entity
.HasNoKey()
.ToTable("eventactivity");
entity.Property(e => e.Activityid).HasColumnName("activityid");
entity.Property(e => e.Eventid).HasColumnName("eventid");
entity.HasOne(d => d.Activity).WithMany()
.HasForeignKey(d => d.Activityid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_activity");
entity.HasOne(d => d.Event).WithMany()
.HasForeignKey(d => d.Eventid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_event");
});
modelBuilder.Entity<Jhuriactivity>(entity =>
{
entity
.HasNoKey()
.ToTable("jhuriactivity");
entity.Property(e => e.Activityid).HasColumnName("activityid");
entity.Property(e => e.Jhuriid).HasColumnName("jhuriid");
entity.HasOne(d => d.Activity).WithMany()
.HasForeignKey(d => d.Activityid)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_activity");
entity.HasOne(d => d.Jhuri).WithMany()
.HasForeignKey(d => d.Jhuriid)
.HasConstraintName("fk_moderator");
});
modelBuilder.Entity<Role>(entity =>
{
entity.HasKey(e => e.Id).HasName("roles_pkey");
entity.ToTable("roles");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Name)
.HasMaxLength(20)
.HasColumnName("name");
});
modelBuilder.Entity<ValidActivityJhuri>(entity =>
{
entity
.HasNoKey()
.ToView("valid_activity_jhuri");
entity.Property(e => e.Activityid).HasColumnName("activityid");
entity.Property(e => e.Jhuriid).HasColumnName("jhuriid");
});
modelBuilder.Entity<ValidActivityModerator>(entity =>
{
entity
.HasNoKey()
.ToView("valid_activity_moderators");
entity.Property(e => e.Activityid).HasColumnName("activityid");
entity.Property(e => e.Moderatorid).HasColumnName("moderatorid");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Direction
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Event> Events { get; set; } = new List<Event>();
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Event
{
public int Id { get; set; }
public string Sobitie { get; set; } = null!;
public DateTime Date { get; set; }
public int Days { get; set; }
public int City { get; set; }
public string? Photopath { get; set; }
public int? DirectionId { get; set; }
public virtual City CityNavigation { get; set; } = null!;
public virtual Direction? Direction { get; set; }
public virtual ICollection<Client> Winners { get; set; } = new List<Client>();
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Eventactivity
{
public int Eventid { get; set; }
public int Activityid { get; set; }
public virtual Activity Activity { get; set; } = null!;
public virtual Event Event { get; set; } = null!;
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Jhuriactivity
{
public int Activityid { get; set; }
public int? Jhuriid { get; set; }
public virtual Activity Activity { get; set; } = null!;
public virtual Client? Jhuri { get; set; }
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class Role
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public virtual ICollection<Client> Clients { get; set; } = new List<Client>();
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class ValidActivityJhuri
{
public int? Activityid { get; set; }
public int? Jhuriid { get; set; }
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
namespace demo15012025.Models;
public partial class ValidActivityModerator
{
public int? Activityid { get; set; }
public int? Moderatorid { get; set; }
}

View File

@ -0,0 +1,11 @@
using demo15012025.Models;
namespace demo15012025.ModelsMine;
public class ClientAuth: Client
{
public string Email { get; set; } = null!;
public string Password { get; set; } = null!;
public int Role { get; set; }
public string FIO { get; set; } = null!;
}

View File

@ -0,0 +1,40 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo15012025.OrganizatorWindow"
x:CompileBindings="False"
Title="OrganizatorWindow">
<DockPanel>
<Border DockPanel.Dock="Top" Background="Aqua" Height="50">
<TextBlock Text="Окно организатора" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20"/>
</Border>
<Grid ColumnDefinitions="Auto, 1*" VerticalAlignment="Center" Margin="10,0,0,0">
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" MaxWidth="250">
<Image Width="150" Height="250"/>
<Border BorderBrush="Gray" BorderThickness="1" Padding="5">
<TextBlock HorizontalAlignment="Center" Width="150" Height="50" FontSize="20" TextAlignment="Center" >
<Run Text="Мой" />
<LineBreak />
<Run Text="профиль" />
</TextBlock>
</Border>
</StackPanel>
</Grid>
<Grid ColumnDefinitions="Auto, 1*" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" MaxWidth="250" Spacing="15">
<!-- <TextBlock Text="{Binding output}"/> -->
<Button x:Name="Button1" Height="80" Width="300" Click="_1Button_OnClick">
<TextBlock Text="Мероприятия" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button x:Name="Button2" Height="80" Width="300" Click="_2Button_OnClick">
<TextBlock Text="Участники" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button x:Name="Button3" Height="80" Width="300" Click="_3Button_OnClick">
<TextBlock Text="Жюри" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</StackPanel>
</Grid>
</DockPanel>
</Window>

View File

@ -0,0 +1,49 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping;
namespace demo15012025;
public partial class OrganizatorWindow : Window
{
public OrganizatorWindow()
{
var output = "";
InitializeComponent();
DateTime currentTime = DateTime.Now;
if (currentTime.Hour > 9 && currentTime.Hour < 11)
{
output = "Доброе утро!\n";
} else if (currentTime.Hour > 11 && currentTime.Hour < 18)
{
output = "Добрый день!\n";
}
else
{
output = "Добрый вечер!\n";
}
//todo передавай имя из прошлого окна ++ проблемы с output
}
private void _3Button_OnClick(object? sender, RoutedEventArgs e)
{
RegJhuri regJhuri = new RegJhuri();
regJhuri.ShowDialog(this);
}
private void _2Button_OnClick(object? sender, RoutedEventArgs e)
{
throw new System.NotImplementedException();
}
private void _1Button_OnClick(object? sender, RoutedEventArgs e)
{
MainWindow mainWindow = new MainWindow();
mainWindow.ShowDialog(this);
}
}

21
demo15012025/Program.cs Normal file
View File

@ -0,0 +1,21 @@
using Avalonia;
using System;
namespace demo15012025;
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}

View File

@ -0,0 +1,57 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="demo15012025.RegJhuri"
Title="RegJhuri">
<DockPanel>
<Grid>
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="15">
<TextBlock Text="Id Number:" VerticalAlignment="Top"/>
<TextBox Width="250" HorizontalAlignment="Left"/>
<TextBlock Text="Фио:" VerticalAlignment="Top"/>
<TextBox Width="250" HorizontalAlignment="Left"/>
<TextBlock Text="Пол:" VerticalAlignment="Top"/>
<ComboBox Width="250" HorizontalAlignment="Left"/>
<TextBlock Text="Роль:" VerticalAlignment="Top"/>
<ComboBox Width="250" HorizontalAlignment="Left"/>
<TextBlock Text="Email:" VerticalAlignment="Top"/>
<TextBox Width="250" HorizontalAlignment="Left"/>
<TextBlock Text="Телефон:" VerticalAlignment="Top"/>
<TextBox Width="250" Name="PhoneTextBox" Text="+7 " KeyUp="PhoneTextBox_OnKeyUp" HorizontalAlignment="Left"/>
<TextBlock Text="Направление:" VerticalAlignment="Top"/>
<TextBox Width="250" HorizontalAlignment="Left"/>
<CheckBox Content="Прикрепить к мероприятию" HorizontalAlignment="Right"/>
<TextBlock Text="Мероприятие:" VerticalAlignment="Top"/>
<ComboBox Width="250" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="15">
<Rectangle Width="200" Height="250" Fill="Gray" HorizontalAlignment="Right"/>
<TextBlock Text="Пароль:" VerticalAlignment="Top"/>
<TextBox Width="250" HorizontalAlignment="Left" Watermark="Password"/>
<TextBlock Text="Повтор пароля:" VerticalAlignment="Top"/>
<TextBox Width="250" HorizontalAlignment="Left" Watermark="Re-enter password"/>
<CheckBox Content="Видимый пароль" HorizontalAlignment="Right"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10">
<Button Content="Ok" HorizontalAlignment="Right"/>
<Button Content="Отмена" HorizontalAlignment="Right"/>
</StackPanel>
</StackPanel>
</Grid>
</DockPanel>
</Window>

View File

@ -0,0 +1,38 @@
using System;
using System.Text.RegularExpressions;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
namespace demo15012025;
public partial class RegJhuri : Window
{
public RegJhuri()
{
InitializeComponent();
}
private void PhoneTextBox_OnKeyUp(object? sender, KeyEventArgs e)
{
if (sender is TextBox textBox)
{
// Убираем все символы, кроме цифр
string digitsOnly = Regex.Replace(textBox.Text, @"\D", "");
// Формируем текст с маской
string formatted = "+7 ";
if (digitsOnly.Length > 1) formatted += "(" + digitsOnly.Substring(1, Math.Min(3, digitsOnly.Length - 1)) + ")";
if (digitsOnly.Length > 4) formatted += " " + digitsOnly.Substring(4, Math.Min(3, digitsOnly.Length - 4));
if (digitsOnly.Length > 7) formatted += "-" + digitsOnly.Substring(7, Math.Min(2, digitsOnly.Length - 7));
if (digitsOnly.Length > 9) formatted += "-" + digitsOnly.Substring(9, Math.Min(2, digitsOnly.Length - 9));
// Сохраняем текст с маской
textBox.Text = formatted;
// Перемещаем курсор в конец текста
textBox.CaretIndex = formatted.Length;
}
}
}

18
demo15012025/app.manifest Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embedded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.0.0.0" name="demo15012025.Desktop"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>

BIN
demo15012025/bin/.DS_Store vendored Normal file

Binary file not shown.

BIN
demo15012025/bin/Debug/.DS_Store vendored Normal file

Binary file not shown.

BIN
demo15012025/bin/Debug/net8.0/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More