Browse Source

add checkbox with projects on outlets

AngelikaSuhareva 4 months ago
parent
commit
194ad2cb5b
2 changed files with 12 additions and 14 deletions
  1. 1 5
      ViewModels/AddEmployeesViewModel.cs
  2. 11 9
      Views/AddOutletsView.axaml

+ 1 - 5
ViewModels/AddEmployeesViewModel.cs

@@ -20,11 +20,7 @@ namespace Acosta.ViewModels
             myC.Add(CurrentUser);
         }
 
-        public AddEmployeesViewModel(SuharevaContext myC, int idUser)
-        {
-            this.myC = myC;
-            CurrentUser = myC.Employees.FirstOrDefault(x => x.Employeesid == idUser);
-        }
+        public List<Role> Roles => myC.Roles.ToList();
 
         public Employee? CurrentUser { get => currentUser; set => currentUser = value; }
     }

+ 11 - 9
Views/AddOutletsView.axaml

@@ -162,15 +162,17 @@
 				<Border Background="#969696" CornerRadius="13"  Width="1150" Height="0.5" Margin="200 30 0 10" HorizontalAlignment="Left"></Border>
 				<StackPanel Orientation="Vertical">
 					<TextBlock Classes="TextToTextBox">Проекты:</TextBlock>
-					<CheckBox Classes="TextToCheckBox" Margin="202 10 0 0">
-						<TextBlock>Проект “...”</TextBlock>
-					</CheckBox>
-					<CheckBox Classes="TextToCheckBox" Margin="202 10 0 0">
-						<TextBlock>Проект “...”</TextBlock>
-					</CheckBox>
-					<CheckBox Classes="TextToCheckBox" Margin="202 10 0 0">
-						<TextBlock>Проект “...”</TextBlock>
-					</CheckBox>		
+					<ListBox ItemsSource="{Binding ListProjects}">
+						<ListBox.ItemTemplate>
+							<DataTemplate>
+								<StackPanel Orientation="Vertical">
+									<CheckBox Classes="TextToCheckBox" Margin="202 10 0 0">
+										<TextBlock Text="{Binding Title}"></TextBlock>
+									</CheckBox>
+								</StackPanel>
+							</DataTemplate>
+						</ListBox.ItemTemplate>
+					</ListBox>	
 				</StackPanel>
 			</StackPanel>
 			</ScrollViewer>