5 Revize c1a27bb32a ... 4ba82bda6e

Autor SHA1 Zpráva Datum
  AngelikaSuhareva 4ba82bda6e merge with together před 2 měsíci
  AngelikaSuhareva 2bc8a48f5d not fineshed před 2 měsíci
  AngelikaSuhareva 1a61eb962a add db, authorizationd and adding trade networks před 3 měsíci
  AngelikaSuhareva 0276f8049c Merge branch 'master' into Nadia před 3 měsíci
  AngelikaSuhareva 93c0cb71b2 add db před 3 měsíci

+ 9 - 0
Acosta.csproj

@@ -28,5 +28,14 @@
     <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
     <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
     <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.10" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.14">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
   </ItemGroup>
 </Project>

+ 13 - 0
Models/Acceptance.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Acceptance
+{
+    public int Acceptanceid { get; set; }
+
+    public string Title { get; set; } = null!;
+
+    public virtual ICollection<Visit> Visits { get; set; } = new List<Visit>();
+}

+ 25 - 0
Models/Employee.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Employee
+{
+    public int Employeesid { get; set; }
+
+    public string Surname { get; set; } = null!;
+
+    public string Name { get; set; } = null!;
+
+    public string Patronymic { get; set; } = null!;
+
+    public string Phonenumber { get; set; } = null!;
+
+    public string Email { get; set; } = null!;
+
+    public int Role { get; set; }
+
+    public string Password { get; set; } = null!;
+
+    public virtual Role RoleNavigation { get; set; } = null!;
+}

+ 19 - 0
Models/Outlet.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Outlet
+{
+    public int Outletid { get; set; }
+
+    public string Address { get; set; } = null!;
+
+    public string Location { get; set; } = null!;
+
+    public int TradeNetworks { get; set; }
+
+    public virtual TradeNetwork TradeNetworksNavigation { get; set; } = null!;
+
+    public virtual ICollection<Visit> Visits { get; set; } = new List<Visit>();
+}

+ 17 - 0
Models/Product.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Product
+{
+    public int Productid { get; set; }
+
+    public string Title { get; set; } = null!;
+
+    public int Project { get; set; }
+
+    public virtual ICollection<ProductReport> ProductReports { get; set; } = new List<ProductReport>();
+
+    public virtual Project ProjectNavigation { get; set; } = null!;
+}

+ 25 - 0
Models/ProductReport.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class ProductReport
+{
+    public int Productreportid { get; set; }
+
+    public int Product { get; set; }
+
+    public int Price { get; set; }
+
+    public int Pricetothecard { get; set; }
+
+    public int Actualbalance { get; set; }
+
+    public int Virtualbalance { get; set; }
+
+    public int Visit { get; set; }
+
+    public virtual Product ProductNavigation { get; set; } = null!;
+
+    public virtual Visit VisitNavigation { get; set; } = null!;
+}

+ 17 - 0
Models/Project.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Project
+{
+    public int Projectid { get; set; }
+
+    public string Title { get; set; } = null!;
+
+    public int Numofvisitsperweek { get; set; }
+
+    public virtual ICollection<Product> Products { get; set; } = new List<Product>();
+
+    public virtual ICollection<Visit> Visits { get; set; } = new List<Visit>();
+}

+ 15 - 0
Models/ProjectsAndEmployee.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class ProjectsAndEmployee
+{
+    public int Employeeid { get; set; }
+
+    public int Projectid { get; set; }
+
+    public virtual Employee Employee { get; set; } = null!;
+
+    public virtual Project Project { get; set; } = null!;
+}

+ 15 - 0
Models/ProjectsAndOutlet.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class ProjectsAndOutlet
+{
+    public int Projectid { get; set; }
+
+    public int Outletid { get; set; }
+
+    public virtual Outlet Outlet { get; set; } = null!;
+
+    public virtual Project Project { get; set; } = null!;
+}

+ 13 - 0
Models/Role.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Role
+{
+    public int Roleid { get; set; }
+
+    public string Title { get; set; } = null!;
+
+    public virtual ICollection<Employee> Employees { get; set; } = new List<Employee>();
+}

+ 274 - 0
Models/SuharevaContext.cs

