AngelikaSuhareva 4 місяців тому
батько
коміт
a837a632b9

+ 12 - 12
ViewModels/AddEmployeesViewModel.cs

@@ -10,36 +10,36 @@ namespace Acosta.ViewModels
 	{
         SuharevaContext myConnection;
         Employee currentUser;
-        string f;
+  /*      string f;
         string i;
         string o;
         string phone;
         string email;
         int role;
-        string password;
+        string password;*/
 
         public AddEmployeesViewModel(SuharevaContext myConnection)
         {
             this.myConnection = myConnection;
             CurrentUser = new Employee();
-            //CurrentUser.Surname = F;
-            //CurrentUser.Name = I;
-            //CurrentUser.Patronymic = O;
-            //CurrentUser.Phonenumber = Phone;
-            //CurrentUser.Email = Email;
-            //CurrentUser.Password = Password;
-            //CurrentUser.Role = Role;
-            myConnection.Add(CurrentUser);
+/*            CurrentUser.Surname = F;
+            CurrentUser.Name = I;
+            CurrentUser.Patronymic = O;
+            CurrentUser.Phonenumber = Phone;
+            CurrentUser.Email = Email;
+            CurrentUser.Password = Password;
+            CurrentUser.Role = Role;*/
+            myConnection.Add(currentUser);
         }
 
         public Employee CurrentUser { get => currentUser; set => currentUser = value; }
 
-        public string Phone { get => phone; set => phone = value; }
+        /*public string Phone { get => phone; set => phone = value; }
         public string Email { get => email; set => email = value; }
         public int Role { get => role; set => role = value; }
         public string Password { get => password; set => password = value; }
         public string F { get => f; set => f = value; }
         public string I { get => i; set => i = value; }
-        public string O { get => o; set => o = value; }
+        public string O { get => o; set => o = value; }*/
     }
 }

+ 23 - 0
ViewModels/AddOutletsViewModel.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using Acosta.Models;
+using ReactiveUI;
+
+namespace Acosta.ViewModels
+{
+    public class AddOutletsViewModel : ReactiveObject
+    {
+        SuharevaContext myConnection;
+        Outlet currentOutlet;
+
+        public AddOutletsViewModel(SuharevaContext myConnection)
+        {
+            this.myConnection = myConnection;
+            CurrentOutlet = new Outlet();
+            myConnection.Add(CurrentOutlet);
+
+        }
+
+        public Outlet CurrentOutlet { get => currentOutlet; set => currentOutlet = value; }
+    }
+}

+ 25 - 9
ViewModels/MainWindowViewModel.cs

@@ -3,7 +3,6 @@ using Avalonia.Controls;
 using ReactiveUI;
 using Acosta.Models;
 using System.Linq;
-using Acosta.ViewModels;
 using System.Collections.Generic;
 using Microsoft.EntityFrameworkCore;
 using System.Collections.Immutable;
@@ -20,8 +19,12 @@ namespace Acosta.ViewModels
         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; }
+        /*AddEmployeesViewModel addEmployeesViewModel = new AddEmployeesViewModel(myConnection);
+        public AddEmployeesViewModel AddEmployeesViewModel { get => addEmployeesViewModel; set => addEmployeesViewModel = value; }*/
+
+
+        AddOutletsViewModel outletVM = new AddOutletsViewModel(myConnection);
+        public AddOutletsViewModel OutletVM { get => outletVM; set => outletVM = value; }
 
         public void SaveNetwork()
         {
@@ -29,18 +32,24 @@ namespace Acosta.ViewModels
             UC = new TradeNetworksView();
         }
 
-        public void SaveUser()
+        /*public void SaveUser()
         {
             myConnection.SaveChanges();
             UC = new EmployeesView();
-        }
+        }*/
+
+        /*public void SaveData()
+        {
+            myConnection.SaveChanges();
+            UC = new PersonalAccountView();
+        }*/
 
         public UserControl UC { get => uc; set => this.RaiseAndSetIfChanged(ref uc, value); } 
