public AjoutReservation(Ressources r, DataGrid datagridReservation) { InitializeComponent(); res = r; datagridreservation = datagridReservation; foreach (Particulier p in r.ListeClients) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idProp" + p.Id; monItem.Content = p.Id + " " + p.Nom + " " + p.Prenom; IDLoc.Items.Add(monItem); } foreach (Logement l in r.ListeLogements) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idlogement" + l.Id; int taille = l.GetType().ToString().Count(); monItem.Content = l.Id + " " + l.GetType().ToString().Substring(11, taille - 11) + " " + l.Adresse.Ville; IDLog.Items.Add(monItem); } for (int i = 0; i < dureeMax; i++ ) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "dure" + i; monItem.Content = i + 1; Duree.Items.Add(monItem); } InitializeComponent(); }
public ModifierClient(Particulier p, Ressources r, DataGrid d) { client = p; res = r; data = d; InitializeComponent(); if(p is Professionnel) pro = true; else pro = false; nom.Text = p.Nom; prenom.Text = p.Prenom; email.Text = p.EMail; telephone.Text = p.NumeroDeTelephone; if (pro) { Professionnel prof = client as Professionnel; siret.IsEnabled = true; siret.Text = prof.Siret; denomination.IsEnabled = true; denomination.Text = prof.Denomnation; } numvoie.Text = client.Adresse.Numero; voie.Text = client.Adresse.Voie; cp.Text = client.Adresse.CodePostal; ville.Text = client.Adresse.Ville; dep.Text = client.Adresse.Departement; }
public FicheReservation(Reservation re, Ressources r, DataGrid d) { rez = re; res = r; data = d; InitializeComponent(); foreach (Particulier p in r.ListeClients) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idProp" + p.Id; monItem.Content = p.Id + " " + p.Nom + " " + p.Prenom; IDLoc.Items.Add(monItem); } foreach (Logement l in r.ListeLogements) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idlogement" + l.Id; int taille = l.GetType().ToString().Count(); monItem.Content = l.Id + " " + l.GetType().ToString().Substring(11, taille - 11) + " " + l.Adresse.Ville; IDLog.Items.Add(monItem); } IDLoc.SelectedIndex = rez.IDClient - 1; IDLog.SelectedIndex = rez.IDLogement - 1; calendar1.BlackoutDates.Add(new CalendarDateRange(rez.DateDebut, rez.DateDebut.AddDays(7 * rez.Duree - 1))); calendar1.DisplayDate = rez.DateDebut; calendar1.SelectionMode = CalendarSelectionMode.None; }
public AjoutLogement(Ressources r, DataGrid dataLogement) { InitializeComponent(); res = r; datagridlogement = dataLogement; foreach (Particulier p in r.ListeClients) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idProp" + p.Id; monItem.Content = p.Id + " " + p.Nom + " " + p.Prenom; comboBoxIDProp.Items.Add(monItem); } }
public MainWindow() { InitializeComponent(); //ressources = new Ressources(); ressources = Ressources.Instance; cvClient = CollectionViewSource.GetDefaultView(ressources.ListeClients); cvLogement = CollectionViewSource.GetDefaultView(ressources.ListeLogements); cvResa = CollectionViewSource.GetDefaultView(ressources.ListeReservations); Client_Grid.ItemsSource = cvClient; Logement_Grid.ItemsSource = cvLogement; Resa_Grid.ItemsSource = cvResa; //DataContext = new DataModelView(ressources); DataContext = this; }
public ModifierReservation(Reservation re, Ressources r, DataGrid d) { rez = re; res = r; data = d; InitializeComponent(); foreach (Particulier p in r.ListeClients) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idProp" + p.Id; monItem.Content = p.Id + " " + p.Nom + " " + p.Prenom; IDLoc.Items.Add(monItem); } foreach (Logement l in r.ListeLogements) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idlogement" + l.Id; int taille = l.GetType().ToString().Count(); monItem.Content = l.Id + " " + l.GetType().ToString().Substring(11, taille - 11) + " " + l.Adresse.Ville; IDLog.Items.Add(monItem); } for (int i = 0; i < dureeMax; i++) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "dure" + i; monItem.Content = i + 1; Duree.Items.Add(monItem); } IDLoc.SelectedIndex = rez.IDClient - 1; IDLog.SelectedIndex = rez.IDLogement - 1; datedebut.SelectedDate = rez.DateDebut; Duree.SelectedIndex = rez.Duree - 1; datefin.SelectedDate = datedebut.SelectedDate.Value.AddDays(7 * int.Parse(Duree.Text)); }
public FicheLogement(Logement Log, Ressources r, DataGrid dataLogement) { InitializeComponent(); log = Log; res = r; datagridlogement = dataLogement; foreach (Particulier p in r.ListeClients) { ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idProp" + p.Id; monItem.Content = p.Id + " " + p.Nom + " " + p.Prenom; comboBoxIDProp.Items.Add(monItem); } comboBoxIDProp.SelectedIndex = log.IdClient - 1; numero.Text = log.Adresse.Numero; Voie.Text = log.Adresse.Voie; CP.Text = log.Adresse.CodePostal; Ville.Text = log.Adresse.Ville; NombreDePiece.Text = log.NbPiece.ToString(); NombreDeChambre.SelectedIndex = log.NbChambres; Superficie.Text = log.Superficie.ToString(); Distance.Text = log.DistancePlage.ToString(); CuisineEquipe.IsChecked = log.CuisineEquipe; LaveLinge.IsChecked = log.LaveLinge; Terasse.IsChecked = log.Terasse; if (log is Maison) { numero.IsEnabled = false; Voie.IsEnabled = false; CP.IsEnabled = false; Ville.IsEnabled = false; Distance.IsEnabled = false; ldistance.IsEnabled = false; comboBoxTypeLogement.SelectedIndex = 0; Maison temp = log as Maison; Garage.IsChecked = temp.Garage; Jardin.IsChecked = temp.Jardin; Piscine.IsChecked = temp.Piscine; } if (log is Appartement) { numero.IsEnabled = false; Voie.IsEnabled = false; CP.IsEnabled = false; Ville.IsEnabled = false; Distance.IsEnabled = false; ldistance.IsEnabled = false; comboBoxTypeLogement.SelectedIndex = 1; Appartement temp = log as Appartement; Ascensseur.IsChecked = temp.Ascenceur; numeroAppartement.Text = temp.NumeroAppartement; etage.Text = temp.Etage.ToString(); } if (log is MobilHome) { comboBoxTypeLogement.SelectedIndex = 2; MobilHome temp = log as MobilHome; if ((temp.Adresse as Camping) != null) { Nom.Text = (temp.Adresse as Camping).Nom; Emplacement.Text = (temp.Adresse as Camping).Emplacement; } } if (log is Caravane) { comboBoxTypeLogement.SelectedIndex = 3; Caravane temp = log as Caravane; Nom.Text = (temp.Adresse as Camping).Nom; Emplacement.Text = (temp.Adresse as Camping).Emplacement; } if (log is Peniche) { comboBoxTypeLogement.SelectedIndex = 4; Peniche temp = log as Peniche; Nom.Text = (temp.Adresse as Port).Nom; Quai.Text = (temp.Adresse as Port).Quai.ToString(); Emplacement.Text = (temp.Adresse as Port).Emplacement.ToString(); } foreach (Reservation rez in res.ListeReservations.Where(re => re.IDLogement == log.Id)) { calendar1.BlackoutDates.Add(new CalendarDateRange(rez.DateDebut, rez.DateDebut.AddDays(7 * rez.Duree - 1))); } }
public void MAJPropLoc(Ressources r) { if (r.ListeReservations.Count(re => re.IDClient == _id) > 0) _locataire = true; else _locataire = false; if (r.ListeLogements.Count(re => re.IdClient == _id) > 0) _proprietaire = true; else _proprietaire = false; }
public RechercheLogementControl(StackPanel p, Ressources r) { parent = p; ressources = r; // Création de l'input pour les valeur "string" tb = new TextBox(); tb.Width = 120; tb.Margin = new Thickness(3); tb.Name = "Valeur"; // Création de l'input pour le choix enntre un oui ou un non cb_bool = new ComboBox(); cb_bool.Width = 120; cb_bool.Margin = new Thickness(3); cb_bool.Name = "Statut"; ComboBoxItem oui = new ComboBoxItem(); oui.Content = "Oui"; ComboBoxItem non = new ComboBoxItem(); non.Content = "Non"; // Création de l'input pour le choix du type dem aison cb_type = new ComboBox(); cb_type.Items.Add(oui); cb_type.Items.Add(non); cb_type = new ComboBox(); cb_type.Width = 120; cb_type.Margin = new Thickness(3); cb_type.Name = "Type"; ComboBoxItem maison = new ComboBoxItem(); maison.Content = "Maison"; ComboBoxItem appart = new ComboBoxItem(); appart.Content = "Appartement"; ComboBoxItem peniche = new ComboBoxItem(); peniche.Content = "Peniche"; ComboBoxItem mobil = new ComboBoxItem(); mobil.Content = "Mobile-home"; ComboBoxItem caravane = new ComboBoxItem(); caravane.Content = "Caravane"; cb_type.Items.Add(maison); cb_type.Items.Add(appart); cb_type.Items.Add(peniche); cb_type.Items.Add(mobil); cb_type.Items.Add(caravane); // Création de l'input pour la disponibilité sp_date = new StackPanel(); sp_date.Orientation = Orientation.Horizontal; dp = new DatePicker(); dp.SelectedDateChanged += dp_SelectedDateChanged; duree = new TextBox(); duree.Width = 20; Label pdt = new Label(); pdt.Content = "pendant"; Label sem = new Label(); sem.Content = "semaine(s)"; sp_date.Children.Add(dp); sp_date.Children.Add(pdt); sp_date.Children.Add(duree); sp_date.Children.Add(sem); // Création de l'input pour la superficie tb_superficie = new TextBox(); tb_superficie.Width = 120; sp_superficie = new StackPanel(); sp_superficie.Orientation = Orientation.Horizontal; cb_comparaison = new ComboBox(); cb_comparaison.Width = Double.NaN; ComboBoxItem egale = new ComboBoxItem(); egale.Content = "Egale"; ComboBoxItem sup = new ComboBoxItem(); sup.Content = "Supérieure"; ComboBoxItem inf = new ComboBoxItem(); inf.Content = "Inférieure"; cb_comparaison.Items.Add(egale); cb_comparaison.Items.Add(sup); cb_comparaison.Items.Add(inf); cb_comparaison.SelectedIndex = 0; Label a = new Label(); a.Content = "à : "; sp_superficie.Children.Add(cb_comparaison); sp_superficie.Children.Add(a); sp_superficie.Children.Add(tb_superficie); InitializeComponent(); }
public static RechercheLogementControl filtreIDclient(int id, StackPanel p, Ressources r) { RechercheLogementControl t = new RechercheLogementControl(p, r); t.attr.SelectedIndex = 1; t.tb.Text = id.ToString(); t.Value.Text = id.ToString(); return t; }
public AjoutClient(Ressources r, DataGrid dgc) { res = r; datagridclient = dgc; InitializeComponent(); }
public FicheClient(Particulier p, Ressources res, DataGrid dr, DataGrid dl, DataGrid dc) { client = p; dataclient = dc; datalog = dl; datarez = dr; r = res; InitializeComponent(); if (p is Professionnel) pro = true; else pro = false; nom.Text = p.Nom; prenom.Text = p.Prenom; email.Text = p.EMail; telephone.Text = p.NumeroDeTelephone; if (pro) { Professionnel prof = client as Professionnel; siret.IsEnabled = true; siret.Text = prof.Siret; denomination.IsEnabled = true; denomination.Text = prof.Denomnation; } numvoie.Text = client.Adresse.Numero; voie.Text = client.Adresse.Voie; cp.Text = client.Adresse.CodePostal; ville.Text = client.Adresse.Ville; dep.Text = client.Adresse.Departement; ComboBoxItem cbi = new ComboBoxItem(); cbi.Content = "Aucune réservation"; IDRez.Items.Add(cbi); IDRez.SelectedIndex = 0; rezDispo = false; if (r.ListeReservations.Count(re => re.IDClient == p.Id) > 0) { rezDispo = true; IDRez.Items.Clear(); foreach (Reservation rez in r.ListeReservations.Where(re => re.IDClient == p.Id)) { tabrez.Add(new Reservation(rez)); string villelog = ""; foreach (Logement l in r.ListeLogements) { if (l.Id == rez.IDLogement) { villelog = l.Adresse.Ville; break; } } ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idrez" + rez.Id; monItem.Content = rez.Id + " " + villelog; IDRez.Items.Add(monItem); } IDRez.SelectedIndex = 0; } ComboBoxItem cbi2 = new ComboBoxItem(); cbi2.Content = "Aucun logement"; IDLog.Items.Add(cbi2); IDLog.SelectedIndex = 0; logementdispo = false; if (r.ListeLogements.Count(re => re.IdClient == p.Id) > 0) { logementdispo = true; IDLog.Items.Clear(); foreach (Logement log in r.ListeLogements.Where(lo => lo.IdClient == p.Id)) { tablog.Add(log); ComboBoxItem monItem = new ComboBoxItem(); monItem.Name = "idrez" + log.Id; monItem.Content = log.Id + " " + log.Adresse.Ville; IDLog.Items.Add(monItem); } IDLog.SelectedIndex = 0; } }
public Page1() { InitializeComponent(); Ressources r = new Ressources(textBox1); }