private void ChargerSourceControle() { try { FraudeServiceClient client = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); client.SelectAllSourceControleCompleted += (ssender, args) => { if (args.Cancelled || args.Error != null) { string error = args.Error.Message; Message.ShowError(error, ""); return; } if (args.Result == null) { //Message.ShowError(Languages.msgErreurChargementDonnees, Languages.Parametrage); Message.ShowError(Galatee.Silverlight.Resources.Devis.Languages.msgErreurChargementDonnees, ""); return; } if (args.Result != null) { Cbo_SourceControle.ItemsSource = null; Cbo_SourceControle.DisplayMemberPath = "Libelle"; Cbo_SourceControle.SelectedValuePath = "PK_ID"; Cbo_SourceControle.ItemsSource = args.Result; } }; client.SelectAllSourceControleAsync(); } catch (Exception ex) { throw ex; } }
private void Validationdemande(CsDemandeFraude LaDemande) { try { FraudeServiceClient Client = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude"));; Client.ValiderDemandeConsommationCompleted += (ss, b) => { if (b.Cancelled || b.Error != null) { string error = b.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } if (b.Result != null) { Message.Show("Affectation effectuée avec succès", "Information"); List <int> Listid = new List <int>(); Listid.Add(LaDemande.LaDemande.PK_ID); EnvoyerDemandeEtapeSuivante(Listid); this.DialogResult = true; } else { Message.ShowError("Erreur a la cloture de la demande", "Cloturedemande"); } }; Client.ValiderDemandeConsommationAsync(LaDemande); } catch (Exception ex) { this.DialogResult = false; Message.Show(ex.Message, "Transmit"); } }
private void ChargeDonneDemande(int pk_id) { FraudeServiceClient service = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); service.RetourDemandeFraudeCompleted += (s, args) => { try { if (args != null && args.Cancelled) { return; } LaDemande = args.Result; if (LaDemande != null) { txt_Produit.Text = LaDemande.CompteurFraude.libelle_Produit; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.RetourDemandeFraudeAsync(pk_id); }
private void ChargeDonneDemande(int pk_id) { FraudeServiceClient service = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); service.RetourDemandeFraudeCompleted += (s, args) => { try { if (args != null && args.Cancelled) { return; } LaDemande = args.Result; if (LaDemande != null) { ///Information iwbes txt_CompteurIwebs.Text = string.IsNullOrEmpty(LaDemande.Canalisation.NUMERO) ? string.Empty : LaDemande.Canalisation.NUMERO; txt_marqueIwebs.Text = string.IsNullOrEmpty(LaDemande.Canalisation.MARQUE) ? string.Empty : LaDemande.Canalisation.MARQUE; txt_CommunIwebs.Text = string.IsNullOrEmpty(LaDemande.Ag.COMMUNE) ? string.Empty : LaDemande.Ag.COMMUNE; txt_quartierIwebs.Text = string.IsNullOrEmpty(LaDemande.Ag.QUARTIER) ? string.Empty : LaDemande.Ag.QUARTIER; txt_RueIwbes.Text = string.IsNullOrEmpty(LaDemande.Ag.RUE) ? string.Empty : LaDemande.Ag.RUE; txt_porteIwebs.Text = string.IsNullOrEmpty(LaDemande.Ag.PORTE) ? string.Empty : LaDemande.Ag.PORTE; txt_TourneeIwebs.Text = string.IsNullOrEmpty(LaDemande.Ag.TOURNEE) ? string.Empty : LaDemande.Ag.TOURNEE; txt_ordreTourne.Text = string.IsNullOrEmpty(LaDemande.Ag.ORDTOUR) ? string.Empty : LaDemande.Ag.ORDTOUR; //Information Fraude ///Information iwbes txt_CompteurFrs.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Commune) ? string.Empty : LaDemande.ClientFraude.Commune; txt_MarqueFrs.Text = string.IsNullOrEmpty(LaDemande.CompteurFraude.MARQUE) ? string.Empty : LaDemande.CompteurFraude.MARQUE; txt_CommunFrs.Text = string.IsNullOrEmpty(LaDemande.CompteurFraude.MARQUE) ? string.Empty : LaDemande.CompteurFraude.MARQUE; txt_quartierFrs.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Quartier) ? string.Empty : LaDemande.ClientFraude.Quartier; txt_rueFrs.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Rue) ? string.Empty : LaDemande.ClientFraude.Rue; txt_portedfrs.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Porte) ? string.Empty : LaDemande.ClientFraude.Porte; txt_IndexFrs.Text = string.IsNullOrEmpty(LaDemande.CompteurFraude.IndexCompteur.ToString()) ? string.Empty : LaDemande.CompteurFraude.IndexCompteur.ToString(); //txt_ordreTourne.Text = string.IsNullOrEmpty(LaDemande.Ag.ORDTOUR) ? string.Empty : LaDemande.Ag.ORDTOUR; txt_Nom.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Nomabon) ? string.Empty : LaDemande.ClientFraude.Nomabon; txt_refAbon.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Client) ? string.Empty : LaDemande.ClientFraude.Client;; txt_Centre.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Centre) ? string.Empty : LaDemande.ClientFraude.Centre;; //txt_telephone.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Telephone) ? string.Empty : LaDemande.ClientFraude.Telephone; ; //txt_porte.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.Porte) ? string.Empty : LaDemande.ClientFraude.Porte; ; //txt_ContactAbonne.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.ContratAbonnement) ? string.Empty : LaDemande.ClientFraude.ContratAbonnement; //txt_contarBrachement.Text = string.IsNullOrEmpty(LaDemande.ClientFraude.ContratBranchement) ? string.Empty : LaDemande.ClientFraude.ContratBranchement; //txt_Numerotraitement.Text = string.IsNullOrEmpty(LaDemande.LaDemande.NUMDEM) ? string.Empty : LaDemande.LaDemande.NUMDEM; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.RetourDemandeFraudeAsync(pk_id); }
private void OKButton_Click(object sender, RoutedEventArgs e) { try { if (!VerifieChampObligation()) { return; } var messageBox = new MessageBoxControl.MessageBoxChildWindow(Langue.Fraude, Langue.QuestionEnregistrerDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question); messageBox.OnMessageBoxClosed += (_, result) => { if (messageBox.Result == MessageBoxResult.OK) { listForInsertOrUpdate = GetInformationsFromScreen(); var service = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); if (listForInsertOrUpdate != null && listForInsertOrUpdate.Count > 0) { service.InsertClientFraudeCompleted += (snder, insertR) => { if (insertR.Cancelled || insertR.Error != null) { Message.ShowError(insertR.Error.Message, Langue.Fraude); return; } MyEventArg.Data = insertR.Result; OnEvent(MyEventArg); this.DialogResult = false; return; }; service.InsertClientFraudeAsync(listForInsertOrUpdate); } else { return; } } }; messageBox.Show(); } catch (Exception ex) { Message.Show(ex.Message, Langue.ErreurInsertionDonnees); } }
private void Enregistrement(CsDemandeFraude DemandeFraude) { try { var messageBox = new MessageBoxControl.MessageBoxChildWindow(Langue.Fraude, Langue.QuestionEnregistrerDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question); messageBox.OnMessageBoxClosed += (_, result) => { if (messageBox.Result == MessageBoxResult.OK) { DemandeFraude.Fraude = GetInformationsFromScreen(); DemandeFraude.Denonciateur = GetInformationsFromScreen1(); var service = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); if (listForInsertOrUpdate != null && listForInsertOrUpdate.Count > 0) { service.InsertFraudeDenociateurCompleted += (snder, insertR) => { if (insertR.Cancelled || insertR.Error != null) { Message.ShowError(insertR.Error.Message, Langue.Fraude); return; } if (insertR.Result == 1) { Message.ShowError(Langue.ErreurInsertionDonnees, Langue.Fraude); return; } //OnEvent(null); DialogResult = true; }; service.InsertFraudeDenociateurAsync(DemandeFraude); } else { return; } } }; messageBox.Show(); } catch (Exception ex) { //Message.Show(ex.Message, Languages.Commune); } }
private void ValidationDemande(CsDemandeFraude _LaDemande) { try { _LaDemande.LaDemande = new Galatee.Silverlight.ServiceFraude.CsDemandeBase(); Galatee.Silverlight.ServiceAccueil.CsTdem leTydemande = new Galatee.Silverlight.ServiceAccueil.CsTdem(); leTydemande = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == SessionObject.Enumere.DemandeFraude); _LaDemande.LaDemande.TYPEDEMANDE = (string)leTydemande.CODE; _LaDemande.LaDemande.FK_IDTYPEDEMANDE = (int)leTydemande.PK_ID; _LaDemande.LaDemande.FK_IDADMUTILISATEUR = UserConnecte.PK_ID; _LaDemande.LaDemande.CENTRE = UserConnecte.Centre; _LaDemande.LaDemande.FK_IDCENTRE = UserConnecte.FK_IDCENTRE; _LaDemande.LaDemande.USERCREATION = UserConnecte.matricule; _LaDemande.LaDemande.DATECREATION = DateTime.Now; //Lancer la transaction de mise a jour en base FraudeServiceClient service1 = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); service1.ValiderDemandeInitailisationCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } if (!string.IsNullOrEmpty(res.Result)) { string Retour = res.Result; string[] coupe = Retour.Split('.'); Shared.ClasseMEthodeGenerique.InitWOrkflow(coupe[0], _LaDemande.LaDemande.FK_IDCENTRE, coupe[1], _LaDemande.LaDemande.FK_IDTYPEDEMANDE); } //if (Closed != null) // Closed(this, new EventArgs()); this.DialogResult = false; }; service1.ValiderDemandeInitailisationAsync(_LaDemande); service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
private void txt_refclient_LostFocus(object sender, RoutedEventArgs e) { if (txt_IdentUnique.Text != null) { FraudeServiceClient service = new FraudeServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Fraude")); service.RetourneClientFraudeCompleted += (snder, insertR) => { if (insertR.Cancelled || insertR.Error != null) { Message.ShowError(insertR.Error.Message, Langue.Fraude); return; } if (insertR.Result == null) { Message.ShowError(Langue.ErreurInsertionDonnees, Langue.Fraude); return; } if (insertR.Result != null) { foreach (CsClientFraude item in insertR.Result) { txt_Nom.Text = item.Nomabon; txt_Nom.Tag = item.PK_ID; txt_refclient.Text = item.Client; txt_IdentUnique.Text = item.IdentificationUnique; txt_email.Text = item.Email; txt_ContactAbonne.Text = item.ContratAbonnement; txt_contarBrachement.Text = item.ContratBranchement; txt_porte.Text = item.Porte; txt_telephone.Text = item.Telephone; } } }; service.RetourneClientFraudeAsync(txt_IdentUnique.Text, (int)UserConnecte.FK_IDCENTRE); } else { return; } }