-        private UserControl uc = new AddEmployeesView();
+        private UserControl uc = new TradeNetworksView();
 
         public void LoadPersonalAccount()
         {
-            UC = new PersonalAccountView();
+            
             Employee? currentUser = myConnection.Employees.FirstOrDefault(x => x.Email == AuthorizationVM.Login && x.Password == AuthorizationVM.Password);
             if (currentUser == null)
             {
@@ -53,12 +62,19 @@ namespace Acosta.ViewModels
             else
             {
                 AuthorizationVM.Message = "Успех!";
+                UC = new PersonalAccountView();
             }
         }
 
         public List<Project> ListProjects => myConnection.Projects.ToList();
-        public List<Role> rolesList => (from p in myConnection.Roles.ToList() where p.Title != "Оператор" select p).ToImmutableList().ToList();
-        public List<Employee> userList => (from p in myConnection.Employees.ToList() where p.Role != 1 select p).ToImmutableList().ToList();
+        public List<Employee> ListEmployees => myConnection.Employees.ToList();
+        public List<Outlet> ListOutlets => myConnection.Outlets.ToList();
+        public List<TradeNetwork> ListTrades => myConnection.TradeNetworks.ToList();
+
+        /*public List<Role> rolesList => (from p in myConnection.Roles.ToList() where p.Title != "Оператор" select p).ToImmutableList().ToList();
+        public List<Employee> userList => (from p in myConnection.Employees.ToList() where p.Role != 1 select p).ToImmutableList().ToList();*/
+
+
 
         public void ExitFromProfile()
         {

+ 8 - 8
Views/AddEmployeesView.axaml

@@ -154,37 +154,37 @@
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Фамилия:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Surname}" Watermark="Фамилия" Width="360" Margin="160 20 0 0"></TextBox>
+						<TextBox  Watermark="Фамилия" Width="360" Margin="160 20 0 0"></TextBox>
 					</StackPanel>
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Имя:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Name}" Watermark="Имя" Width="360" Margin="200 20 0 0"></TextBox>
+						<TextBox  Watermark="Имя" Width="360" Margin="200 20 0 0"></TextBox>
 					</StackPanel>
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Отчетсво:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Patronymic}" Watermark="Отчетсво" Width="360" Margin="156 20 0 0"></TextBox>
+						<TextBox  Watermark="Отчетсво" Width="360" Margin="156 20 0 0"></TextBox>
 					</StackPanel>
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Почта:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Email}" Watermark="Почта" Width="360" Margin="183 20 0 0"></TextBox>
+						<TextBox  Watermark="Почта" Width="360" Margin="183 20 0 0"></TextBox>
 					</StackPanel>
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Пароль:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Password}" Watermark="Пароль" Width="360" Margin="170 20 0 0"></TextBox>
+						<TextBox  Watermark="Пароль" Width="360" Margin="170 20 0 0"></TextBox>
 					</StackPanel>
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Телефон:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Phonenumber}" Watermark="Телефон" Width="360" Margin="165 20 0 0"></TextBox>
+						<TextBox  Watermark="Телефон" Width="360" Margin="165 20 0 0"></TextBox>
 					</StackPanel>
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Роль:</TextBlock>
-						<TextBox Text="{Binding AddEmployeesViewModel.CurrentUser.Role}" Watermark="Роль" Width="360" Margin="200 20 0 0"></TextBox>
+						<TextBox  Watermark="Роль" Width="360" Margin="200 20 0 0"></TextBox>
 					</StackPanel>
 					<!--<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Роль:</TextBlock>
@@ -264,7 +264,7 @@
 			<Button Classes="BtDelete" Command="">
 				<TextBlock Classes="TextBtDelete">Удалить</TextBlock>
 			</Button>
-			<Button Classes="BtSave" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).SaveUser}">
+			<Button Classes="BtSave" Command="">
 				<TextBlock Classes="TextBtSave">Добавить</TextBlock>
 			</Button>
 		</StackPanel>

+ 5 - 9
Views/AddOutletsView.axaml

@@ -148,22 +148,18 @@
 			<ScrollViewer Height="600">
 			<StackPanel Orientation="Vertical">
 				<StackPanel Orientation="Horizontal">
-					<TextBlock Classes="TextToTextBox">Торговая сеть:</TextBlock>					
-					<ComboBox Classes="TextToComboBox" SelectedIndex="0" Margin="120 20 0 0" Width="360" Height="40">
-						<ComboBoxItem IsEnabled="False">–––––––––––––</ComboBoxItem>
-						<!--пример-->
-						<ComboBoxItem>Магнит</ComboBoxItem>
-					</ComboBox>					
+					<TextBlock Classes="TextToTextBox">Торговая сеть:</TextBlock>
+					<TextBox Text="{Binding OutletVM.CurrentOutlet.TradeNetworks}" Watermark="Торговая сеть" Width="360" Margin="185 20 0 0"></TextBox>				
 				</StackPanel>				
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>				
 				<StackPanel Orientation="Horizontal">
 					<TextBlock Classes="TextToTextBox">Адрес:</TextBlock>
-					<TextBox Watermark="Адрес" Width="360" Margin="185 20 0 0"></TextBox>
+					<TextBox Text="{Binding OutletVM.CurrentOutlet.Address}" Watermark="Адрес" Width="360" Margin="185 20 0 0"></TextBox>
 				</StackPanel>
 				<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 				<StackPanel Orientation="Horizontal">
 					<TextBlock Classes="TextToTextBox">Местоположение:</TextBlock>
-					<TextBox Watermark="Местоположение" Width="360" Margin="90 20 0 0"></TextBox>
+					<TextBox Text="{Binding OutletVM.CurrentOutlet.Location}" Watermark="Местоположение" Width="360" Margin="90 20 0 0"></TextBox>
 				</StackPanel>
 				<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 				<StackPanel Orientation="Vertical">
@@ -233,7 +229,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>

+ 1 - 0
Views/AddTradeNetworksView.axaml

@@ -188,6 +188,7 @@
 				<TextBlock Classes="TextBtDelete">Удалить</TextBlock>
 			</Button>
 			<Button Classes="BtSave" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).SaveNetwork}">
+				
 				<TextBlock Classes="TextBtSave">Добавить</TextBlock>
 			</Button>
 		</StackPanel>

+ 25 - 45
Views/EmployeesView.axaml

@@ -239,55 +239,35 @@
 					</Border>
 				</StackPanel>-->
 				<!--РАЗДЕЛЬНОЕ ФИО-->
-				<StackPanel Orientation="Horizontal" Margin="40 0 0 0"><!--Margin="40 0 0 0"-->
-					<Button Classes="BtEdit" Width="90" Height="40" Margin="0 0 70 0" Command="{Binding EditEmployeesView}">
-						<TextBlock Classes="TextBtEdit">ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<!--<TextBox Classes="EditTextBox" Width="230" Margin="0 0 125 0">Типа сотрудник</TextBox>-->
-					<TextBox Classes="EditTextBox" Width="170" Margin="0 0 70 0">Типа фамилия</TextBox>
-					<TextBox Classes="EditTextBox" Width="130" Margin="0 0 55 0">Типа имя</TextBox>
-					<TextBox Classes="EditTextBox" Width="170" Margin="0 0 70 0">Типа отчество</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="130" Height="40" Margin="0 0 63 0">
-						<TextBlock Classes="Data">Типа  роль</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="150" Height="40" Margin="0 0 55 0">
-						<TextBlock Classes="Data">Типа  почта</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="170" Height="40">
-						<TextBlock Classes="Data">Типа  телефон</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<!--Margin="40 0 0 0"-->
-					<Button Classes="BtEdit" Width="90" Height="40" Margin="0 0 70 0" Command="{Binding EditEmployeesView}">
-						<TextBlock Classes="TextBtEdit">ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
+				<ListBox ItemsSource="{Binding ListEmployees}">
+					<ListBox.ItemTemplate>
+						<DataTemplate>
+							<StackPanel Orientation="Horizontal" Margin="40 0 0 0">
+								<!--Margin="40 0 0 0"-->
+								<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
 						<TextBlock Classes="Data">Типа ID</TextBlock>
 					</Border>-->
-					<!--<TextBox Classes="EditTextBox" Width="230" Margin="0 0 125 0">Типа сотрудник</TextBox>-->
-					<TextBox Classes="EditTextBox" Width="170" Margin="0 0 70 0">Типа фамилия</TextBox>
-					<TextBox Classes="EditTextBox" Width="130" Margin="0 0 55 0">Типа имя</TextBox>
-					<TextBox Classes="EditTextBox" Width="170" Margin="0 0 70 0">Типа отчество</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
+								<!--<TextBox Classes="EditTextBox" Width="230" Margin="0 0 125 0">Типа сотрудник</TextBox>-->
+								<TextBox Text="{Binding Employeesid}" Classes="EditTextBox" Width="70" Margin="0 0 70 0">Типа id</TextBox>
+								<TextBox Text="{Binding Surname}" Classes="EditTextBox" Width="170" Margin="0 0 70 0">Типа фамилия</TextBox>
+								<TextBox Text="{Binding Name}" Classes="EditTextBox" Width="130" Margin="0 0 55 0">Типа имя</TextBox>
+								<TextBox Text="{Binding Patronymic}" Classes="EditTextBox" Width="170" Margin="0 0 70 0">Типа отчество</TextBox>
+								<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
 						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
 					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="130" Height="40" Margin="0 0 63 0">
-						<TextBlock Classes="Data">Типа  роль</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="150" Height="40" Margin="0 0 55 0">
-						<TextBlock Classes="Data">Типа  почта</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="170" Height="40">
-						<TextBlock Classes="Data">Типа  телефон</TextBlock>
-					</Border>
-				</StackPanel>
+								<Border  Classes="Data" CornerRadius="13"  Width="130" Height="40" Margin="0 0 63 0">
+									<TextBlock Text="{Binding Role}" Classes="Data">Типа  роль</TextBlock>
+								</Border>
+								<Border  Classes="Data" CornerRadius="13"  Width="150" Height="40" Margin="0 0 55 0">
+									<TextBlock Text="{Binding Email}" Classes="Data">Типа  почта</TextBlock>
+								</Border>
+								<Border  Classes="Data" CornerRadius="13"  Width="170" Height="40">
+									<TextBlock Text="{Binding Phonenumber}" Classes="Data">Типа  телефон</TextBlock>
+								</Border>
+							</StackPanel>
+						</DataTemplate>
+					</ListBox.ItemTemplate>
+				</ListBox>
 			</StackPanel>			
 			</ScrollViewer>
 		</StackPanel>

+ 22 - 178
Views/OutletsView.axaml

@@ -184,189 +184,33 @@
 						<TextBlock Classes="TextColumns">МЕСТОПОЛОЖЕНИЕ</TextBlock>
 					</StackPanel>				
 			</Border>
-			<ScrollViewer Height="500">
+			<ScrollViewer Height="500">	
 			<StackPanel Orientation="Vertical">
-				<StackPanel Orientation="Horizontal" Margin="40 0 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
+				<ListBox ItemsSource="{Binding ListOutlets}">
+					<ListBox.ItemTemplate>
+						<DataTemplate>
+							<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
+								<!--<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
+									<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
+								</Button>-->
+								<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
 						<TextBlock Classes="Data">Типа ID</TextBlock>
 					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
+								<TextBox Text="{Binding Outletid}" Classes="EditTextBox" Width="70" Margin="0 0 140 0">Типа id</TextBox>
+								<TextBox Text="{Binding TradeNetworks}" Classes="EditTextBox" Width="70" Margin="0 0 140 0">Типа название торговой сети</TextBox>
+								<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
 						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
 					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<!--Пример скролла-->
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
-				<StackPanel Orientation="Horizontal" Margin="40 20 0 0">
-					<Button Classes="BtEdit" Width="180" Height="40" Margin="0 0 140 0" Command="{Binding EditOutletsView}">
-						<TextBlock Classes="TextBtEdit">Типа ID</TextBlock>
-					</Button>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="180" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа ID</TextBlock>
-					</Border>-->
-					<TextBox Classes="EditTextBox" Width="310" Margin="0 0 140 0">Типа название торговой сети</TextBox>
-					<!--<Border  Classes="Data" CornerRadius="13"  Width="310" Height="40" Margin="0 0 140 0">
-						<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-					</Border>-->
-					<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
-						<TextBlock Classes="Data">Типа  адрес</TextBlock>
-					</Border>
-					<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
-						<TextBlock Classes="Data">Типа  местоположение</TextBlock>
-					</Border>
-				</StackPanel>
+								<Border  Classes="Data" CornerRadius="13"  Width="220" Height="40" Margin="0 0 145 0">
+									<TextBlock Text="{Binding Address}" Classes="Data">Типа  адрес</TextBlock>
+								</Border>
+								<Border  Classes="Data" CornerRadius="13"  Width="280" Height="40">
+									<TextBlock Text="{Binding Location}" Classes="Data">Типа  местоположение</TextBlock>
+								</Border>
+							</StackPanel>
+						</DataTemplate>
+					</ListBox.ItemTemplate>
+				</ListBox>
 			</StackPanel>
 			</ScrollViewer>
 		</StackPanel>

+ 11 - 12
Views/TradeNetworksView.axaml

@@ -148,18 +148,17 @@
 				<TextBlock Classes="TextColumns">НАИМЕНОВАНИЕ</TextBlock>				
 			</Border>
 			<ScrollViewer Height="550">
-			<StackPanel Orientation="Vertical">
-				<Border  Classes="Data" CornerRadius="13"  Width="1400" Height="40">
-					<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-				</Border>
-				<!--Пример как это должно будет выглядеть в зависимости от количества записей в бд-->
-				<Border  Classes="Data" CornerRadius="13"  Width="1400" Height="40">
-					<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-				</Border>
-				<Border  Classes="Data" CornerRadius="13"  Width="1400" Height="40">
-					<TextBlock Classes="Data">Типа название торговой сети</TextBlock>
-				</Border>				
-			</StackPanel>
+				<ListBox ItemsSource="{Binding ListTrades}">
+					<ListBox.ItemTemplate>
+						<DataTemplate>
+							<StackPanel Orientation="Vertical">
+								<Border  Classes="Data" CornerRadius="13"  Width="1400" Height="40">
+									<TextBlock Text="{Binding Title}" Classes="Data">Типа название торговой сети</TextBlock>
+								</Border>
+							</StackPanel>
+						</DataTemplate>
+					</ListBox.ItemTemplate>
+				</ListBox>
 			</ScrollViewer>
 		</StackPanel>
 	</Grid>