Selaa lähdekoodia

correct lists for edit employees and outlets

AngelikaSuhareva 4 kuukautta sitten
vanhempi
commit
4af5e21fd0

+ 1 - 0
ViewModels/EditEmployeeViewModel.cs

@@ -20,6 +20,7 @@ namespace Acosta.ViewModels
             currentUser = myC.Employees.Include(x => x.RoleNavigation).FirstOrDefault(x => x.Employeesid == userId);
         }
 
+        public List<Role> Roles => myC.Roles.ToList();
         public Employee? CurrentUser { get => currentUser; set => currentUser = value; }
     }
 }

+ 2 - 0
ViewModels/EditOutletViewModel.cs

@@ -20,6 +20,8 @@ namespace Acosta.ViewModels
             CurrentOutlet = myC.Outlets.Include(x => x.TradeNetworksNavigation).FirstOrDefault(x => x.Outletid == outletId);
         }
 
+        public List<TradeNetwork> Trades => myC.TradeNetworks.ToList();
+
         public Outlet? CurrentOutlet { get => currentOutlet; set => currentOutlet = value; }
     }
 }

+ 1 - 1
Views/EditEmployeesView.axaml

@@ -184,7 +184,7 @@
 					</StackPanel>-->
 					<StackPanel Orientation="Horizontal">
 						<TextBlock Classes="TextToTextBox">Роль:</TextBlock>
-						<ComboBox Width="360" Margin="200 27 0 0" ItemsSource="{Binding AddEmployeesVM.Roles}" SelectedItem="{Binding AddEmployeesVM.CurrentUser.RoleNavigation}">
+						<ComboBox Width="360" Margin="200 27 0 0" ItemsSource="{Binding EditUserVM.Roles}" SelectedItem="{Binding EditUserVM.CurrentUser.RoleNavigation}">
 							<ComboBox.ItemTemplate>
 								<DataTemplate>
 									<TextBlock Text="{Binding Title}"/>

+ 1 - 1
Views/EditOutletsView.axaml

@@ -164,7 +164,7 @@
 			<StackPanel Orientation="Vertical">				
 				<StackPanel Orientation="Horizontal">
 					<TextBlock Classes="TextToTextBox">Торговая сеть:</TextBlock>
-					<ComboBox Width="360" Margin="120 25 0 0" ItemsSource="{Binding OutletVM.Trades}" SelectedItem="{Binding OutletVM.CurrentOutlet.TradeNetworksNavigation}">
+					<ComboBox Width="360" Margin="120 25 0 0" ItemsSource="{Binding EditOutletVM.Trades}" SelectedItem="{Binding EditOutletVM.CurrentOutlet.TradeNetworksNavigation}">
 						<ComboBox.ItemTemplate>
 							<DataTemplate>
 								<TextBlock Text="{Binding Title}"/>