void Newfrm_CallBack(object sender, CustumEventArgs e) { TarifFacturationoInserte.Add((CsTarifFacturation)e.Bag); ListeTarifFacturation.Add((CsTarifFacturation)e.Bag); SessionObject.ListeTarifFacturation = ListeTarifFacturation.ToList(); LoadDatagrid(ListeTarifFacturation.OrderBy(t => t.CTARCOMP).ToList()); }
private void LoadTarifGenerer(CsVariableDeTarification lavariable) { try { //string FK_IDRECHERCHETARIF=string.Empty; //string PK_ID=string.Empty; //if (cbo_variable_tarification.SelectedItem!=null) //{ // FK_IDRECHERCHETARIF= ((CsVariableDeTarification)cbo_variable_tarification.SelectedItem).FK_IDRECHERCHETARIF.ToString(); // PK_ID=((CsVariableDeTarification)cbo_variable_tarification.SelectedItem).PK_ID.ToString(); //} TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification")); int handler = LoadingManager.BeginLoading("Chargement des donnée ..."); service.LoadTarifGenererAsync(lavariable.FK_IDRECHERCHETARIF.ToString(), lavariable.PK_ID.ToString(), lavariable.PRODUIT); service.LoadTarifGenererCompleted += (er, res) => { try { if (res.Error != null || res.Cancelled) { Message.Show("Erreur dans le traitement : " + res.Error.InnerException.ToString(), "Erreur"); } else if (res.Result != null) { //Code de chargement de la grid pr les ligne de redevence foreach (var item in res.Result) { ListeTarifFacturation.Add(item); } //TarifFacturationoInserte = res.Result; LoadDatagrid(ListeTarifFacturation.OrderBy(t => t.CTARCOMP).ToList()); } else { Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs", "Erreur"); } LoadingManager.EndLoading(handler); } catch (Exception ex) { throw ex; } }; } catch (Exception ex) { throw ex; } }
public void LoadAllTarifFacturation(int?idCentre, int?idProduit, int?idRedevance, int?idCodeRecherche) { try { ListeTarifFacturation.Clear(); TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification")); int handler = LoadingManager.BeginLoading("Chargement des donnée ..."); service.LoadAllTarifFacturationAsync(idCentre, idProduit, idRedevance, idCodeRecherche); service.LoadAllTarifFacturationCompleted += (er, res) => { try { if (res.Error != null || res.Cancelled) { Message.Show("Erreur dans le traitement : " + res.Error.InnerException.ToString(), "Erreur"); } else if (res.Result != null) { SessionObject.ListeTarifFacturation = res.Result; //LoadAllDetailTarifFacturation(SessionObject.ListeTarifFacturation); foreach (var item in res.Result) { ListeTarifFacturation.Add(item); } LoadDatagrid(ListeTarifFacturation.OrderBy(t => t.CTARCOMP).ToList()); } else { Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs", "Erreur"); } LoadingManager.EndLoading(handler); } catch (Exception ex) { throw ex; } }; } catch (Exception ex) { throw ex; } }