public ChercherStaff() { InitializeComponent(); Client = new IfundamentalsClient(); listL = new List <StaffL>(); List <Staff> listS = Client.GetStaffs().ToList <Staff>(); foreach (Staff k in listS) { StaffL v32 = new StaffL(); v32.Staff = k; v32.boole = false; listL.Add(v32); } List1.ItemsSource = listL; foreach (Staff s in listS) { if (s.Picture != null) { FileStream fs = new FileStream(@"C:\Users\USER\Pictures\W3.CSS_files\" + s.Staff_ID + ".jpg", FileMode.Create); fs.Write(s.Picture, 0, s.Picture.Length); fs.Close(); } } }
private void Bloquer_Click(object sender, RoutedEventArgs e) { Client.Block(Int32.Parse(IdINfo.Text)); StaffL s = (StaffL)List1.SelectedItem; s.Staff.Active = 0; Debloquer.Visibility = Visibility.Visible; Bloquer.Visibility = Visibility.Collapsed; }
//Event:the List Selection Changed //outcome:Dispay the about the Selectionned Row for a better looking private void list1Changed(object sender, SelectionChangedEventArgs e) { if (List1.SelectedIndex != -1) { StaffL s = (StaffL)List1.SelectedItem; image_List1.ImageSource = new BitmapImage(new Uri(@"C:\Users\USER\Pictures\W3.CSS_files\" + s.Staff.Staff_ID + ".jpg", UriKind.Relative)); IdINfo.Text = "" + s.Staff.Staff_ID; Prenom.Text = s.Staff.FirstName; Nom.Text = s.Staff.LastName; List1.SelectedIndex = -1; } }
public AjouterStore() { /// List<int> cc = new List<int>(); /// cc.int /// IfundamentalClient Still the Same Use allow me to interact with my services Client = new IfundamentalsClient(); InitializeComponent(); //2 List ListL is use to fill my table and ListS is use to fill List[i].Staff that's what i'm doing inside the foreach listL = new List <StaffL>(); List <Staff> listS = Client.GetStaffs().ToList <Staff>(); foreach (Staff k in listS) { StaffL v32 = new StaffL(); v32.Staff = k; v32.boole = false; listL.Add(v32); } List1.ItemsSource = listL; //voir serveur pour definition des services //AllAddress me permet de remplir mon Combobox d'addresse ICollection <Address> AllAddress = Client.GetAddresses(); AdresseComboBox.ItemsSource = AllAddress; AdresseComboBox.DisplayMemberPath = "Address_Lib"; //Create the Staff Profile Photo Inside A folder foreach (Staff s in listS) { if (s.Picture != null) { FileStream fs = new FileStream(@"C:\Users\USER\Pictures\W3.CSS_files\" + s.Staff_ID + ".jpg", FileMode.Create); fs.Write(s.Picture, 0, s.Picture.Length); fs.Close(); } } }
private void list1Changed(object sender, SelectionChangedEventArgs e) { if (List1.SelectedIndex != -1) { StaffL s = (StaffL)List1.SelectedItem; image_List1.ImageSource = new BitmapImage(new Uri(@"C:\Users\USER\Pictures\W3.CSS_files\" + s.Staff.Staff_ID + ".jpg", UriKind.Relative)); if (s.Staff.Active == 1) { Debloquer.Visibility = Visibility.Collapsed; Bloquer.Visibility = Visibility.Visible; } else { Debloquer.Visibility = Visibility.Visible; Bloquer.Visibility = Visibility.Collapsed; } IdINfo.Text = "" + s.Staff.Staff_ID; Prenom.Text = s.Staff.FirstName; Nom.Text = s.Staff.LastName; //List1.SelectedIndex = -1 ; } }