Bläddra i källkod

add list with trade networks on AddOutletView and add list with roles ond AddEmployeesView

AngelikaSuhareva 2 månader sedan
förälder
incheckning
5d530d1bde
3 ändrade filer med 15 tillägg och 5 borttagningar
  1. 2 0
      ViewModels/AddOutletsViewModel.cs
  2. 4 4
      Views/AddEmployeesView.axaml
  3. 9 1
      Views/AddOutletsView.axaml

+ 2 - 0
ViewModels/AddOutletsViewModel.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using Acosta.Models;
 using ReactiveUI;
 
@@ -17,6 +18,7 @@ namespace Acosta.ViewModels
             myC.Add(CurrentOutlet);
         }
 
+        public List<TradeNetwork> Trades => myC.TradeNetworks.ToList();
         public Outlet? CurrentOutlet { get => currentOutlet; set => currentOutlet = value; }
     }
 }

+ 4 - 4
Views/AddEmployeesView.axaml

@@ -180,16 +180,16 @@
 						<TextBox Text="{Binding AddEmployeesVM.CurrentUser.Phonenumber}" 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">
+					<!--<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Роль:</TextBlock>
 						<TextBox Text="{Binding AddEmployeesVM.CurrentUser.Role}" Watermark="Роль" Width="360" Margin="200 20 0 0"></TextBox>
-					</StackPanel>
+					</StackPanel>-->
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Роль:</TextBlock>
-						<ComboBox ItemsSource="{Binding AddEmployeesVM.Roles}">
+						<ComboBox ItemsSource="{Binding AddEmployeesVM.Roles}" SelectedItem="{Binding AddEmployeesVM.CurrentUser.RoleNavigation}">
 							<ComboBox.ItemTemplate>
 								<DataTemplate>
-									<TextBlock Text="{Binding Roleid}" />
+									<TextBlock Text="{Binding Title}"/>
 								</DataTemplate>
 							</ComboBox.ItemTemplate>
 						</ComboBox>

+ 9 - 1
Views/AddOutletsView.axaml

@@ -156,7 +156,15 @@
 			<StackPanel Orientation="Vertical">
 				<StackPanel Orientation="Horizontal">
 					<TextBlock Classes="TextToTextBox">Торговая сеть:</TextBlock>
-					<TextBox Text="{Binding OutletVM.CurrentOutlet.TradeNetworks}" Watermark="Торговая сеть" Width="360" Margin="120 20 0 0"></TextBox>				
+					<ComboBox ItemsSource="{Binding OutletVM.Trades}" SelectedItem="{Binding OutletVM.CurrentOutlet.TradeNetworksNavigation}">
+						<ComboBox.ItemTemplate>
+							<DataTemplate>
+								<TextBlock Text="{Binding Title}"/>
+							</DataTemplate>
+						</ComboBox.ItemTemplate>
+					</ComboBox>
+				
+									
 				</StackPanel>				
 					<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>				
 				<StackPanel Orientation="Horizontal">