public void Print()
 {
     if (CurrentAgent.Id != 0 && CurrentAgent != null)
     {
         ReportedAgent reportedAgent = new ReportedAgent(CurrentAgent.PrenomNom, CurrentAgent.Adresse, CurrentAgent.Telephone, CurrentAgent.ComissionTotale);
         reportedAgent.ReportedVentes = new List <VenteReport>();
         //ListeVentes lv;
         List <VenteReport> liste = new List <VenteReport>();
         foreach (Vente v in CurrentAgent.Ventes)
         {
             ReportedVente reportedVente = new ReportedVente(v.DateVenteFormated, v.NomVente, v.ComissionAgent);
             reportedVente.reportingOffre = new ReportingOffre(v.Offre.NomOffre, v.Offre.Adresse, v.Offre.Prix, v.Offre.Surface);
             VenteReport vr = new VenteReport(reportedVente);
             liste.Add(vr);
             reportedAgent.ReportedVentes.Add(vr);
         }
         //lv = new ListeVentes(liste);
         AgentForm report = new AgentForm(new AgentReporting(reportedAgent));
         report.ShowDialog();
     }
     else
     {
         MessageBox.Show("D'abord choisissez un Agent", "Avertissement", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
예제 #2
0
        public void Print()
        {
            try
            {
                ReportedVente reportedVente = new ReportedVente(CurrentVente.DateVenteFormated,
                                                                CurrentVente.Agent.PrenomNom, CurrentVente.Client.PrenomNom,
                                                                CurrentVente.Offre.Client.PrenomNom, CurrentVente.ComissionAgence,
                                                                CurrentVente.ComissionAgent);
                ReportingOffre ro = new ReportingOffre(CurrentVente.Offre.NomOffre, CurrentVente.Offre.Adresse,
                                                       CurrentVente.Offre.Prix, CurrentVente.Offre.Surface);
                reportedVente.reportingOffre = ro;
                VenteForm report = new VenteForm(new VenteReport(reportedVente));

                report.ShowDialog();
            }
            catch (Exception)
            {
                MessageBox.Show("D'abord choisissez une Vente", "Avertissement", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }