public UcListeDesignationMT(List <ObjELEMENTDEVIS> _ListeFourniture, List <ObjELEMENTDEVIS> lstEltsSelect, CsDemande laDemande) { InitializeComponent(); MaDemande = laDemande; RemplirListeRubrique(); if (MaDemande.LaDemande.ISEXTENSION == true) { Chk_Extension.Visibility = System.Windows.Visibility.Visible; } ListeFourniture = _ListeFourniture; Devis = SessionObject.LstDesCoutDemande.FirstOrDefault(t => t.COPER == SessionObject.Enumere.CoperTRV); if (Devis != null) { taxe = SessionObject.LstDesTaxe.FirstOrDefault(t => t.PK_ID == Devis.FK_IDTAXE); } List <int> lstIdFournDevis = new List <int>(); if (lstEltsSelect == null) { lstEltsSelect = new List <ObjELEMENTDEVIS>(); } MyElements = lstEltsSelect; foreach (ObjELEMENTDEVIS item in lstEltsSelect.Where(t => t.FK_IDMATERIELDEVIS != null)) { lstIdFournDevis.Add(item.FK_IDMATERIELDEVIS.Value); } RemplirListe(ListeFourniture.Where(t => !lstIdFournDevis.Contains(t.PK_ID)).ToList()); ChargerTypeMateriel(); }
//private void ListeSortieMateriel(CsDemande demande) //{ // AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); // service1.RetourneListeSortieMaterielLivreCompleted += (sr, res2) => // { // if (res2 != null && res2.Cancelled) // return; // if (res2.Result.Count() > 0) // { // lstSortie = res2.Result; // foreach (CsSortieMateriel sortie in lstSortie) // { // LstDemandeValide.Add(canal); // } // LstDemandeValide = LstDemandeValide.Where(c => c.PK_ID != 0).ToList(); // LstDemandeValide = new List<CsCanalisation>(); // } // else // { // demande.LstCanalistion.ForEach(c => c.ISLIVRE = false); // LstDemandeValide = new List<CsCanalisation>(); // } // }; // service1.RetourneListeSortieMaterielLivreAsync(demande.LaDemande.PK_ID); // service1.CloseAsync(); //} private void ListeSortieAutreMateriel(CsDemande demande) { dgAutreMateriel.ItemsSource = demande.EltDevis; }
private void ChargeDetailDEvis(int IdDemandeDevis) { AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.ChargerDetailDemandeAsync(IdDemandeDevis, string.Empty); client.ChargerDetailDemandeCompleted += (ssender, args) => { if (args.Cancelled || args.Error != null) { LayoutRoot.Cursor = Cursors.Arrow; string error = args.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } if (args.Result == null) { LayoutRoot.Cursor = Cursors.Arrow; Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis); return; } else { laDetailDemande = args.Result; //#region DocumentScanne //if (laDetailDemande.ObjetScanne != null && laDetailDemande.ObjetScanne.Count != 0) //{ // foreach (var item in laDetailDemande.ObjetScanne) // { // LstPiece.Add(item); // ObjetScanne.Add(item); // } // dgListePiece.ItemsSource = null ; // dgListePiece.ItemsSource = ObjetScanne; //} //#endregion //if( laDetailDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.Resiliation) // this.Chk_PasDeFacture.Visibility = System.Windows.Visibility.Visible ; laDemandeSelect = laDetailDemande.LaDemande; RenseignerInformationsDevis(laDetailDemande); RenseignerInformationsDemandeDevis(laDetailDemande); RenseignerInformationsAppareilsDevis(laDetailDemande); RenseignerInformationsFournitureDevis(laDetailDemande); RenseignerInformationsAbonnement(laDetailDemande); RenseignerInformationsBrt(laDetailDemande); //RenseignerInformationsDocumentScanne(); RenseignerInformationsAnnotationDevis(laDetailDemande); #region DocumentScanne ctrl = new Galatee.Silverlight.Shared.UcFichierJoint(laDetailDemande.ObjetScanne, false); Vwb.Stretch = Stretch.None; Vwb.Child = ctrl; #endregion LayoutRoot.Cursor = Cursors.Arrow; } LayoutRoot.Cursor = Cursors.Arrow; }; }
public FrmValidationModificationAdresse(CsDemande _LaDemande) { InitializeComponent(); Translate(); }
private void ValidationDemande(CsDemande _Lademande) { try { foreach (var item in _Lademande.LstCanalistion) { item.ANNEEFAB = string.IsNullOrEmpty(this.Txt_AnneeFab.Text) ? string.Empty : this.Txt_AnneeFab.Text; item.CADRAN = string.IsNullOrEmpty(this.Txt_CodeCadran.Text) ? Convert.ToByte(6) : Convert.ToByte(this.Txt_CodeCadran.Text); item.NUMERO = string.IsNullOrEmpty(this.Txt_NumCompteur.Text) ? string.Empty : this.Txt_NumCompteur.Text; item.MARQUE = string.IsNullOrEmpty(this.Txt_CodeMarque.Text) ? string.Empty : this.Txt_CodeMarque.Text; item.TYPECOMPTEUR = string.IsNullOrEmpty(this.Txt_CodeTypeCompteur.Text) ? string.Empty : this.Txt_CodeTypeCompteur.Text; item.FK_IDCALIBRE = null; if (this.Txt_LibelleDiametre.Tag != null) { item.FK_IDCALIBRE = (int)this.Txt_LibelleDiametre.Tag; } item.FK_IDMARQUECOMPTEUR = (int)this.Txt_CodeMarque.Tag; item.FK_IDTYPECOMPTEUR = (int)this.Txt_CodeTypeCompteur.Tag; item.USERCREATION = UserConnecte.matricule; } if (_Lademande.LaDemande == null) { _Lademande.LaDemande = new CsDemandeBase(); } _Lademande.LaDemande.MATRICULE = UserConnecte.matricule; _Lademande.LaDemande.CENTRE = _Lademande.Abonne != null ? _Lademande.Abonne.CENTRE:_Lademande.LaDemande.CENTRE; _Lademande.LaDemande.CLIENT = _Lademande.Abonne != null ? _Lademande.Abonne.CLIENT : _Lademande.LaDemande.CLIENT; _Lademande.LaDemande.ORDRE = _Lademande.Abonne != null ? _Lademande.Abonne.ORDRE : _Lademande.LaDemande.ORDRE; _Lademande.LaDemande.PRODUIT = _Lademande.Abonne != null ? _Lademande.Abonne.PRODUIT : _Lademande.LaDemande.PRODUIT; _Lademande.LaDemande.STATUT = SessionObject.Enumere.DemandeStatusEnAttente; _Lademande.LaDemande.TYPEDEMANDE = Tdem; _Lademande.LaDemande.FK_IDTYPEDEMANDE = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem) != null?SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem).PK_ID : 0; _Lademande.LaDemande.FK_IDCENTRE = (int)txtCentre.Tag; _Lademande.LaDemande.FK_IDPRODUIT = (int)txt_Produit.Tag; _Lademande.LaDemande.USERCREATION = UserConnecte.matricule; _Lademande.LaDemande.USERMODIFICATION = UserConnecte.matricule; _Lademande.LaDemande.DATECREATION = System.DateTime.Now; _Lademande.LaDemande.DATEMODIFICATION = System.DateTime.Now; _Lademande.LaDemande.ISDEMANDEREJETERINIT = false; _Lademande.LaDemande.MOTIF = string.IsNullOrEmpty(this.Txt_Motif.Text) ? string.Empty : this.Txt_Motif.Text; #region Doc Scanne if (_Lademande.ObjetScanne == null) { _Lademande.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } if (LstPiece.Count != 0) { _Lademande.ObjetScanne.AddRange(LstPiece); } #endregion _Lademande.Abonne = null; _Lademande.Branchement = null; _Lademande.LstEvenement = null; _Lademande.EltDevis = null; _Lademande.OrdreTravail = null; _Lademande.Ag = null; AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); if (!IsRejeterDemande) { //Lancer la transaction de mise a jour en base service1.CreeDemandeAsync(_Lademande, true); service1.CreeDemandeCompleted += (sr, res) => { if (res.Result != null) { Message.ShowInformation("La demande a été créée avec succès. Numéro de votre demande : " + res.Result.NUMDEM, Silverlight.Resources.Devis.Languages.txtDevis); this.DialogResult = false; } else { this.IsEnabled = true; Message.ShowError("Une erreur s'est produite a la création de la demande ", "CreeDemande"); } }; service1.CloseAsync(); } else { //Lancer la transaction de mise a jour en base service1.CreationDemandeSuiteRejetAsync(_Lademande, true); service1.CreationDemandeSuiteRejetCompleted += (sr, res) => { if (string.IsNullOrEmpty(res.Result)) { Message.ShowInformation("La demande transmise avec succes", Silverlight.Resources.Devis.Languages.txtDevis); this.DialogResult = false; } else { Message.ShowError("Une erreur s'est produite a la transmission de la demande ", "CreeDemande"); this.IsEnabled = true; } }; service1.CloseAsync(); } } catch (Exception ex) { throw ex; } }
public UcDevisMT(List <ObjELEMENTDEVIS> _ListeFourniture, List <ObjELEMENTDEVIS> lstEltsSelect, CsDemande laDemande) { InitializeComponent(); MaDemande = laDemande; ListeFourniture = _ListeFourniture; Devis = SessionObject.LstDesCoutDemande.FirstOrDefault(t => t.COPER == SessionObject.Enumere.CoperTRV); if (Devis != null) { taxe = SessionObject.LstDesTaxe.FirstOrDefault(t => t.PK_ID == Devis.FK_IDTAXE); } List <int> lstIdFournDevis = new List <int>(); if (lstEltsSelect == null) { lstEltsSelect = new List <ObjELEMENTDEVIS>(); } MyElements = lstEltsSelect; foreach (ObjELEMENTDEVIS item in lstEltsSelect.Where(t => t.FK_IDMATERIELDEVIS != null)) { lstIdFournDevis.Add(item.FK_IDMATERIELDEVIS.Value); } RemplirListeMaterielMT(_ListeFourniture, SessionObject.LstRubriqueDevis); RemplirListeRubrique(); }
private void AfficherInfoClient(CsDemande _NouvelInfoClient, CsDemande _LeClientdemande) { try { this.Txt_CodeCentre.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.CENTRE) ? string.Empty : _LeClientdemande.Abonne.CENTRE; this.Txt_LibelleCentre.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.LIBELLECENTRE) ? string.Empty : _LeClientdemande.Abonne.LIBELLECENTRE; this.Txt_CodeProduit.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.PRODUIT) ? string.Empty : _LeClientdemande.Abonne.PRODUIT; this.Txt_LibelleProduit.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.LIBELLEPRODUIT) ? string.Empty : _LeClientdemande.Abonne.LIBELLEPRODUIT; this.Txt_NumDemande.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.NUMDEM) ? string.Empty : _LeClientdemande.Abonne.NUMDEM; this.Txt_Client.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.CLIENT) ? string.Empty : _LeClientdemande.Abonne.CLIENT; this.Txt_Ordre.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.ORDRE) ? string.Empty : _LeClientdemande.Abonne.ORDRE; this.Txt_NomClientAbon.Text = (string.IsNullOrEmpty(_LeClientdemande.LeClient.NOMABON) ? string.Empty : _LeClientdemande.LeClient.NOMABON); this.Txt_telephone.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.TELEPHONE) ? string.Empty : _LeClientdemande.LeClient.TELEPHONE; this.Txt_Addresse1.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.ADRMAND1) ? string.Empty : _LeClientdemande.LeClient.ADRMAND1; this.Txt_adresse2.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.ADRMAND2) ? string.Empty : _LeClientdemande.LeClient.ADRMAND2; this.Txt_CodeConsomateur.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.CODECONSO) ? string.Empty : _LeClientdemande.LeClient.CODECONSO; this.Txt_LibelleCodeConso.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.LIBELLECODECONSO) ? string.Empty : _LeClientdemande.LeClient.LIBELLECODECONSO; this.Txt_CodeCategorie.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.CATEGORIE) ? string.Empty : _LeClientdemande.LeClient.CATEGORIE; this.Txt_LibelleCategorie.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.LIBELLECATEGORIE) ? string.Empty : _LeClientdemande.LeClient.LIBELLECATEGORIE; this.Txt_CodeFermableClient.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.CODERELANCE) ? string.Empty : _LeClientdemande.LeClient.CODERELANCE; this.Txt_LibelleFermable.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.LIBELLERELANCE) ? string.Empty : _LeClientdemande.LeClient.LIBELLERELANCE; this.Txt_CodeRegroupement.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.REGROUPEMENT) ? string.Empty : _LeClientdemande.LeClient.REGROUPEMENT; this.Txt_LibelleGroupeCode.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.LIBELLEREGCLI) ? string.Empty : _LeClientdemande.LeClient.LIBELLEREGCLI; this.Txt_CodeNationalite.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.NATIONNALITE) ? string.Empty : _LeClientdemande.LeClient.NATIONNALITE; this.Txt_Nationnalite.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.LIBELLENATIONALITE) ? string.Empty : _LeClientdemande.LeClient.LIBELLENATIONALITE; this.Txt_CodeCivilite.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.DENABON) ? string.Empty : _LeClientdemande.LeClient.DENABON; this.Txt_Civilite.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.LIBELLEDENOMINATION) ? string.Empty : _LeClientdemande.LeClient.LIBELLEDENOMINATION; this.Txt_Matricule.Text = string.IsNullOrEmpty(_LeClientdemande.LeClient.MATRICULE) ? string.Empty : _LeClientdemande.LeClient.MATRICULE; if (_LeClientdemande.Abonne != null) { this.Txt_AncCodeTarif.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.TYPETARIF) ? string.Empty : _LeClientdemande.Abonne.TYPETARIF; this.Txt_AncLibelleTarif.Text = string.IsNullOrEmpty(_LeClientdemande.Abonne.LIBELLETARIF) ? string.Empty : _LeClientdemande.Abonne.LIBELLETARIF; } this.Txt_NouvNomClientAbon.Text =string.IsNullOrEmpty(_NouvelInfoClient.LeClient.NOMABON) ? string.Empty : _NouvelInfoClient.LeClient.NOMABON; this.Txt_Nouvtelephone.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.TELEPHONE) ? string.Empty : _NouvelInfoClient.LeClient.TELEPHONE; this.Txt_NouvAddresse1.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.ADRMAND1) ? string.Empty : _NouvelInfoClient.LeClient.ADRMAND1; this.Txt_Nouvadresse2.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.ADRMAND2) ? string.Empty : _NouvelInfoClient.LeClient.ADRMAND2; this.Txt_NouvCodeConsomateur.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.CODECONSO) ? string.Empty : _NouvelInfoClient.LeClient.CODECONSO; this.Txt_NouvLibelleCodeConso.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.LIBELLECODECONSO) ? string.Empty : _NouvelInfoClient.LeClient.LIBELLECODECONSO; this.Txt_NouvCodeCategorie.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.CATEGORIE) ? string.Empty : _NouvelInfoClient.LeClient.CATEGORIE; this.Txt_NouvLibelleCategorie.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.LIBELLECATEGORIE) ? string.Empty : _NouvelInfoClient.LeClient.LIBELLECATEGORIE; this.Txt_NouvCodeFermableClient.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.CODERELANCE) ? string.Empty : _NouvelInfoClient.LeClient.CODERELANCE; this.Txt_NouvLibelleFermable.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.LIBELLERELANCE) ? string.Empty : _NouvelInfoClient.LeClient.LIBELLERELANCE; this.Txt_NouvCodeNationalite.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.NATIONNALITE) ? string.Empty : _NouvelInfoClient.LeClient.NATIONNALITE; this.Txt_NouvNationnalite.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.LIBELLENATIONALITE) ? string.Empty : _NouvelInfoClient.LeClient.LIBELLENATIONALITE; this.Txt_NouvCodeCivilite.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.DENABON) ? string.Empty : _NouvelInfoClient.LeClient.DENABON; this.Txt_NouvCivilite.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.LIBELLEDENOMINATION) ? string.Empty : _NouvelInfoClient.LeClient.LIBELLEDENOMINATION; this.Txt_NouvCodeRegroupement.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.REGROUPEMENT) ? string.Empty : _NouvelInfoClient.LeClient.REGROUPEMENT; this.Txt_NouvLibelleGroupeCode.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.LIBELLEREGCLI) ? string.Empty : _NouvelInfoClient.LeClient.LIBELLEREGCLI; this.Txt_NouvMatricule.Text = string.IsNullOrEmpty(_NouvelInfoClient.LeClient.MATRICULE) ? string.Empty : _NouvelInfoClient.LeClient.MATRICULE; if (_NouvelInfoClient.Abonne != null) { this.Txt_NouvCodeTarif.Text = string.IsNullOrEmpty(_NouvelInfoClient.Abonne.TYPETARIF) ? string.Empty : _NouvelInfoClient.Abonne.TYPETARIF; this.Txt_NouvLibelleTarif.Text = string.IsNullOrEmpty(_NouvelInfoClient.Abonne.LIBELLETARIF) ? string.Empty : _NouvelInfoClient.Abonne.LIBELLETARIF; } if (laDetailDemande.ObjetScanne != null && laDetailDemande.ObjetScanne.Count != 0) dgListePiece.ItemsSource = this.LstPiece; if (this.Txt_NouvNomClientAbon.Text != this.Txt_NomClientAbon.Text) { this.Txt_NouvNomClientAbon.FontWeight = FontWeights.ExtraBold; this.Txt_NouvNomClientAbon.FontStyle = FontStyles.Italic; } if (this.Txt_Nouvtelephone.Text != this.Txt_telephone.Text) { this.Txt_Nouvtelephone.FontWeight = FontWeights.ExtraBold; this.Txt_Nouvtelephone.FontStyle = FontStyles.Italic; } if (this.Txt_NouvAddresse1.Text != this.Txt_Addresse1.Text) { this.Txt_NouvAddresse1.FontWeight = FontWeights.ExtraBold; this.Txt_NouvAddresse1.FontStyle = FontStyles.Italic; } if (this.Txt_Nouvadresse2.Text != this.Txt_adresse2.Text) { this.Txt_Nouvadresse2.FontWeight = FontWeights.ExtraBold; this.Txt_Nouvadresse2.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeConsomateur.Text != this.Txt_CodeConsomateur.Text) { this.Txt_NouvCodeConsomateur.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleCodeConso.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleCodeConso.FontStyle = FontStyles.Italic; this.Txt_NouvCodeConsomateur.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeCategorie.Text != this.Txt_CodeCategorie.Text) { this.Txt_NouvCodeCategorie.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleCategorie.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleCategorie.FontStyle = FontStyles.Italic; this.Txt_NouvCodeCategorie.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeFermableClient.Text != this.Txt_CodeFermableClient.Text) { this.Txt_NouvCodeFermableClient.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleFermable.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleFermable.FontStyle = FontStyles.Italic; this.Txt_NouvCodeFermableClient.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeNationalite.Text != this.Txt_CodeNationalite.Text) { this.Txt_NouvCodeNationalite.FontWeight = FontWeights.ExtraBold; this.Txt_NouvNationnalite.FontWeight = FontWeights.ExtraBold; this.Txt_NouvNationnalite.FontStyle = FontStyles.Italic; this.Txt_NouvCodeNationalite.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeCivilite.Text != this.Txt_CodeCivilite.Text) { this.Txt_NouvCodeCivilite.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCivilite.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCivilite.FontStyle = FontStyles.Italic; this.Txt_NouvCodeCivilite.FontStyle = FontStyles.Italic; } if (this.Txt_NouvMatricule.Text != this.Txt_Matricule.Text) { this.Txt_NouvMatricule.FontWeight = FontWeights.ExtraBold; this.Txt_NouvMatricule.FontStyle = FontStyles.Italic; } if (this.Txt_AncCodeTarif.Text != this.Txt_NouvCodeTarif.Text) { this.Txt_NouvCodeTarif.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCodeTarif.FontStyle = FontStyles.Italic; this.Txt_NouvLibelleTarif .FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleTarif.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeRegroupement.Text != this.Txt_CodeRegroupement.Text) { this.Txt_NouvCodeRegroupement.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCodeRegroupement.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCodeRegroupement.FontStyle = FontStyles.Italic; this.Txt_NouvCodeRegroupement.FontStyle = FontStyles.Italic; this.Txt_NouvLibelleGroupeCode.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleGroupeCode.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleGroupeCode.FontStyle = FontStyles.Italic; this.Txt_NouvLibelleGroupeCode.FontStyle = FontStyles.Italic; } } catch (Exception ex) { throw ex; } }
public FrmModification(CsDemande _laDemande) { InitializeComponent(); laDemande = _laDemande; RemplireDonnee(laDemande); }
public UcDemandeDetailBranchement(CsDemande _LaDemande, bool _IsUpdate) { try { InitializeComponent(); Translate(); this.Txt_CodeDiametre.MaxLength = SessionObject.Enumere.TailleDiametreBranchement; this.Txt_CodeMateriel.MaxLength = SessionObject.Enumere.TailleCodeMateriel; this.Txt_DateRacordement.MaxLength = SessionObject.Enumere.TailleDate; this.Txt_DateDepose.MaxLength = SessionObject.Enumere.TailleDate; if (!_IsUpdate) { this.Txt_DateRacordement.Text = DateTime.Now.ToShortDateString(); this.Txt_DateDepose.Text = DateTime.Now.ToShortDateString(); } LaDemande = _LaDemande; TypeDemande = _LaDemande.LaDemande.TYPEDEMANDE; if (LaDemande.Branchement == null) { LaDemande.Branchement = new CsBrt(); } this.Txt_Client.Text = string.IsNullOrEmpty(LaDemande.Branchement.CLIENT) ? string.Empty : LaDemande.LaDemande.CLIENT; this.Txt_Addresse.Text = string.IsNullOrEmpty(LaDemande.Branchement.CLIENT) ? string.Empty : LaDemande.LaDemande.CLIENT; ChargerDiametreBranchement(); ChargerMaterielBranchement(); ChargeQuartier(); //ChargeDeparts(); if (TypeDemande == SessionObject.Enumere.ModificationBranchement) { this.Txt_Ordre.Visibility = System.Windows.Visibility.Collapsed; this.lbl_Ordre.Visibility = System.Windows.Visibility.Collapsed; this.chk_EstSubventionne.Visibility = System.Windows.Visibility.Collapsed; } IsUpdate = _IsUpdate; if (IsUpdate) { if (LaDemande.Branchement != null) { _LeBranchement = LaDemande.Branchement; } else { _LeBranchement = new CsBrt(); } AfficherBranchemetDemande(_LeBranchement); if (TypeDemande != SessionObject.Enumere.ModificationBranchement) { EnregistrerDemande(LaDemande); } } } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private void ValiderInitialisation(CsDemande demandedevis, bool IsTransmetre) { try { demandedevis = GetDemandeDevisFromScreen(demandedevis, false); // Get DemandeDevis informations from screen if (demandedevis != null) { demandedevis.LaDemande.ETAPEDEMANDE = (int)DataReferenceManager.EtapeDevis.Accueil; if (IsTransmetre) { demandedevis.LaDemande.ETAPEDEMANDE = null; } demandedevis.LaDemande.MATRICULE = UserConnecte.matricule; demandedevis.LeClient = laDetailDemande.LeClient; demandedevis.Abonne = laDetailDemande.Abonne; demandedevis.Branchement = laDetailDemande.Branchement; demandedevis.Ag = laDetailDemande.Ag; string numDemande = string.Empty; /* * Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); * client.ValiderDemandeInitailisationCompleted += (ss, b) => * { * if (b.Cancelled || b.Error != null) * { * string error = b.Error.Message; * Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); * return; * } * if (IsTransmetre) * { * string Retour = b.Result; * string[] coupe = Retour.Split('.'); * Shared.ClasseMEthodeGenerique.InitWOrkflow(coupe[0], demandedevis.LaDemande.FK_IDCENTRE, coupe[1], demandedevis.LaDemande.FK_IDTYPEDEMANDE); * numDemande = coupe[1]; * } * List<CsDemandeBase> leDemandeAEditer = new List<CsDemandeBase>(); * demandedevis.LaDemande.NOMCLIENT = demandedevis.LeClient.NOMABON; * demandedevis.LaDemande.LIBELLETYPEDEMANDE = txt_tdem.Text; * demandedevis.LaDemande.NUMDEM = numDemande; * demandedevis.LaDemande.LIBELLEPRODUIT = this.txt_Produit.Text; * demandedevis.LaDemande.MOTIF = this.txt_Motif.Text; * leDemandeAEditer.Add(demandedevis.LaDemande); * Utility.ActionDirectOrientation<ServicePrintings.CsDemandeBase, CsDemandeBase>(leDemandeAEditer, null, SessionObject.CheminImpression, "AccuseRecption", "Accueil", true); * }; * client.ValiderDemandeInitailisationAsync(demandedevis); * * */ Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); client.CreeDemandeCompleted += (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) { List <CsDemandeBase> leDemandeAEditer = new List <CsDemandeBase>(); demandedevis.LaDemande.NOMCLIENT = demandedevis.LeClient.NOMABON; demandedevis.LaDemande.LIBELLETYPEDEMANDE = txt_tdem.Text; demandedevis.LaDemande.NUMDEM = b.Result.NUMDEM;; demandedevis.LaDemande.LIBELLEPRODUIT = this.txt_Produit.Text; demandedevis.LaDemande.MOTIF = this.txt_Motif.Text; leDemandeAEditer.Add(demandedevis.LaDemande); Utility.ActionDirectOrientation <ServicePrintings.CsDemandeBase, CsDemandeBase>(leDemandeAEditer, null, SessionObject.CheminImpression, "AccuseRecption", "Accueil", true); Message.ShowInformation("La demande a été créée avec succès. Numéro de votre demande : " + b.Result.NUMDEM, Silverlight.Resources.Devis.Languages.txtDevis); } }; client.CreeDemandeAsync(demandedevis, IsTransmetre); } } catch (Exception ex) { Message.ShowError("Une erreur s'est produite a la validation ", "ValiderDemandeInitailisation"); } }
private CsDemande GetDemandeDevisFromScreen(CsDemande pDemandeDevis, bool isTransmettre) { try { if (pDemandeDevis == null) { pDemandeDevis = new CsDemande(); pDemandeDevis.LaDemande = new CsDemandeBase(); pDemandeDevis.Abonne = new CsAbon(); pDemandeDevis.Ag = new CsAg(); pDemandeDevis.Branchement = new CsBrt(); pDemandeDevis.LeClient = new CsClient(); pDemandeDevis.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); pDemandeDevis.AppareilDevis = new List <ObjAPPAREILSDEVIS>(); pDemandeDevis.LaDemande.DATECREATION = DateTime.Now; pDemandeDevis.LaDemande.USERCREATION = UserConnecte.matricule; pDemandeDevis.LaDemande.FK_IDADMUTILISATEUR = UserConnecte.PK_ID; } #region Demande if (pDemandeDevis.LaDemande == null) { pDemandeDevis.LaDemande = new CsDemandeBase(); } if (pDemandeDevis.LaDemande.TYPEDEMANDE != SessionObject.Enumere.BranchementAbonement) { pDemandeDevis.LaDemande.CLIENT = string.IsNullOrEmpty(this.Txt_ReferenceClient.Text) ? string.Empty : this.Txt_ReferenceClient.Text; } pDemandeDevis.LaDemande.DATEMODIFICATION = DateTime.Now; pDemandeDevis.LaDemande.MOTIF = txt_Motif.Text; if (txt_tdem.Tag != null) { var typeDevis = (CsTdem)txt_tdem.Tag; if (typeDevis != null) { pDemandeDevis.LaDemande.FK_IDTYPEDEMANDE = typeDevis.PK_ID; pDemandeDevis.LaDemande.TYPEDEMANDE = typeDevis.CODE; } } #region Doc Scanne if (pDemandeDevis.ObjetScanne == null) { pDemandeDevis.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } pDemandeDevis.ObjetScanne.AddRange(LstPiece); #endregion #endregion pDemandeDevis.LaDemande.ISNEW = true; Tdem = pDemandeDevis.LaDemande.TYPEDEMANDE; pDemandeDevis.LaDemande.ORDRE = laDetailDemande.LeClient.ORDRE; pDemandeDevis.LaDemande.DATECREATION = DateTime.Now; pDemandeDevis.LaDemande.PRODUIT = laDetailDemande.Abonne.PRODUIT; pDemandeDevis.LaDemande.FK_IDPRODUIT = laDetailDemande.Abonne.FK_IDPRODUIT; pDemandeDevis.LaDemande.CENTRE = laDetailDemande.Abonne.CENTRE; pDemandeDevis.LaDemande.FK_IDCENTRE = laDetailDemande.Abonne.FK_IDCENTRE; pDemandeDevis.LeClient = laDetailDemande.LeClient; return(pDemandeDevis); } catch (Exception ex) { throw ex; } }
private void ChargeDetailDEvis(CsClient leclient) { try { leclient.TYPEDEMANDE = SessionObject.Enumere.ChangementCompteur; Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.GeDetailByFromClientCompleted += (ssender, args) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; if (args.Cancelled || args.Error != null) { string error = args.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } if (args.Result == null) { Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis); return; } laDetailDemande = args.Result; laDetailDemande.LaDemande = new CsDemandeBase(); laDetailDemande.LaDemande.CENTRE = laDetailDemande.Abonne.CENTRE; laDetailDemande.LaDemande.CLIENT = laDetailDemande.Abonne.CLIENT; laDetailDemande.LaDemande.ORDRE = laDetailDemande.Abonne.ORDRE; laDetailDemande.LaDemande.PRODUIT = laDetailDemande.Abonne.PRODUIT; laDetailDemande.LaDemande.FK_IDPRODUIT = laDetailDemande.Abonne.FK_IDPRODUIT; laDetailDemande.LaDemande.CENTRE = laDetailDemande.Abonne.CENTRE; laDetailDemande.LaDemande.NOMCLIENT = laDetailDemande.Abonne.NOMABON; if (laDetailDemande.LstCanalistion != null && laDetailDemande.LstCanalistion.Count != 0) { laDetailDemande.LaDemande.REGLAGECOMPTEUR = laDetailDemande.LstCanalistion.First().REGLAGECOMPTEUR; } laDemandeSelect = laDetailDemande.LaDemande; RemplireOngletClient(laDetailDemande.LeClient); RemplirOngletAbonnement(laDetailDemande.Abonne); RenseignerInformationsDevis(laDetailDemande.Abonne); if (laDetailDemande.Abonne.PRODUIT != SessionObject.Enumere.Prepaye) { Message.ShowInformation("Cet abonnement n'est pas prépayé", "Info"); this.OKButton.IsEnabled = false; } else { this.OKButton.IsEnabled = true; } }; client.GeDetailByFromClientAsync(leclient); } catch (Exception ex) { prgBar.Visibility = System.Windows.Visibility.Collapsed; Message.ShowError("Erreur au chargement des donnéés", "Demande"); } }
private void RetourneDemandeByNumero(string Numerodemande) { try { prgBar.Visibility = System.Windows.Visibility.Visible; AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.GetDevisByNumDemandeCompleted += (ssender, args) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; if (args.Cancelled || args.Error != null) { LayoutRoot.Cursor = Cursors.Arrow; string error = args.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } if (args.Result == null) { LayoutRoot.Cursor = Cursors.Arrow; Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis); return; } else { laDetailDemande = args.Result; laDemandeSelect = laDetailDemande.LaDemande; this.txtCentre.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLECENTRE) ? string.Empty : laDemandeSelect.LIBELLECENTRE; this.txtSite.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLESITE) ? string.Empty : laDemandeSelect.LIBELLESITE; if (laDemandeSelect.ISSUPPRIME == true) { this.OKButton.IsEnabled = false; Message.ShowInformation("Demande déja supprimée", "Demande"); return; } else { //if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.BranchementAbonement // || laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.AbonnementSeul // || laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ChangementCompteur // ) //{ RemplireOngletClient(laDetailDemande.LeClient); RemplirOngletAbonnement(laDetailDemande.Abonne); RenseignerInformationsDevis(laDetailDemande); this.OKButton.IsEnabled = true; //} //else //{ // this.OKButton.IsEnabled = false; // Message.ShowInformation("Pas de liaison pour ce type de demande", "Demande"); // return; //} } } LayoutRoot.Cursor = Cursors.Arrow; }; client.GetDevisByNumDemandeAsync(Numerodemande); } catch (Exception ex) { Message.Show("Erreur au chargement de la demande", "Demande"); } }
private void ValiderInitialisation(CsDemande demandedevis, bool IsTransmetre) { try { // Get Devis informations from screen if (demandedevis != null) { demandedevis = GetDemandeDevisFromScreen(demandedevis, false); } else { demandedevis = GetDemandeDevisFromScreen(null, false); } // Get DemandeDevis informations from screen if (demandedevis != null) { if (IsTransmetre) { demandedevis.LaDemande.ETAPEDEMANDE = null; } demandedevis.LaDemande.MATRICULE = UserConnecte.matricule; demandedevis.LaDemande.CLIENT = "00000000000"; demandedevis.LaDemande.ORDRE = "01"; if (SessionObject.LePosteCourant.CODECENTRE == SessionObject.Enumere.Generale) { demandedevis.LaDemande.CENTRE = "011"; demandedevis.LaDemande.FK_IDCENTRE = 63; } else { demandedevis.LaDemande.CENTRE = SessionObject.LePosteCourant.CODECENTRE; demandedevis.LaDemande.FK_IDCENTRE = SessionObject.LePosteCourant.FK_IDCENTRE.Value; } #region Doc Scanne if (demandedevis.ObjetScanne == null) { demandedevis.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } demandedevis.ObjetScanne.AddRange(LstPiece); #endregion Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.CreeDemandeCompleted += (ss, b) => { DialogResult = true; 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.ShowInformation("La demande a été créée avec succès. Numéro de votre demande : " + b.Result.NUMDEM, Silverlight.Resources.Devis.Languages.txtDevis); } else { Message.ShowError("Une erreur s'est produite à la création de la demande ", "CreeDemande"); } }; client.CreeDemandeAsync(demandedevis, true); } } catch (Exception ex) { Message.ShowError("Une erreur est survenu suite à la validation", "Validation demande"); } }
private void RetourneDemandeByNumero(string Numerodemande) { try { prgBar.Visibility = System.Windows.Visibility.Visible; AcceuilServiceClient client = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.GetDevisByNumDemandeCompleted += (ssender, args) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; if (args.Cancelled || args.Error != null) { LayoutRoot.Cursor = Cursors.Arrow; string error = args.Error.Message; Message.ShowError(error, "Saut de caisse"); return; } if (args.Result == null) { LayoutRoot.Cursor = Cursors.Arrow; Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, "Saut de caisse"); return; } else { laDetailDemande = args.Result; laDemandeSelect = laDetailDemande.LaDemande; this.txtCentre.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLECENTRE) ? string.Empty : laDemandeSelect.LIBELLECENTRE; this.txtSite.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLESITE) ? string.Empty : laDemandeSelect.LIBELLESITE; if (laDemandeSelect.ISSUPPRIME == true) { this.OKButton.IsEnabled = false; Message.ShowInformation("Demande déja supprimée", "Demande"); return; } else { if (laDetailDemande.InfoDemande != null && laDetailDemande.InfoDemande.CODEETAPE != "ENCAI") { this.OKButton.IsEnabled = false; Message.ShowInformation("Cette demande n'est pas à la caisse", "Demande"); return; } else { //this.OKButton.IsEnabled = true ; this.OKButton.IsEnabled = !string.IsNullOrEmpty(this.txt_motif.Text); } if (laDetailDemande.LaDemande.PRODUIT != SessionObject.Enumere.ElectriciteMT) { ReglageCompt = new CsReglageCompteur(); int idreglageCpt = 0; ReglageCompt = SessionObject.LstReglageCompteur.FirstOrDefault(t => t.CODE == laDetailDemande.LaDemande.REGLAGECOMPTEUR); if (ReglageCompt != null) { idreglageCpt = ReglageCompt.PK_ID; } ChargerTarifClient(laDetailDemande.LaDemande.FK_IDCENTRE, laDetailDemande.LeClient.FK_IDCATEGORIE.Value, idreglageCpt, null, "0", laDetailDemande.LaDemande.FK_IDPRODUIT.Value); } RemplireOngletClient(laDetailDemande.LeClient); RemplirOngletAbonnement(laDetailDemande.Abonne); RemplireOngletFacture(laDetailDemande.LstCoutDemande); RenseignerInformationsDevis(laDetailDemande); this.tabItemMotif.IsSelected = true; } } LayoutRoot.Cursor = Cursors.Arrow; }; client.GetDevisByNumDemandeAsync(Numerodemande); } catch (Exception ex) { Message.Show("Erreur au chargement de la demande", "Demande"); } }
public void EnregistrerDemande(CsDemande _LaDemande) { _LaDemande.Branchement.NUMDEM = string.IsNullOrEmpty(_LaDemande.LaDemande.NUMDEM) ? string.Empty : _LaDemande.LaDemande.NUMDEM; _LaDemande.Branchement.FK_IDCENTRE = _LaDemande.LaDemande.FK_IDCENTRE; _LaDemande.Branchement.FK_IDPRODUIT = _LaDemande.LaDemande.FK_IDPRODUIT.Value; _LaDemande.Branchement.CENTRE = string.IsNullOrEmpty(_LaDemande.LaDemande.CENTRE) ? string.Empty : _LaDemande.LaDemande.CENTRE; _LaDemande.Branchement.CLIENT = string.IsNullOrEmpty(_LaDemande.LaDemande.CLIENT) ? string.Empty : _LaDemande.LaDemande.CLIENT; _LaDemande.Branchement.PRODUIT = string.IsNullOrEmpty(_LaDemande.LaDemande.PRODUIT) ? string.Empty : _LaDemande.LaDemande.PRODUIT; _LaDemande.Branchement.FK_IDTYPEBRANCHEMENT = this.Txt_CodeDiametre.Tag == null ? _LaDemande.Branchement.FK_IDTYPEBRANCHEMENT : int.Parse(this.Txt_CodeDiametre.Tag.ToString()); _LaDemande.Branchement.DIAMBRT = string.IsNullOrEmpty(this.Txt_CodeDiametre.Text) ? null : this.Txt_CodeDiametre.Text; //_LaDemande.Branchement.FK_IDNATBR = this.Txt_CodeMateriel.Tag == null ? _LaDemande.Branchement.FK_IDNATBR : int.Parse(this.Txt_CodeMateriel.Tag.ToString()); _LaDemande.Branchement.NATBRT = string.IsNullOrEmpty(this.Txt_CodeMateriel.Text) ? "1" : this.Txt_CodeMateriel.Text; _LaDemande.Branchement.LONGBRT = string.IsNullOrEmpty(this.Txt_LongueurBrt.Text) ? 0 : Convert.ToDecimal(this.Txt_LongueurBrt.Text); _LaDemande.Branchement.NBPOINT = string.IsNullOrEmpty(this.Txt_NombrePoint.Text) ? 1 : int.Parse(this.Txt_NombrePoint.Text); _LaDemande.Branchement.RESEAU = string.IsNullOrEmpty(this.Txt_Reseau.Text) ? null : this.Txt_Reseau.Text; _LaDemande.Branchement.ADRESSERESEAU = string.IsNullOrEmpty(this.Txt_AdresseElectrique.Text) ? null : this.Txt_AdresseElectrique.Text; _LaDemande.Branchement.LONGITUDE = string.IsNullOrEmpty(this.Txt_Longitude.Text) ? null : this.Txt_Longitude.Text; _LaDemande.Branchement.LATITUDE = string.IsNullOrEmpty(this.Txt_Latitude.Text) ? null : this.Txt_Latitude.Text; _LaDemande.Branchement.TOURNEE = (LaDemande.Ag == null) ? string.Empty : (LaDemande.Ag.TOURNEE == null ? string.Empty : LaDemande.Ag.TOURNEE); _LaDemande.Branchement.FK_IDTOURNEE = (LaDemande.Ag == null) ? 0 : (LaDemande.Ag.FK_IDTOURNEE == 0 ? 0 : LaDemande.Ag.FK_IDTOURNEE.Value); _LaDemande.Branchement.ORDTOUR = (LaDemande.Ag == null) ? string.Empty : (LaDemande.Ag.ORDTOUR == null ? string.Empty : LaDemande.Ag.ORDTOUR); _LaDemande.Branchement.FK_IDAG = (LaDemande.Ag == null) ? 0 : (LaDemande.Ag.PK_ID == null ? 0 : LaDemande.Ag.PK_ID); _LaDemande.Branchement.DRAC = null; _LaDemande.Branchement.USERCREATION = UserConnecte.matricule; _LaDemande.Branchement.USERMODIFICATION = UserConnecte.matricule; _LaDemande.Branchement.DATECREATION = System.DateTime.Now; _LaDemande.Branchement.DATEMODIFICATION = System.DateTime.Now; if (!string.IsNullOrEmpty(this.Txt_DateRacordement.Text)) { _LaDemande.Branchement.DRAC = DateTime.Parse(this.Txt_DateRacordement.Text); } _LaDemande.Branchement.DRES = null; if (!string.IsNullOrEmpty(this.Txt_DateDepose.Text) && this.Txt_DateDepose.Text.Length == SessionObject.Enumere.TailleDate) { try { _LaDemande.Branchement.DRES = DateTime.Parse(this.Txt_DateDepose.Text); } catch { } } if (_LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.BranchementAbonement || _LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.BranchementSimple) { _LaDemande.Branchement.SERVICE = SessionObject.Enumere.CompteurActifValeur; } if (_LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.ReouvertureBrt) { BranchementClientRecherche.DRES = null; } if (_LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.FermetureBrt) { _LaDemande.Branchement.SERVICE = SessionObject.Enumere.CompteurInactifValeur; } //} //return returneValeur; //_LaDemande. }
void galatee_OkClickedClient(object sender, EventArgs e) { UcDetailClient ctrs = sender as UcDetailClient; LaDemande = ctrs.LaDemande; }
public void EnregisterDemande(CsDemande _LaDemande) { try { _LaDemande.Ag.NOMP = string.IsNullOrEmpty(this.Txt_NomClient.Text) ? null : this.Txt_NomClient.Text; _LaDemande.Ag.COMMUNE = string.IsNullOrEmpty(this.Txt_CodeCommune.Text) ? null : this.Txt_CodeCommune.Text; _LaDemande.Ag.QUARTIER = string.IsNullOrEmpty(this.Txt_CodeQuartier.Text) ? null : this.Txt_CodeQuartier.Text; _LaDemande.Ag.SECTEUR = string.IsNullOrEmpty(this.Txt_CodeSecteur.Text) ? null : this.Txt_CodeSecteur.Text; _LaDemande.Ag.RUE = string.IsNullOrEmpty(this.Txt_CodeNomRue.Text) ? null : this.Txt_CodeNomRue.Text; _LaDemande.Ag.PORTE = string.IsNullOrEmpty(this.Txt_Porte.Text) ? null : this.Txt_Porte.Text; _LaDemande.Ag.TOURNEE = string.IsNullOrEmpty(this.Txt_Tournee.Text) ? null : this.Txt_Tournee.Text; _LaDemande.Ag.ORDTOUR = string.IsNullOrEmpty(this.Txt_OrdreTour.Text) ? null : this.Txt_OrdreTour.Text; _LaDemande.Ag.ETAGE = string.IsNullOrEmpty(this.Txt_Etage.Text) ? null : this.Txt_Etage.Text; _LaDemande.Ag.USERCREATION = UserConnecte.matricule; _LaDemande.Ag.USERMODIFICATION = UserConnecte.matricule; _LaDemande.Ag.DATECREATION = System.DateTime.Now; _LaDemande.Ag.DATEMODIFICATION = System.DateTime.Now; _LaDemande.Ag.FK_IDCOMMUNE = _LaDemande.Ag.FK_IDCOMMUNE; _LaDemande.Ag.FK_IDSECTEUR = Txt_CodeSecteur.Tag == null ? null : (int?)Txt_CodeSecteur.Tag; _LaDemande.Ag.FK_IDQUARTIER = Txt_CodeQuartier.Tag == null ? null : (int?)Txt_CodeQuartier.Tag; _LaDemande.Ag.FK_IDRUE = Txt_CodeNomRue.Tag == null ? null : (int?)Txt_CodeNomRue.Tag; _LaDemande.Ag.FK_IDTOURNEE = this.Txt_Tournee.Tag == null ? null : (int?)this.Txt_Tournee.Tag; if (_LaDemande.LaDemande == null) { _LaDemande.LaDemande = new CsDemandeBase(); } _LaDemande.LaDemande.MATRICULE = UserConnecte.matricule; _LaDemande.LaDemande.CENTRE = _LaDemande.Ag.CENTRE; _LaDemande.LaDemande.CLIENT = _LaDemande.Ag.CLIENT; _LaDemande.LaDemande.ORDRE = _LaDemande.LeClient != null ? _LaDemande.LeClient.ORDRE : _LaDemande.LaDemande.ORDRE; _LaDemande.LaDemande.STATUT = SessionObject.Enumere.DemandeStatusEnAttente; _LaDemande.LaDemande.TYPEDEMANDE = Tdem; _LaDemande.LaDemande.FK_IDTYPEDEMANDE = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem) != null?SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem).PK_ID : 0; _LaDemande.LaDemande.FK_IDCENTRE = (int)txtCentre.Tag; _LaDemande.LaDemande.MOTIF = string.IsNullOrEmpty(this.Txt_Motif.Text) ? null : this.Txt_Motif.Text; _LaDemande.LaDemande.USERCREATION = UserConnecte.matricule; _LaDemande.LaDemande.USERMODIFICATION = UserConnecte.matricule; _LaDemande.LaDemande.DATECREATION = System.DateTime.Now; _LaDemande.LaDemande.DATEMODIFICATION = System.DateTime.Now; _LaDemande.LaDemande.ISDEMANDEREJETERINIT = false; _LaDemande.LaDemande.FK_IDPRODUIT = (_LaDemande.Abonne != null && _LaDemande.Abonne.FK_IDPRODUIT != null) ? _LaDemande.Abonne.FK_IDPRODUIT : _LaDemande.LaDemande.FK_IDPRODUIT; _LaDemande.LaDemande.PRODUIT = (_LaDemande.Abonne != null && _LaDemande.Abonne.PRODUIT != null) ? _LaDemande.Abonne.PRODUIT : _LaDemande.LaDemande.PRODUIT; #region Doc Scanne if (_LaDemande.ObjetScanne == null) { _LaDemande.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } if (LstPiece.Count != 0) { _LaDemande.ObjetScanne.AddRange(LstPiece); } #endregion _LaDemande.Abonne = null; _LaDemande.Branchement = null; _LaDemande.LstCanalistion = null; _LaDemande.LstEvenement = null; ValidationDemande(_LaDemande); } catch (Exception) { Message.ShowError("Erreur à la récuperation des données", "erreur"); } }
private void ValiderInitialisation(CsDemande demandedevis, bool IsTransmetre) { try { if (this.Rdb_Etalonnage.IsChecked == false && this.rdb_Changement.IsChecked == false) { Message.ShowInformation("Veuillez saisir le resulat de la verification", "Demande"); return; } demandedevis = GetDemandeDevisFromScreen(demandedevis, false); if (demandedevis != null) { if (IsTransmetre) { demandedevis.LaDemande.ETAPEDEMANDE = null; } demandedevis.LaDemande.MATRICULE = UserConnecte.matricule; demandedevis.LaDemande.CENTRE = laDetailDemande.LaDemande.CENTRE; demandedevis.LaDemande.FK_IDCENTRE = laDetailDemande.LaDemande.FK_IDCENTRE; demandedevis.LaDemande.ISCHANGECOMPTEUR = this.rdb_Changement.IsChecked.Value; demandedevis.LaDemande.ISETALONNAGE = this.Rdb_Etalonnage.IsChecked.Value; //if (this.rdb_Changement.IsChecked == true) //{ //demandedevis.Abonne = null; //demandedevis.Branchement = null; //demandedevis.Ag = null; demandedevis.LaDemande.NUMDEM = string.Empty; demandedevis.LaDemande.PK_ID = 0; AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.ValiderDemandeInitailisationCompleted += (ss, b) => { this.OKButton.IsEnabled = true; if (b.Cancelled || b.Error != null) { string error = b.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } CsTdem letype = new CsTdem(); if (this.rdb_Changement.IsChecked == true) { letype = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == SessionObject.Enumere.ChangementCompteur); } else if (this.Rdb_Etalonnage.IsChecked == true) { letype = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == SessionObject.Enumere.Etalonage); } List <string> codes = new List <string>(); codes.Add(laDetailDemande.InfoDemande.CODE); Galatee.Silverlight.Shared.ClasseMEthodeGenerique.TransmettreDemande(codes, true, this); string Retour = b.Result; string[] coupe = Retour.Split('.'); Shared.ClasseMEthodeGenerique.InitWOrkflow(coupe[0], demandedevis.LaDemande.FK_IDCENTRE, coupe[1], letype.PK_ID); }; client.ValiderDemandeInitailisationAsync(demandedevis); //} //else //{ // demandedevis.LeClient = null; // demandedevis.Abonne = null; // demandedevis.Branchement = null; // demandedevis.Ag = null; // AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); // client.ValiderDemandeInitailisationCompleted += (ss, b) => // { // if (b.Cancelled || b.Error != null) // { // string error = b.Error.Message; // Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); // return; // } // List<string> codes = new List<string>(); // codes.Add(laDetailDemande.InfoDemande.CODE); // Galatee.Silverlight.Shared.ClasseMEthodeGenerique.TransmettreDemande(codes, true, this); // List<CsUtilisateur> leUser = new List<CsUtilisateur>(); // if (laDetailDemande.InfoDemande != null && laDetailDemande.InfoDemande.CODE != null) // { // foreach (CsUtilisateur item in laDetailDemande.InfoDemande.UtilisateurEtapeSuivante) // leUser.Add(item); // Shared.ClasseMEthodeGenerique.NotifierMailDemande(leUser, "0001", laDetailDemande.LaDemande.NUMDEM, laDetailDemande.LaDemande.LIBELLETYPEDEMANDE); // } // }; // client.ValiderDemandeInitailisationAsync(demandedevis); //} } } catch (Exception ex) { Message.ShowError("Une erreur est survenu suite à la validation", "Validation demande"); } }
private void RemplirListeMateriel(CsDemande lademande) { List <ObjELEMENTDEVIS> lstEltDevis = lademande.EltDevis; List <ObjELEMENTDEVIS> lstFourgenerale = new List <ObjELEMENTDEVIS>(); if (lstEltDevis.Count != 0) { lstEltDevis.ForEach(p => p.RUBRIQUE = string.Empty); List <ObjELEMENTDEVIS> lstFourExtension = new List <ObjELEMENTDEVIS>(); List <ObjELEMENTDEVIS> lstFourBranchement = new List <ObjELEMENTDEVIS>(); lstFourExtension = lstEltDevis.Where(t => t.ISEXTENSION == true).ToList(); lstFourBranchement = lstEltDevis.Where(t => t.ISEXTENSION == false).ToList(); foreach (ObjELEMENTDEVIS item in lstFourExtension) { if (item.ISPOSE && !item.ISFOURNITURE) { item.RUBRIQUE = "Pose"; } if (item.ISPOSE && item.ISFOURNITURE) { item.RUBRIQUE = "Fourniture / Pose"; } if (item.ISPRESTATION) { item.RUBRIQUE = "Prestation"; } } ObjELEMENTDEVIS leSeparateur = new ObjELEMENTDEVIS(); leSeparateur.DESIGNATION = "----------------------------------"; if (lstFourBranchement.Count != 0) { ObjELEMENTDEVIS leResultatBranchanchement = new ObjELEMENTDEVIS(); leResultatBranchanchement.DESIGNATION = "TOTAL BRANCHEMENT "; leResultatBranchanchement.IsCOLORIE = true; leResultatBranchanchement.MONTANTHT = lstEltDevis.Where(t => t.ISEXTENSION == false).Sum(t => t.MONTANTHT); leResultatBranchanchement.MONTANTTAXE = lstEltDevis.Where(t => t.ISEXTENSION == false).Sum(t => t.MONTANTTAXE); leResultatBranchanchement.MONTANTTTC = lstEltDevis.Where(t => t.ISEXTENSION == false).Sum(t => t.MONTANTTTC); lstFourgenerale.AddRange(lstFourBranchement); lstFourgenerale.Add(leSeparateur); lstFourgenerale.Add(leResultatBranchanchement); lstFourgenerale.Add(new ObjELEMENTDEVIS() { DESIGNATION = " " }); } if (lstFourExtension.Count != 0) { ObjELEMENTDEVIS leResultatExtension = new ObjELEMENTDEVIS(); leResultatExtension.DESIGNATION = "TOTAL EXTENSION "; leResultatExtension.IsCOLORIE = true; leResultatExtension.MONTANTHT = lstEltDevis.Where(t => t.ISEXTENSION == true).Sum(t => t.MONTANTHT); leResultatExtension.MONTANTTAXE = lstEltDevis.Where(t => t.ISEXTENSION == true).Sum(t => t.MONTANTTAXE); leResultatExtension.MONTANTTTC = lstEltDevis.Where(t => t.ISEXTENSION == true).Sum(t => t.MONTANTTTC); lstFourgenerale.AddRange(lstFourExtension); lstFourgenerale.Add(leSeparateur); lstFourgenerale.Add(leResultatExtension); lstFourgenerale.Add(new ObjELEMENTDEVIS() { DESIGNATION = " " }); } if (lstFourBranchement.Count != 0 || lstFourExtension.Count != 0) { ObjELEMENTDEVIS leResultatGeneral = new ObjELEMENTDEVIS(); leResultatGeneral.DESIGNATION = "TOTAL GENERAL "; leResultatGeneral.IsCOLORIE = true; leResultatGeneral.MONTANTHT = lstEltDevis.Sum(t => t.MONTANTHT); leResultatGeneral.MONTANTTAXE = lstEltDevis.Sum(t => t.MONTANTTAXE); leResultatGeneral.MONTANTTTC = lstEltDevis.Sum(t => t.MONTANTTTC); lstFourgenerale.Add(leSeparateur); lstFourgenerale.Add(leResultatGeneral); } } this.dataGridForniture.ItemsSource = null; this.dataGridForniture.ItemsSource = lstFourgenerale; this.Txt_TotalHt.Text = lademande.EltDevis.Where(p => p.QUANTITE != null && p.QUANTITE != 0).ToList().Sum(t => t.MONTANTHT).Value.ToString(SessionObject.FormatMontant); this.Txt_TotalTtc.Text = lademande.EltDevis.Where(p => p.QUANTITE != null && p.QUANTITE != 0).ToList().Sum(t => t.MONTANTTTC).Value.ToString(SessionObject.FormatMontant); this.Txt_TotalTva.Text = lademande.EltDevis.Where(p => p.QUANTITE != null && p.QUANTITE != 0).ToList().Sum(t => t.MONTANTTAXE).Value.ToString(SessionObject.FormatMontant); }
private void ValidationDemande(CsDemande _Lademande) { try { foreach (var item in _Lademande.LstCanalistion) { item.ANNEEFAB = string.IsNullOrEmpty(this.Txt_AnneeFab.Text) ? string.Empty : this.Txt_AnneeFab.Text; item.CADRAN = string.IsNullOrEmpty(this.Txt_CodeCadran.Text) ? Convert.ToByte(6) : Convert.ToByte(this.Txt_CodeCadran.Text); item.NUMERO = string.IsNullOrEmpty(this.Txt_NumCompteur.Text) ? string.Empty : this.Txt_NumCompteur.Text; item.MARQUE = string.IsNullOrEmpty(this.Txt_CodeMarque.Text) ? string.Empty : this.Txt_CodeMarque.Text; item.TYPECOMPTEUR = string.IsNullOrEmpty(this.Txt_CodeTypeCompteur.Text) ? string.Empty : this.Txt_CodeTypeCompteur.Text; item.FK_IDCALIBRE = null; if (this.Txt_LibelleDiametre.Tag != null) { item.FK_IDCALIBRE = (int)this.Txt_LibelleDiametre.Tag; } item.FK_IDMARQUECOMPTEUR = (int)this.Txt_CodeMarque.Tag; item.FK_IDTYPECOMPTEUR = (int)this.Txt_CodeTypeCompteur.Tag; item.USERCREATION = UserConnecte.matricule; item.USERMODIFICATION = UserConnecte.matricule; item.DATECREATION = System.DateTime.Now; item.DATEMODIFICATION = System.DateTime.Now; } if (_Lademande.LaDemande == null) { _Lademande.LaDemande = new CsDemandeBase(); } _Lademande.LaDemande.MATRICULE = UserConnecte.matricule; _Lademande.LaDemande.CENTRE = _Lademande.Abonne != null ? _Lademande.Abonne.CENTRE:_Lademande.LaDemande.CENTRE; _Lademande.LaDemande.CLIENT = _Lademande.Abonne != null ? _Lademande.Abonne.CLIENT : _Lademande.LaDemande.CLIENT; _Lademande.LaDemande.ORDRE = _Lademande.Abonne != null ? _Lademande.Abonne.ORDRE : _Lademande.LaDemande.ORDRE; _Lademande.LaDemande.PRODUIT = _Lademande.Abonne != null ? _Lademande.Abonne.PRODUIT : _Lademande.LaDemande.PRODUIT; _Lademande.LaDemande.STATUT = SessionObject.Enumere.DemandeStatusEnAttente; _Lademande.LaDemande.TYPEDEMANDE = Tdem; _Lademande.LaDemande.FK_IDTYPEDEMANDE = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem) != null?SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem).PK_ID : 0; _Lademande.LaDemande.FK_IDCENTRE = (int)txtCentre.Tag; _Lademande.LaDemande.FK_IDPRODUIT = (int)txt_Produit.Tag; _Lademande.LaDemande.USERCREATION = UserConnecte.matricule; _Lademande.LaDemande.USERMODIFICATION = UserConnecte.matricule; _Lademande.LaDemande.DATECREATION = System.DateTime.Now; _Lademande.LaDemande.DATEMODIFICATION = System.DateTime.Now; _Lademande.LaDemande.ISDEMANDEREJETERINIT = false; _Lademande.LaDemande.MOTIF = string.IsNullOrEmpty(this.Txt_Motif.Text) ? string.Empty : this.Txt_Motif.Text; #region Doc Scanne if (_Lademande.ObjetScanne == null) { _Lademande.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } if (LstPiece.Count != 0) { _Lademande.ObjetScanne.AddRange(LstPiece); } #endregion _Lademande.Abonne = null; _Lademande.Branchement = null; _Lademande.LeClient = null; _Lademande.LstEvenement = null; _Lademande.EltDevis = null; _Lademande.OrdreTravail = null; _Lademande.Ag = null; //Lancer la transaction de mise a jour en base AcceuilServiceClient service1 = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service1.ValiderDemandeInitailisationAsync(_Lademande); service1.ValiderDemandeInitailisationCompleted += (sr, res) => { if (!string.IsNullOrEmpty(res.Result)) { if (!IsRejeterDemande) { string Retour = res.Result; string[] coupe = Retour.Split('.'); Shared.ClasseMEthodeGenerique.InitWOrkflow(coupe[0], _Lademande.LaDemande.FK_IDCENTRE, coupe[1], _Lademande.LaDemande.FK_IDTYPEDEMANDE); } else { List <string> codes = new List <string>(); codes.Add(laDetailDemande.InfoDemande.CODE); ClasseMEthodeGenerique.TransmettreDemande(codes, true, this); //List<CsUtilisateur> leUser = new List<CsUtilisateur>(); //if (laDetailDemande.InfoDemande != null && laDetailDemande.InfoDemande.CODE != null) //{ // foreach (CsUtilisateur item in laDetailDemande.InfoDemande.UtilisateurEtapeSuivante) // leUser.Add(item); // Shared.ClasseMEthodeGenerique.NotifierMailDemande(leUser, "0001", laDetailDemande.LaDemande.NUMDEM, laDetailDemande.LaDemande.LIBELLETYPEDEMANDE); //} } } if (Closed != null) { Closed(this, new EventArgs()); } this.DialogResult = false; }; service1.CloseAsync(); } catch (Exception ex) { throw ex; } }
public UcListeDesignation(List <ObjELEMENTDEVIS> _ListeFourniture, List <ObjELEMENTDEVIS> lstEltsSelect, CsDemande laDemande) { InitializeComponent(); Chk_Extension.Visibility = System.Windows.Visibility.Collapsed; MaDemande = laDemande; if (MaDemande.LaDemande.ISEXTENSION == true) { Chk_Extension.Visibility = System.Windows.Visibility.Visible; } ListeFourniture = _ListeFourniture; foreach (ObjELEMENTDEVIS item in ListeFourniture) { if (item.COUTUNITAIRE_FOURNITURE == null) { item.COUTUNITAIRE_FOURNITURE = 0; } if (item.COUTUNITAIRE_POSE == null) { item.COUTUNITAIRE_POSE = 0; } } foreach (ObjELEMENTDEVIS item in lstEltsSelect) { if (item.COUTUNITAIRE_FOURNITURE == null) { item.COUTUNITAIRE_FOURNITURE = 0; } if (item.COUTUNITAIRE_POSE == null) { item.COUTUNITAIRE_POSE = 0; } } Devis = SessionObject.LstDesCoutDemande.FirstOrDefault(t => t.COPER == SessionObject.Enumere.CoperTRV); if (Devis != null) { taxe = SessionObject.LstDesTaxe.FirstOrDefault(t => t.PK_ID == Devis.FK_IDTAXE); } List <int> lstIdFournDevis = new List <int>(); if (lstEltsSelect == null) { lstEltsSelect = new List <ObjELEMENTDEVIS>(); } MyElements = lstEltsSelect; foreach (ObjELEMENTDEVIS item in lstEltsSelect.Where(t => t.FK_IDMATERIELDEVIS != null)) { lstIdFournDevis.Add(item.FK_IDMATERIELDEVIS.Value); } dataGridElementDevisFinal.ItemsSource = null; dataGridElementDevisFinal.ItemsSource = lstEltsSelect; this.Txt_TotalHt.Text = lstEltsSelect.Where(p => p.QUANTITE != null && p.QUANTITE != 0).ToList().Sum(t => t.MONTANTHT).Value.ToString(SessionObject.FormatMontant); this.Txt_TotalTtc.Text = lstEltsSelect.Where(p => p.QUANTITE != null && p.QUANTITE != 0).ToList().Sum(t => t.MONTANTTTC).Value.ToString(SessionObject.FormatMontant); this.Txt_TotalTva.Text = lstEltsSelect.Where(p => p.QUANTITE != null && p.QUANTITE != 0).ToList().Sum(t => t.MONTANTTAXE).Value.ToString(SessionObject.FormatMontant); RemplirListe(ListeFourniture.Where(t => !lstIdFournDevis.Contains(t.PK_ID)).ToList()); ChargerTypeMateriel(); }
private CsDemande GetDemandeDevisFromScreen(CsDemande pDemandeDevis, bool isTransmettre) { try { if (pDemandeDevis == null) { pDemandeDevis = new CsDemande(); pDemandeDevis.LaDemande = new CsDemandeBase(); pDemandeDevis.Abonne = new CsAbon(); pDemandeDevis.Ag = new CsAg(); pDemandeDevis.Branchement = new CsBrt(); pDemandeDevis.LeClient = new CsClient(); pDemandeDevis.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); pDemandeDevis.AppareilDevis = new List <ObjAPPAREILSDEVIS>(); pDemandeDevis.LaDemande.DATECREATION = DateTime.Now; pDemandeDevis.LaDemande.USERCREATION = UserConnecte.matricule; pDemandeDevis.LaDemande.FK_IDADMUTILISATEUR = UserConnecte.PK_ID; } #region Demande if (pDemandeDevis.LaDemande == null) { pDemandeDevis.LaDemande = new CsDemandeBase(); } if (pDemandeDevis.LaDemande.TYPEDEMANDE != SessionObject.Enumere.BranchementAbonement) { pDemandeDevis.LaDemande.CLIENT = string.IsNullOrEmpty(this.txt_Ref_Branchement.Text) ? string.Empty : this.txt_Ref_Branchement.Text; } pDemandeDevis.LaDemande.DATEMODIFICATION = DateTime.Now; //pDemandeDevis.LaDemande.MOTIF = txt_Motif.Text; pDemandeDevis.LaDemande.FK_IDTYPEDEMANDE = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == SessionObject.Enumere.TransfertAbonnement).PK_ID; pDemandeDevis.LaDemande.TYPEDEMANDE = SessionObject.Enumere.TransfertAbonnement; #region Doc Scanne if (pDemandeDevis.ObjetScanne == null) { pDemandeDevis.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } #region Doc Scanne if (pDemandeDevis.ObjetScanne == null) { laDetailDemande.ObjetScanne = new List <ObjDOCUMENTSCANNE>(); } if (ctrl != null && ctrl.LstPiece != null) { pDemandeDevis.ObjetScanne.Clear(); pDemandeDevis.ObjetScanne.AddRange(ctrl.LstPiece.Where(i => i.ISNEW == true || i.ISTOREMOVE == true)); //foreach (Galatee.Silverlight.Accueil.CsDocumentScan item in ctrl.LstPieceSave) // Classes.SaveDocument.SaveDoc(item.ObjScanne, SessionObject.CheminImpression, laDetailDemande.LaDemande.NUMDEM + item.TypeDocument, "jpeg"); } #endregion #endregion #endregion pDemandeDevis.LaDemande.ISNEW = true; pDemandeDevis.LaDemande.ORDRE = laDetailDemande.LeClient.ORDRE; pDemandeDevis.LaDemande.DATECREATION = DateTime.Now; pDemandeDevis.LaDemande.PRODUIT = laDetailDemande.Abonne.PRODUIT; pDemandeDevis.LaDemande.FK_IDPRODUIT = laDetailDemande.Abonne.FK_IDPRODUIT; pDemandeDevis.LaDemande.CENTRE = laDetailDemande.Abonne.CENTRE; pDemandeDevis.LaDemande.FK_IDCENTRE = laDetailDemande.Abonne.FK_IDCENTRE; return(pDemandeDevis); } catch (Exception ex) { throw ex; } }
public UcMaterielsConsomme(CsDemande pDevis) { InitializeComponent(); mydevis = pDevis; }
private void ChargeDetailDEvis(CsClient leclient) { try { leclient.TYPEDEMANDE = Tdem; Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.ChargerDetailClientCompleted += (ssender, args) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; if (args.Cancelled || args.Error != null) { string error = args.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } if (args.Result == null) { Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis); return; } else { laDetailDemande = new CsDemande(); laDetailDemande = args.Result; if (laDetailDemande.Abonne != null && laDetailDemande.Abonne.DRES == null) { this.txtSite.Text = string.IsNullOrEmpty(laDetailDemande.LeClient.LIBELLESITE) ? string.Empty : laDetailDemande.LeClient.LIBELLESITE; this.txtCentre.Text = string.IsNullOrEmpty(laDetailDemande.LeClient.LIBELLECENTRE) ? string.Empty : laDetailDemande.LeClient.LIBELLECENTRE; this.txt_Produit.Text = string.IsNullOrEmpty(laDetailDemande.Abonne.LIBELLEPRODUIT) ? string.Empty : laDetailDemande.Abonne.LIBELLEPRODUIT; this.txt_Produit.Tag = laDetailDemande.Abonne.FK_IDPRODUIT; this.txtCentre.Tag = laDetailDemande.Abonne.FK_IDCENTRE; CodeProduit = laDetailDemande.Abonne.PRODUIT; this.txt_tdem.Text = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem).LIBELLE; txt_tdem.Tag = SessionObject.LstTypeDemande.FirstOrDefault(t => t.CODE == Tdem); if (laDetailDemande.LstCanalistion != null && laDetailDemande.LstCanalistion.Count != 0) { if (laDetailDemande.Abonne.PRODUIT == SessionObject.Enumere.ElectriciteMT) { this.btn_DiametreCompteur.IsEnabled = false; this.Txt_LibelleDiametre.IsEnabled = false; laDetailDemande.LstCanalistion.First().NUMERO = laDetailDemande.LstCanalistion.First().NUMERO.Substring(5, (laDetailDemande.LstCanalistion.First().NUMERO.Length - 5)); } AfficherCannalisationDemande(laDetailDemande.LstCanalistion.First()); AfficherDocumentScanne(laDetailDemande.ObjetScanne); } } else { Message.ShowInformation("Ce abonné est résilié", "Info"); return; } } }; client.ChargerDetailClientAsync(leclient); } catch (Exception ex) { prgBar.Visibility = System.Windows.Visibility.Collapsed; Message.ShowError("Erreur au chargement des donnéés", "Demande"); } }
private void AfficherInfoAbonnement(CsDemande _NouvelDemande, CsDemande _LeAncdemande) { try { CsAbon _LeAbonnementdemande = _LeAncdemande.Abonne; CsAbon _NouvelInfoAbon = _NouvelDemande.Abonne; this.Txt_CodeCentre.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.CENTRE) ? string.Empty : laDetailDemande.LaDemande.CENTRE; this.Txt_LibelleCentre.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.LIBELLECENTRE) ? string.Empty : laDetailDemande.LaDemande.LIBELLECENTRE; this.Txt_CodeProduit.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.PRODUIT) ? string.Empty : laDetailDemande.LaDemande.PRODUIT; this.Txt_LibelleProduit.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.LIBELLEPRODUIT) ? string.Empty : laDetailDemande.LaDemande.LIBELLEPRODUIT; this.Txt_NumDemande.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.NUMDEM) ? string.Empty : laDetailDemande.LaDemande.NUMDEM; this.Txt_Client.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.CLIENT) ? string.Empty : laDetailDemande.LaDemande.CLIENT; this.Txt_Ordre.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.ORDRE) ? string.Empty : laDetailDemande.LaDemande.ORDRE; if (_LeAbonnementdemande != null) { if (_LeAbonnementdemande.PUISSANCE != null) { this.Txt_CodePussanceSoucrite.Text = Convert.ToDecimal(_LeAbonnementdemande.PUISSANCE.ToString()).ToString("N2"); } if (_LeAncdemande.Branchement != null && _LeAncdemande.Branchement.PUISSANCEINSTALLEE != null) { this.Txt_CodePuissanceUtilise.Text = Convert.ToDecimal(_LeAncdemande.Branchement.PUISSANCEINSTALLEE).ToString("N2"); } this.Txt_CodeForfait.Text = string.IsNullOrEmpty(_LeAbonnementdemande.FORFAIT) ? string.Empty : _LeAbonnementdemande.FORFAIT; this.Txt_LibelleForfait.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLEFORFAIT) ? string.Empty : _LeAbonnementdemande.LIBELLEFORFAIT; this.Txt_CodeTarif.Text = string.IsNullOrEmpty(_LeAbonnementdemande.TYPETARIF) ? string.Empty : _LeAbonnementdemande.TYPETARIF; this.Txt_LibelleTarif.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLETARIF) ? string.Empty : _LeAbonnementdemande.LIBELLETARIF; this.Txt_CodeFrequence.Text = string.IsNullOrEmpty(_LeAbonnementdemande.PERFAC) ? string.Empty : _LeAbonnementdemande.PERFAC; this.Txt_LibelleFrequence.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLEFREQUENCE) ? string.Empty : _LeAbonnementdemande.LIBELLEFREQUENCE; this.Txt_CodeMoisFacturation.Text = string.IsNullOrEmpty(_LeAbonnementdemande.MOISFAC) ? string.Empty : _LeAbonnementdemande.MOISFAC; this.Txt_LibMoisFact.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLEMOISFACT) ? string.Empty : _LeAbonnementdemande.LIBELLEMOISFACT; this.Txt_DateAbonnement.Text = (_LeAbonnementdemande.DABONNEMENT == null) ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DABONNEMENT.Value).ToShortDateString(); this.Txt_DateResiliation.Text = (_LeAbonnementdemande.DRES == null) ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DRES.Value).ToShortDateString(); this.txt_DebutPeriodeExo.Text = string.IsNullOrEmpty(_LeAbonnementdemande.DEBUTEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_LeAbonnementdemande.DEBUTEXONERATIONTVA); this.txt_FinPeriodeExo.Text = string.IsNullOrEmpty(_LeAbonnementdemande.FINEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_LeAbonnementdemande.FINEXONERATIONTVA); this.chk_EstBornePoste.IsChecked = (_LeAbonnementdemande.ISBORNEPOSTE != null && _LeAbonnementdemande.ISBORNEPOSTE.Value) ? true : false; this.Txt_AvanceSurConso.Text = _LeAbonnementdemande.AVANCE == null ? "0" : Convert.ToDecimal(_LeAbonnementdemande.AVANCE.Value).ToString(SessionObject.FormatMontant); this.Txt_TypeComptage.Text = string.IsNullOrEmpty(_LeAbonnementdemande.LIBELLETYPECOMPTAGE) ? string.Empty : _LeAbonnementdemande.LIBELLETYPECOMPTAGE; if (_LeAncdemande.LeClient != null) { this.Txt_AncCodeCategorie.Text = string.IsNullOrEmpty(_LeAncdemande.LeClient.CATEGORIE) ? string.Empty : _LeAncdemande.LeClient.CATEGORIE; this.Txt_AncLibelleCategorie.Text = string.IsNullOrEmpty(_LeAncdemande.LeClient.LIBELLECATEGORIE) ? string.Empty : _LeAncdemande.LeClient.LIBELLECATEGORIE; } } if (_NouvelInfoAbon != null) { if (_NouvelInfoAbon.PUISSANCE != null) { this.Txt_NouvCodePussanceSoucrite.Text = Convert.ToDecimal(_NouvelInfoAbon.PUISSANCE.ToString()).ToString("N2"); } if (_NouvelDemande.Branchement != null && _NouvelDemande.Branchement.PUISSANCEINSTALLEE != null) { this.Txt_NouvCodePuissanceUtilise.Text = Convert.ToDecimal(_NouvelDemande.Branchement.PUISSANCEINSTALLEE).ToString("N2"); } this.Txt_NouvCodeForfait.Text = string.IsNullOrEmpty(_NouvelInfoAbon.FORFAIT) ? string.Empty : _NouvelInfoAbon.FORFAIT; this.Txt_NouvLibelleForfait.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLEFORFAIT) ? string.Empty : _NouvelInfoAbon.LIBELLEFORFAIT; this.Txt_NouvCodeTarif.Text = string.IsNullOrEmpty(_NouvelInfoAbon.TYPETARIF) ? string.Empty : _NouvelInfoAbon.TYPETARIF; this.Txt_NouvLibelleTarif.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLETARIF) ? string.Empty : _NouvelInfoAbon.LIBELLETARIF; this.Txt_NouvCodeFrequence.Text = string.IsNullOrEmpty(_NouvelInfoAbon.PERFAC) ? string.Empty : _NouvelInfoAbon.PERFAC; this.Txt_NouvLibelleFrequence.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLEFREQUENCE) ? string.Empty : _NouvelInfoAbon.LIBELLEFREQUENCE; this.Txt_NouvCodeMoisFacturation.Text = string.IsNullOrEmpty(_NouvelInfoAbon.MOISFAC) ? string.Empty : _NouvelInfoAbon.MOISFAC; this.Txt_NouvLibMoisFact.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLEMOISFACT) ? string.Empty : _NouvelInfoAbon.LIBELLEMOISFACT; this.txt_NouvelleDebutPeriodeExo.Text = string.IsNullOrEmpty(_NouvelInfoAbon.DEBUTEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_NouvelInfoAbon.DEBUTEXONERATIONTVA); this.txt_NouvelleFinPeriodeExo.Text = string.IsNullOrEmpty(_NouvelInfoAbon.FINEXONERATIONTVA) ? string.Empty : ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_NouvelInfoAbon.FINEXONERATIONTVA); this.chk_EstBornePoste.IsChecked = (_NouvelInfoAbon.ISBORNEPOSTE.Value) ? true : false; this.Txt_NouvDateAbonnement.Text = (_NouvelInfoAbon.DABONNEMENT == null) ? string.Empty : Convert.ToDateTime(_NouvelInfoAbon.DABONNEMENT.Value).ToShortDateString(); this.Txt_NouvDateResiliation.Text = (_NouvelInfoAbon.DRES == null) ? string.Empty : Convert.ToDateTime(_NouvelInfoAbon.DRES.Value).ToShortDateString(); this.Txt_NouvAvanceSurConso.Text = _NouvelInfoAbon.AVANCE == null ? "0" : Convert.ToDecimal(_NouvelInfoAbon.AVANCE.Value).ToString(SessionObject.FormatMontant); this.Txt_NouvTypeComptage.Text = string.IsNullOrEmpty(_NouvelInfoAbon.LIBELLETYPECOMPTAGE) ? string.Empty : _NouvelInfoAbon.LIBELLETYPECOMPTAGE; if (_NouvelDemande.LeClient != null) { this.Txt_Categorie.Text = string.IsNullOrEmpty(_NouvelDemande.LeClient.CATEGORIE) ? string.Empty : _NouvelDemande.LeClient.CATEGORIE; this.Txt_LibelleCategorie.Text = string.IsNullOrEmpty(_NouvelDemande.LeClient.LIBELLECATEGORIE) ? string.Empty : _NouvelDemande.LeClient.LIBELLECATEGORIE; } } if (laDetailDemande.ObjetScanne != null && laDetailDemande.ObjetScanne.Count != 0) { dgListePiece.ItemsSource = this.LstPiece; } if (this.Txt_NouvCodeTarif.Text != this.Txt_CodeTarif.Text) { this.Txt_NouvCodeTarif.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleTarif.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleTarif.FontStyle = FontStyles.Italic; this.Txt_NouvCodeTarif.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeForfait.Text != this.Txt_CodeForfait.Text) { this.Txt_NouvCodeForfait.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCodeForfait.FontWeight = FontWeights.ExtraBold; this.Txt_NouvCodeForfait.FontStyle = FontStyles.Italic; this.Txt_NouvLibelleTarif.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeFrequence.Text != this.Txt_CodeFrequence.Text) { this.Txt_NouvCodeFrequence.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleFrequence.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibelleFrequence.FontStyle = FontStyles.Italic; this.Txt_NouvCodeFrequence.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodeMoisFacturation.Text != this.Txt_CodeMoisFacturation.Text) { this.Txt_NouvCodeMoisFacturation.FontWeight = FontWeights.Bold; this.Txt_NouvCodeMoisFacturation.FontStyle = FontStyles.Italic; this.Txt_NouvLibMoisFact.FontWeight = FontWeights.ExtraBold; this.Txt_NouvLibMoisFact.FontStyle = FontStyles.Italic; } if (this.Txt_NouvDateAbonnement.Text != this.Txt_DateAbonnement.Text) { this.Txt_NouvDateAbonnement.FontWeight = FontWeights.Bold; this.Txt_NouvDateAbonnement.FontStyle = FontStyles.Italic; } if (this.Txt_NouvDateResiliation.Text != this.Txt_DateResiliation.Text) { this.Txt_NouvDateResiliation.FontWeight = FontWeights.Bold; this.Txt_NouvDateResiliation.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodePussanceSoucrite.Text != this.Txt_CodePussanceSoucrite.Text) { this.Txt_NouvCodePussanceSoucrite.FontWeight = FontWeights.Bold; this.Txt_NouvCodePussanceSoucrite.FontStyle = FontStyles.Italic; } if (this.Txt_NouvCodePuissanceUtilise.Text != this.Txt_CodePuissanceUtilise.Text) { this.Txt_NouvCodePuissanceUtilise.FontWeight = FontWeights.Bold; this.Txt_NouvCodePuissanceUtilise.FontStyle = FontStyles.Italic; } if (this.txt_NouvelleDebutPeriodeExo.Text != this.txt_DebutPeriodeExo.Text) { this.txt_NouvelleDebutPeriodeExo.FontWeight = FontWeights.Bold; this.txt_NouvelleDebutPeriodeExo.FontStyle = FontStyles.Italic; } if (this.txt_NouvelleFinPeriodeExo.Text != this.txt_FinPeriodeExo.Text) { this.txt_NouvelleFinPeriodeExo.FontWeight = FontWeights.Bold; this.txt_NouvelleFinPeriodeExo.FontStyle = FontStyles.Italic; } if (this.Txt_NouvAvanceSurConso.Text != this.Txt_AvanceSurConso.Text) { this.Txt_NouvAvanceSurConso.FontWeight = FontWeights.Bold; this.Txt_NouvAvanceSurConso.FontStyle = FontStyles.Italic; } if (this.Txt_NouvTypeComptage.Text != this.Txt_TypeComptage.Text) { this.Txt_NouvTypeComptage.FontWeight = FontWeights.Bold; this.Txt_NouvTypeComptage.FontStyle = FontStyles.Italic; } if (this.Txt_Categorie.Text != this.Txt_AncCodeCategorie.Text) { this.Txt_Categorie.FontWeight = FontWeights.Bold; this.Txt_Categorie.FontStyle = FontStyles.Italic; this.Txt_LibelleCategorie.FontWeight = FontWeights.Bold; this.Txt_LibelleCategorie.FontStyle = FontStyles.Italic; } if (this.chk_EstBornePoste.IsChecked != this.chk_EstBornePosteNew.IsChecked) { this.chk_EstBornePosteNew.FontWeight = FontWeights.Bold; this.chk_EstBornePosteNew.FontStyle = FontStyles.Italic; } } catch (Exception ex) { throw ex; } }
private void RemplirListeDevis(CsDemande laDemandedevis) { try { if (laDemandedevis.Branchement.LONGBRT != null && laDemandedevis.Branchement.LONGBRT > 0) { this.Txt_Distance.Text = DecToInt((decimal)laDemandedevis.Branchement.LONGBRT).ToString(); } Txt_NumDevis.Text = laDetailDemande.LaDemande.NUMDEM; Txt_TypeDevis.Text = laDetailDemande.LaDemande.LIBELLETYPEDEMANDE; AcceuilServiceClient Serviceclient = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); Serviceclient.SelectAllMaterielCompleted += (ss, bc) => { try { if (bc.Cancelled || bc.Error != null) { string error = bc.Error.Message; if (LayoutRoot != null) { LayoutRoot.Cursor = Cursors.Arrow; } Message.ShowError(error, Galatee.Silverlight.Resources.Devis.Languages.txtDevis); return; } if (bc.Result != null) { ListeFournitureExistante = bc.Result; if (laDemandedevis.EltDevis != null && laDetailDemande.EltDevis.Count != 0) { if (laDetailDemande.EltDevis.FirstOrDefault(t => t.ISFOURNITURE == true && t.FK_IDMATERIELDEVIS != null && t.FK_IDMATERIELDEVIS != 0) != null) { this.Rdb_Fourniture.IsChecked = true; } else if (laDetailDemande.EltDevis.FirstOrDefault(t => t.ISPRESTATION == true && t.FK_IDMATERIELDEVIS != null && t.FK_IDMATERIELDEVIS != 0) != null) { this.Rdb_Prestation.IsChecked = true; } if (laDetailDemande.EltDevis.FirstOrDefault(t => (t.ISPRESTATION == true || t.ISPRESTATION == true) && t.FK_IDMATERIELDEVIS != null && t.FK_IDMATERIELDEVIS != 0) == null) { foreach (var item in laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.FK_IDMATERIELDEVIS != null).ToList()) { item.ISFOURNITURE = true; } } lElements = Shared.ClasseMEthodeGenerique.RetourneListCopy <ObjELEMENTDEVIS>(laDetailDemande.EltDevis); ListeAutreCoutFixe = new List <ObjELEMENTDEVIS>(); ListeAutreCoutFixe = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS == 0 || t.FK_IDMATERIELDEVIS == null).ToList(); ListeAutreCoutFixe.ForEach(p => p.FK_IDRUBRIQUEDEVIS = SessionObject.LstRubriqueDevis.FirstOrDefault(t => t.CODE == SessionObject.Enumere.DEVISDEXTENSION).PK_ID); ListeAutreCoutFixe.ForEach(p => p.RUBRIQUE = SessionObject.Enumere.DEVISDEXTENSION); this.dataGridElementDevis.ItemsSource = null; this.dataGridElementDevis.ItemsSource = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.FK_IDMATERIELDEVIS != null && t.ISEXTENSION == true).ToList(); Txt_MontantTotalExtensionHT.Text = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.FK_IDMATERIELDEVIS != null && t.ISEXTENSION == true).Sum(p => p.MONTANTHT).Value.ToString(SessionObject.FormatMontant); Txt_MontantTotalExtensionTTC.Text = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.FK_IDMATERIELDEVIS != null && t.ISEXTENSION == true).Sum(p => p.MONTANTTTC).Value.ToString(SessionObject.FormatMontant); Txt_MontantTotalExtensionTaxe.Text = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.FK_IDMATERIELDEVIS != null && t.ISEXTENSION == true).Sum(p => p.MONTANTTAXE).Value.ToString(SessionObject.FormatMontant); this.dataGridElementDevisBranchement.ItemsSource = null; this.dataGridElementDevisBranchement.ItemsSource = laDetailDemande.EltDevis.Where(t => t.ISEXTENSION == false).ToList(); this.Txt_MontantTotalBranchement.Text = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.ISEXTENSION == false).Sum(t => t.MONTANTTTC).Value.ToString(SessionObject.FormatMontant); this.Txt_MontantTotalG.Text = CalculerCoutTotalGeneral().ToString(SessionObject.FormatMontant); if (MyElements == null) { MyElements = new List <ObjELEMENTDEVIS>(); } this.MyElements = laDetailDemande.EltDevis.Where(t => t.FK_IDMATERIELDEVIS != 0 && t.FK_IDMATERIELDEVIS != null && t.ISEXTENSION == true).ToList(); //ZEG 28/09/2017 if (laDetailDemande.AnnotationDemande != null && laDetailDemande.AnnotationDemande.Count != 0) { this.txtMotif.Text = laDetailDemande.AnnotationDemande.OrderByDescending(t => t.DATECREATION).First().COMMENTAIRE; this.lblMotif.Visibility = System.Windows.Visibility.Visible; this.txtMotif.Visibility = System.Windows.Visibility.Visible; } /****/ return; } } } catch (Exception ex) { if (LayoutRoot != null) { LayoutRoot.Cursor = Cursors.Arrow; } Message.ShowError(ex.Message, Languages.txtDevis); } }; Serviceclient.SelectAllMaterielAsync(); } catch (Exception ex) { if (LayoutRoot != null) { LayoutRoot.Cursor = Cursors.Arrow; } Message.ShowError(ex.Message, Galatee.Silverlight.Resources.Devis.Languages.txtDevis); } }
public void EnregistrerInfoSaisie(CsDemande _Lademande) { EnregistrerCanalisation(_Lademande); EnregistrerEvenement(_Lademande); }
private void RetourneDemandeByNumero(string Numerodemande) { try { prgBar.Visibility = System.Windows.Visibility.Visible; //Galatee.Silverlight.ServiceDevis.DevisServiceClient client = new Galatee.Silverlight.ServiceDevis.DevisServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Devis")); AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); client.GetDevisByNumDemandeCompleted += (ssender, args) => { prgBar.Visibility = System.Windows.Visibility.Collapsed; if (args.Cancelled || args.Error != null) { LayoutRoot.Cursor = Cursors.Arrow; string error = args.Error.Message; Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis); return; } if (args.Result == null) { LayoutRoot.Cursor = Cursors.Arrow; Message.ShowError(Silverlight.Resources.Devis.Languages.AucunesDonneesTrouvees, Silverlight.Resources.Devis.Languages.txtDevis); return; } else { laDetailDemande = args.Result; laDemandeSelect = laDetailDemande.LaDemande; this.txt_tdem.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLETYPEDEMANDE)? string.Empty : laDemandeSelect.LIBELLETYPEDEMANDE; this.txtCentre.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLECENTRE) ? string.Empty : laDemandeSelect.LIBELLECENTRE; this.txtSite.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLESITE) ? string.Empty : laDemandeSelect.LIBELLESITE; this.txt_Produit.Text = string.IsNullOrEmpty(laDemandeSelect.LIBELLEPRODUIT) ? string.Empty : laDemandeSelect.LIBELLEPRODUIT; this.txt_tdem.Text = laDemandeSelect.LIBELLETYPEDEMANDE; if (laDemandeSelect.DCAISSE == null) { this.OKButton.IsEnabled = false; Message.ShowInformation("Cette demande n a pas été payéé", "Demande"); return; } else { if (laDemandeSelect.DATEFIN != null) { this.OKButton.IsEnabled = false; Message.ShowInformation("Cette demande été réalisée", "Demande"); return; } if (laDetailDemande.LstCoutDemande != null && laDetailDemande.LstCoutDemande.Count != 0) { RemplireOngletClient(laDetailDemande.LeClient); RemplirOngletAbonnement(laDetailDemande.Abonne); RemplireOngletFacture(laDetailDemande.LstCoutDemande); AfficherDocumentScanne(laDetailDemande.ObjetScanne); Txt_Motif.Text = string.IsNullOrEmpty(laDetailDemande.LaDemande.MOTIF) ? string.Empty : laDetailDemande.LaDemande.MOTIF; } } } LayoutRoot.Cursor = Cursors.Arrow; }; client.GetDevisByNumDemandeAsync(Numerodemande); } catch (Exception ex) { Message.Show("Erreur au chargement de la demande", "Demande"); } }
private void RetourneDetailDemande(CsDemandeBase laDemandeSelect) { int res = LoadingManager.BeginLoading(Langue.En_Cours); try { CsDemande leDetailDemande = new CsDemande(); AcceuilServiceClient service = new AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil")); service.RetourneDetailDemandeCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } leDetailDemande = args.Result; LoadingManager.EndLoading(res); if (laDemandeSelect.LIBELLESTATUT == Langue.lib_Statut_EnAttente || laDemandeSelect.LIBELLESTATUT == Langue.lib_Statut_Rejeter) { if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationAbonnement) { //FrmModificationAbonnement frm = new FrmModificationAbonnement(leDetailDemande); //frm.Closed += new EventHandler(galatee_RefraicheListe); //frm.Show(); } if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationAdresse) { //FrmModificationAdresse frm = new FrmModificationAdresse(leDetailDemande); //frm.Closed += new EventHandler(galatee_RefraicheListe); //frm.Show(); } if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationBranchement) { //FrmModificationBranchement frm = new FrmModificationBranchement(leDetailDemande); //frm.Closed += new EventHandler(galatee_RefraicheListe); //frm.Show(); } if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationCompteur) { //FrmModificationCompteur frm = new FrmModificationCompteur(leDetailDemande,string.Empty ); //frm.Closed += new EventHandler(galatee_RefraicheListe); //frm.Show(); } if (laDemandeSelect.TYPEDEMANDE == SessionObject.Enumere.ModificationClient) { //FrmModicationClient frm = new FrmModicationClient(leDetailDemande); //frm.Closed += new EventHandler(galatee_RefraicheListe); //frm.Show(); } } }; service.RetourneDetailDemandeAsync(laDemandeSelect); service.CloseAsync(); } catch (Exception ex) { LoadingManager.EndLoading(res); throw ex; } }