@@ -0,0 +1,274 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.EntityFrameworkCore;
+
+namespace Acosta.Models;
+
+public partial class SuharevaContext : DbContext
+{
+    public SuharevaContext()
+    {
+    }
+
+    public SuharevaContext(DbContextOptions<SuharevaContext> options)
+        : base(options)
+    {
+    }
+
+    public virtual DbSet<Acceptance> Acceptances { get; set; }
+
+    public virtual DbSet<Employee> Employees { get; set; }
+
+    public virtual DbSet<Outlet> Outlets { get; set; }
+
+    public virtual DbSet<Product> Products { get; set; }
+
+    public virtual DbSet<ProductReport> ProductReports { get; set; }
+
+    public virtual DbSet<Project> Projects { get; set; }
+
+    public virtual DbSet<ProjectsAndEmployee> ProjectsAndEmployees { get; set; }
+
+    public virtual DbSet<ProjectsAndOutlet> ProjectsAndOutlets { get; set; }
+
+    public virtual DbSet<Role> Roles { get; set; }
+
+    public virtual DbSet<TradeNetwork> TradeNetworks { get; set; }
+
+    public virtual DbSet<Visit> Visits { 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 http://go.microsoft.com/fwlink/?LinkId=723263.
+        => optionsBuilder.UseNpgsql("Host=edu.pg.ngknn.ru;Port=5442;Database=Suhareva;Username=33P;Password=12345");
+
+    protected override void OnModelCreating(ModelBuilder modelBuilder)
+    {
+        modelBuilder.Entity<Acceptance>(entity =>
+        {
+            entity.HasKey(e => e.Acceptanceid).HasName("Acceptance_pkey");
+
+            entity.ToTable("Acceptance");
+
+            entity.Property(e => e.Acceptanceid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("acceptanceid");
+            entity.Property(e => e.Title)
+                .HasMaxLength(30)
+                .HasColumnName("title");
+        });
+
+        modelBuilder.Entity<Employee>(entity =>
+        {
+            entity.HasKey(e => e.Employeesid).HasName("Employees_pkey");
+
+            entity.Property(e => e.Employeesid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("employeesid");
+            entity.Property(e => e.Email)
+                .HasMaxLength(30)
+                .HasColumnName("email");
+            entity.Property(e => e.Name)
+                .HasMaxLength(30)
+                .HasColumnName("name");
+            entity.Property(e => e.Password)
+                .HasMaxLength(30)
+                .HasColumnName("password");
+            entity.Property(e => e.Patronymic)
+                .HasMaxLength(30)
+                .HasColumnName("patronymic");
+            entity.Property(e => e.Phonenumber)
+                .HasMaxLength(30)
+                .HasColumnName("phonenumber");
+            entity.Property(e => e.Role).HasColumnName("role");
+            entity.Property(e => e.Surname)
+                .HasMaxLength(30)
+                .HasColumnName("surname");
+
+            entity.HasOne(d => d.RoleNavigation).WithMany(p => p.Employees)
+                .HasForeignKey(d => d.Role)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Employees_role_fkey");
+        });
+
+        modelBuilder.Entity<Outlet>(entity =>
+        {
+            entity.HasKey(e => e.Outletid).HasName("Outlets_pkey");
+
+            entity.Property(e => e.Outletid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("outletid");
+            entity.Property(e => e.Address)
+                .HasMaxLength(100)
+                .HasColumnName("address");
+            entity.Property(e => e.Location)
+                .HasMaxLength(100)
+                .HasColumnName("location");
+            entity.Property(e => e.TradeNetworks).HasColumnName("Trade networks");
+
+            entity.HasOne(d => d.TradeNetworksNavigation).WithMany(p => p.Outlets)
+                .HasForeignKey(d => d.TradeNetworks)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Outlets_Trade networks_fkey");
+        });
+
+        modelBuilder.Entity<Product>(entity =>
+        {
+            entity.HasKey(e => e.Productid).HasName("Products_pkey");
+
+            entity.Property(e => e.Productid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("productid");
+            entity.Property(e => e.Project).HasColumnName("project");
+            entity.Property(e => e.Title)
+                .HasMaxLength(100)
+                .HasColumnName("title");
+
+            entity.HasOne(d => d.ProjectNavigation).WithMany(p => p.Products)
+                .HasForeignKey(d => d.Project)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Products_project_fkey");
+        });
+
+        modelBuilder.Entity<ProductReport>(entity =>
+        {
+            entity.HasKey(e => e.Productreportid).HasName("Product reports_pkey");
+
+            entity.ToTable("Product reports");
+
+            entity.Property(e => e.Productreportid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("productreportid");
+            entity.Property(e => e.Actualbalance).HasColumnName("actualbalance");
+            entity.Property(e => e.Price).HasColumnName("price");
+            entity.Property(e => e.Pricetothecard).HasColumnName("pricetothecard");
+            entity.Property(e => e.Product).HasColumnName("product");
+            entity.Property(e => e.Virtualbalance).HasColumnName("virtualbalance");
+            entity.Property(e => e.Visit).HasColumnName("visit");
+
+            entity.HasOne(d => d.ProductNavigation).WithMany(p => p.ProductReports)
+                .HasForeignKey(d => d.Product)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Product reports_product_fkey");
+
+            entity.HasOne(d => d.VisitNavigation).WithMany(p => p.ProductReports)
+                .HasForeignKey(d => d.Visit)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Product reports_visit_fkey");
+        });
+
+        modelBuilder.Entity<Project>(entity =>
+        {
+            entity.HasKey(e => e.Projectid).HasName("Projects_pkey");
+
+            entity.Property(e => e.Projectid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("projectid");
+            entity.Property(e => e.Numofvisitsperweek).HasColumnName("numofvisitsperweek");
+            entity.Property(e => e.Title)
+                .HasMaxLength(30)
+                .HasColumnName("title");
+        });
+
+        modelBuilder.Entity<ProjectsAndEmployee>(entity =>
+        {
+            entity
+                .HasNoKey()
+                .ToTable("Projects and employees");
+
+            entity.Property(e => e.Employeeid).HasColumnName("employeeid");
+            entity.Property(e => e.Projectid).HasColumnName("projectid");
+
+            entity.HasOne(d => d.Employee).WithMany()
+                .HasForeignKey(d => d.Employeeid)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Projects and employees_employeeid_fkey");
+
+            entity.HasOne(d => d.Project).WithMany()
+                .HasForeignKey(d => d.Projectid)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Projects and employees_projectid_fkey");
+        });
+
+        modelBuilder.Entity<ProjectsAndOutlet>(entity =>
+        {
+            entity
+                .HasNoKey()
+                .ToTable("Projects and outlets");
+
+            entity.Property(e => e.Outletid).HasColumnName("outletid");
+            entity.Property(e => e.Projectid).HasColumnName("projectid");
+
+            entity.HasOne(d => d.Outlet).WithMany()
+                .HasForeignKey(d => d.Outletid)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Projects and outlets_outletid_fkey");
+
+            entity.HasOne(d => d.Project).WithMany()
+                .HasForeignKey(d => d.Projectid)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Projects and outlets_projectid_fkey");
+        });
+
+        modelBuilder.Entity<Role>(entity =>
+        {
+            entity.HasKey(e => e.Roleid).HasName("Roles_pkey");
+
+            entity.Property(e => e.Roleid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("roleid");
+            entity.Property(e => e.Title)
+                .HasMaxLength(30)
+                .HasColumnName("title");
+        });
+
+        modelBuilder.Entity<TradeNetwork>(entity =>
+        {
+            entity.HasKey(e => e.Tradeid).HasName("Trade networks_pkey");
+
+            entity.ToTable("Trade networks");
+
+            entity.Property(e => e.Tradeid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("tradeid");
+            entity.Property(e => e.Title)
+                .HasMaxLength(30)
+                .HasColumnName("title");
+        });
+
+        modelBuilder.Entity<Visit>(entity =>
+        {
+            entity.HasKey(e => e.Visitid).HasName("Visits_pkey");
+
+            entity.Property(e => e.Visitid)
+                .UseIdentityAlwaysColumn()
+                .HasColumnName("visitid");
+            entity.Property(e => e.Accepted).HasColumnName("accepted");
+            entity.Property(e => e.Merchcomment)
+                .HasMaxLength(200)
+                .HasColumnName("merchcomment");
+            entity.Property(e => e.Outlet).HasColumnName("outlet");
+            entity.Property(e => e.Project).HasColumnName("project");
+            entity.Property(e => e.Visitdate).HasColumnName("visitdate");
+            entity.Property(e => e.Visittime).HasColumnName("visittime");
+
+            entity.HasOne(d => d.AcceptedNavigation).WithMany(p => p.Visits)
+                .HasForeignKey(d => d.Accepted)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Visits_accepted_fkey");
+
+            entity.HasOne(d => d.OutletNavigation).WithMany(p => p.Visits)
+                .HasForeignKey(d => d.Outlet)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Visits_outlet_fkey");
+
+            entity.HasOne(d => d.ProjectNavigation).WithMany(p => p.Visits)
+                .HasForeignKey(d => d.Project)
+                .OnDelete(DeleteBehavior.ClientSetNull)
+                .HasConstraintName("Visits_project_fkey");
+        });
+
+        OnModelCreatingPartial(modelBuilder);
+    }
+
+    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
+}

+ 13 - 0
Models/TradeNetwork.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class TradeNetwork
+{
+    public int Tradeid { get; set; }
+
+    public string Title { get; set; } = null!;
+
+    public virtual ICollection<Outlet> Outlets { get; set; } = new List<Outlet>();
+}

+ 29 - 0
Models/Visit.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+namespace Acosta.Models;
+
+public partial class Visit
+{
+    public int Visitid { get; set; }
+
+    public int Outlet { get; set; }
+
+    public int Project { get; set; }
+
+    public DateOnly Visitdate { get; set; }
+
+    public TimeOnly Visittime { get; set; }
+
+    public int Accepted { get; set; }
+
+    public string Merchcomment { get; set; } = null!;
+
+    public virtual Acceptance AcceptedNavigation { get; set; } = null!;
+
+    public virtual Outlet OutletNavigation { get; set; } = null!;
+
+    public virtual ICollection<ProductReport> ProductReports { get; set; } = new List<ProductReport>();
+
+    public virtual Project ProjectNavigation { get; set; } = null!;
+}

+ 22 - 0
ViewModels/AddEmployeesViewModel.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using Acosta.Models;
+using ReactiveUI;
+
+namespace Acosta.ViewModels
+{
+	public class AddEmployeesViewModel : ReactiveObject
+	{
+        SuharevaContext myConnection;
+        Employee currentUser;
+
+        public AddEmployeesViewModel(SuharevaContext myConnection)
+        {
+            this.myConnection = myConnection;
+            CurrentUser = new Employee();
+            myConnection.Add(CurrentUser);  
+        }
+
+        public Employee CurrentUser { get => currentUser; set => currentUser = value; }
+    }
+}

+ 22 - 0
ViewModels/AddTradeNetworksViewViewModel.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using ReactiveUI;
+using Acosta.Models;
+
+namespace Acosta.ViewModels
+{
+	public class AddTradeNetworksViewViewModel : ReactiveObject
+	{
+		SuharevaContext myConnection;
+		TradeNetwork currentTrade;
+
+		public AddTradeNetworksViewViewModel(SuharevaContext myConnection)
+		{
+            this.myConnection = myConnection;
+            CurrentTrade = new TradeNetwork();
+            myConnection.Add(CurrentTrade);
+        }
+
+        public TradeNetwork CurrentTrade { get => currentTrade; set => currentTrade = value; }
+    }
+}

+ 17 - 0
ViewModels/AuthorizationViewModel.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using ReactiveUI;
+
+namespace Acosta.ViewModels
+{
+	public class AuthorizationViewModel : ReactiveObject
+	{
+        string login = "";
+        string password = "";
+        string message = "";
+
+        public string Login { get => login; set => login = value; }
+        public string Password { get => password; set => password = value; }
+        public string Message { get => message; set => this.RaiseAndSetIfChanged(ref message, value); }
+    }
+}

+ 41 - 2
ViewModels/MainWindowViewModel.cs

@@ -1,17 +1,56 @@
 using Acosta.Views;
 using Avalonia.Controls;
 using ReactiveUI;
+using Acosta.Models;
+using System.Linq;
+using Acosta.ViewModels;
 
 namespace Acosta.ViewModels
 {
     public class MainWindowViewModel : ViewModelBase
     {
-        public UserControl UC { get => uc; set => this.RaiseAndSetIfChanged(ref uc, value); }
-        private UserControl uc = new AuthorizationView();
+        public static SuharevaContext myConnection = new SuharevaContext();
+
+        AuthorizationViewModel authorizationVM = new AuthorizationViewModel();
+        public AuthorizationViewModel AuthorizationVM { get => authorizationVM; set => authorizationVM = value; }
+
+        AddTradeNetworksViewViewModel addTradeNetworksVM = new AddTradeNetworksViewViewModel(myConnection);
+        public AddTradeNetworksViewViewModel AddTradeNetworksVM { get => addTradeNetworksVM; set => addTradeNetworksVM = value; }
+
+        AddEmployeesViewModel addEmployeesViewModel = new AddEmployeesViewModel(myConnection);
+        public AddEmployeesViewModel AddEmployeesViewModel { get => addEmployeesViewModel; set => addEmployeesViewModel = value; }
+
+        public void SaveNetwork()
+        {
+            myConnection.SaveChanges();
+            UC = new TradeNetworksView();
+        }
+
+        public void SaveUser()
+        {
+            myConnection.SaveChanges();
+            UC = new EmployeesView();
+        }
+
+        public UserControl UC { get => uc; set => this.RaiseAndSetIfChanged(ref uc, value); } 
+        private UserControl uc = new AddEmployeesView();
 
         public void LoadPersonalAccount()
         {
             UC = new AddEmployeesView();/*PersonalAccountView();*/
+            Employee? currentUser = myConnection.Employees.FirstOrDefault(x => x.Email == AuthorizationVM.Login && x.Password == AuthorizationVM.Password);
+            if (currentUser == null)
+            {
+                AuthorizationVM.Message = "Пользователя с такими данными не существует.";
+            }
+            else if (currentUser.Role != 1)
+            {
+                AuthorizationVM.Message = "Ваша роль не соответсвует требованиям.";
+            }
+            else
+            {
+                AuthorizationVM.Message = "Успех!";
+            }
         }
         public void ExitFromProfile()
         {

+ 3 - 3
Views/AddEmployeesView.axaml

@@ -1,10 +1,10 @@
 <UserControl xmlns="https://github.com/avaloniaui"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-             mc:Ignorable="d" d:DesignWidth="1550" d:DesignHeight="800.5"
 			 xmlns:vm="using:Acosta.ViewModels"
 			 x:DataType="vm:MainWindowViewModel"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d" d:DesignWidth="1920" d:DesignHeight="1080"
              x:Class="Acosta.Views.AddEmployeesView">
 	<Grid>
 		<StackPanel Width="1550" Height="50" Background="#E40714" VerticalAlignment="Top">
@@ -254,7 +254,7 @@
 			<Button Classes="BtDelete" Command="">
 				<TextBlock Classes="TextBtDelete">Удалить</TextBlock>
 			</Button>
-			<Button Classes="BtSave" Command="">
+			<Button Classes="BtSave" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).SaveUser}">
 				<TextBlock Classes="TextBtSave">Добавить</TextBlock>
 			</Button>
 		</StackPanel>

+ 2 - 2
Views/AddTradeNetworksView.axaml

@@ -132,7 +132,7 @@
 			</StackPanel>
 			<StackPanel Orientation="Horizontal">
 				<TextBlock Classes="TextToTextBox">Наименование:</TextBlock>
-				<TextBox Watermark="Наименование торговой сети" Width="360"></TextBox>
+				<TextBox Text="{Binding AddTradeNetworksVM.CurrentTrade.Title}" Watermark="Наименование торговой сети" Width="360"></TextBox>
 			</StackPanel>
 		</StackPanel>
 		<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
@@ -187,7 +187,7 @@
 			<Button Classes="BtDelete" Command="">
 				<TextBlock Classes="TextBtDelete">Удалить</TextBlock>
 			</Button>
-			<Button Classes="BtSave" Command="">
+			<Button Classes="BtSave" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).SaveNetwork}">
 				<TextBlock Classes="TextBtSave">Добавить</TextBlock>
 			</Button>
 		</StackPanel>

+ 3 - 2
Views/AuthorizationView.axaml

@@ -26,8 +26,9 @@
 			</StackPanel.Styles>
 			
 			<Image Source="avares://Acosta/Assets/AcostaLogo.png" Width="450" Margin="0 0 0 100"></Image>
-			<TextBox Watermark="Логин" Width="360" FontSize="13" Margin="0 0 0 10"></TextBox>
-			<TextBox Watermark="Пароль" PasswordChar="•" Width="360"></TextBox>
+			<TextBox Text="{Binding AuthorizationVM.Login}" Watermark="Логин" Width="360" FontSize="13" Margin="0 0 0 10"></TextBox>
+			<TextBox Text="{Binding AuthorizationVM.Password}" Watermark="Пароль" PasswordChar="•" Width="360"></TextBox>
+			<TextBlock Text="{Binding AuthorizationVM.Message}"/>
 			<TextBlock Margin="0 5 0 0" HorizontalAlignment="Center" FontFamily="Roboto" FontSize="13" Foreground="#A52C2C"></TextBlock>
 			<Button HorizontalAlignment="Center" Margin="0 20 0 10" Width="230" Height="45" CornerRadius="10" Background="#E40714" Command="{Binding LoadPersonalAccount}">
 				<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Roboto" FontSize="16" FontWeight="DemiBold" Foreground="White">Войти</TextBlock>