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()); }
public void Save(CsTarifFacturation TarifFacturationoUpdate, int Action) { try { TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification")); int handler = LoadingManager.BeginLoading("Mise à jour des données ..."); service.SaveTarifFacturationAsync(TarifFacturationoUpdate, Action); service.SaveTarifFacturationCompleted += (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) { if (res.Result) { LoadDatagrid(ListeTarifFacturation.ToList()); } else { Message.Show("Sauvegarde non effectuée avec succès, il se peut que vos modifications n'aient pas été prises en compte", "Info"); } } else { Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs", "Erreur"); } LoadingManager.EndLoading(handler); } catch (Exception) { throw; } }; } catch (Exception ex) { throw ex; } }
public void LoadAllDetailTarifFacturation(List <CsTarifFacturation> lstTatif) { try { TarificationServiceClient service = new TarificationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Tarification")); service.LoadAllDetailTarifFacturationAsync(); service.LoadAllDetailTarifFacturationCompleted += (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) { foreach (var item in lstTatif) { item.DETAILTARIFFACTURATION = res.Result.Where(t => t.FK_IDTARIFFACTURATION == item.PK_ID).ToList(); item.LIBELLERECHERCHETARIF = SessionObject.ListeRechercheTarif.FirstOrDefault(r => r.CODE == item.RECHERCHETARIF).LIBELLE; item.LIBELLEREDEVANCE = SessionObject.ListeRedevence.FirstOrDefault(r => r.CODE == item.REDEVANCE).LIBELLE; ListeTarifFacturation.Add(item); } LoadDatagrid(ListeTarifFacturation.ToList()); } else { Message.Show("Une erreur s'est produite, veuillez consultez le journal des erreurs", "Erreur"); } } catch (Exception ex) { throw ex; } }; } catch (Exception ex) { throw ex; } }