private void RetourneFactureIsole(List <int> lstCentre, DateTime DateDebut, DateTime DateFin) { Galatee.Silverlight.ServiceReport.ReportServiceClient service1 = new Galatee.Silverlight.ServiceReport.ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Report")); service1.ReturneFactureIsoleCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } if (res.Result != null && res.Result.Count != 0) { string Rdlc = "FactureIsole"; if (OptionImpression == SessionObject.EnvoiPrinter) { Utility.ActionDirectOrientation <ServicePrintings.CsEvenement, ServiceReport.CsEvenement>(res.Result, null, SessionObject.CheminImpression, Rdlc, "Report", true); } else if (OptionImpression == SessionObject.EnvoiExecl) { Utility.ActionExportation <ServicePrintings.CsEvenement, ServiceReport.CsEvenement>(res.Result, null, string.Empty, SessionObject.CheminImpression, Rdlc, "Report", true, "xlsx"); } else if (OptionImpression == SessionObject.EnvoiWord) { Utility.ActionExportation <ServicePrintings.CsEvenement, ServiceReport.CsEvenement>(res.Result, null, string.Empty, SessionObject.CheminImpression, Rdlc, "Report", true, "doc"); } else if (OptionImpression == SessionObject.EnvoiPdf) { Utility.ActionExportation <ServicePrintings.CsEvenement, ServiceReport.CsEvenement>(res.Result, null, string.Empty, SessionObject.CheminImpression, Rdlc, "Report", true, "pdf"); } } else { Message.ShowInformation("Aucune information trouvée", "Report"); return; } }; service1.ReturneFactureIsoleAsync(lstCentre, DateDebut, DateFin); service1.CloseAsync(); }
private void RetourneFactureIsole(List <int> lstIdCentre, List <int> lstIdSecteur, List <int> lstIdCategorie, List <int> lstIdProduit, DateTime?DateDebut, DateTime?DateFin) { string periode = null; if (!string.IsNullOrEmpty(this.Txt_Periode.Text)) { periode = Shared.ClasseMEthodeGenerique.FormatPeriodeAAAAMM(this.Txt_Periode.Text); } if (string.IsNullOrEmpty(this.dtp_DateDebut.Text)) { DateDebut = null; } if (string.IsNullOrEmpty(this.dtp_DateFin.Text)) { DateFin = null; } Galatee.Silverlight.ServiceReport.ReportServiceClient service1 = new Galatee.Silverlight.ServiceReport.ReportServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Report")); service1.ReturneFactureIsoleCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } if (res.Result != null && res.Result.Count != 0) { string Rdlc = "FactureIsole"; Dictionary <string, string> param = new Dictionary <string, string>(); if (!string.IsNullOrEmpty(periode)) { param.Add("pPeriode", periode); } else { param.Add("pPeriode", ""); } if (!string.IsNullOrEmpty(this.dtp_DateDebut.Text)) { param.Add("pDebut", DateDebut.Value.ToShortDateString()); } else { param.Add("pDebut", ""); } if (!string.IsNullOrEmpty(this.dtp_DateFin.Text)) { param.Add("pFin", DateFin.Value.ToShortDateString()); } else { param.Add("pFin", ""); } if (OptionImpression == SessionObject.EnvoiPrinter) { Utility.ActionDirectOrientation <ServicePrintings.CsLclient, ServiceReport.CsLclient>(res.Result, param, SessionObject.CheminImpression, Rdlc, "Report", true); } else if (OptionImpression == SessionObject.EnvoiExecl) { Utility.ActionExportation <ServicePrintings.CsLclient, ServiceReport.CsLclient>(res.Result, param, string.Empty, SessionObject.CheminImpression, Rdlc, "Report", true, "xlsx"); } else if (OptionImpression == SessionObject.EnvoiWord) { Utility.ActionExportation <ServicePrintings.CsLclient, ServiceReport.CsLclient>(res.Result, param, string.Empty, SessionObject.CheminImpression, Rdlc, "Report", true, "doc"); } else if (OptionImpression == SessionObject.EnvoiPdf) { Utility.ActionExportation <ServicePrintings.CsLclient, ServiceReport.CsLclient>(res.Result, param, string.Empty, SessionObject.CheminImpression, Rdlc, "Report", true, "pdf"); } } else { Message.ShowInformation("Aucune information trouvée", "Report"); return; } }; service1.ReturneFactureIsoleAsync(lstIdCentre, lstIdSecteur, lstIdCategorie, lstIdProduit, DateDebut, DateFin, periode); service1.CloseAsync(); }