private void VerifieCompteurExiste(CsCompteur nouveaucompteur) { AcceuilServiceClient service = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil")); service.VerifieSiCompteurExisteCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } if (args.Result == null) { ValidationDemande(laDetailDemande); this.DialogResult = false; } else { Message.ShowInformation("Ce compteur " + args.Result.NUMERO + " de marque " + args.Result.LIBELLEMARQUE + "\n\r" + " existe déja sur la reférence " + args.Result.CENTRE + " " + args.Result.CLIENT, "Modification compteur"); } this.IsEnabled = true; }; service.VerifieSiCompteurExisteAsync(nouveaucompteur); service.CloseAsync(); }
public bool VerifieCompteurExisteNew(CsCompteur leCpt) { try { return(new DBScelle().VerifieCompteurExistenew(leCpt)); } catch (Exception ex) { ErrorManager.LogException(this, ex); return(false); } }
private void OKButton_Click(object sender, RoutedEventArgs e) { this.IsEnabled = false; CsCompteur leCompteur = new CsCompteur() { ANNEEFAB = string.IsNullOrEmpty(this.Txt_AnneeFab.Text) ? string.Empty : this.Txt_AnneeFab.Text, CADRAN = string.IsNullOrEmpty(this.Txt_CodeCadran.Text) ? Convert.ToByte(6) : Convert.ToByte(this.Txt_CodeCadran.Text), NUMERO = string.IsNullOrEmpty(this.Txt_NumCompteur.Text) ? string.Empty : this.Txt_NumCompteur.Text, MARQUE = string.IsNullOrEmpty(this.Txt_CodeMarque.Text) ? string.Empty : this.Txt_CodeMarque.Text, FK_IDMARQUECOMPTEUR = (int)this.Txt_CodeMarque.Tag, TYPECOMPTEUR = string.IsNullOrEmpty(this.Txt_CodeTypeCompteur.Text) ? string.Empty : this.Txt_CodeTypeCompteur.Text }; VerifieCompteurExiste(leCompteur); }
void _ctrl_Closed(object sender, EventArgs e) { //UcListeCompteurAuto ctr = sender as UcListeCompteurAuto; CsCompteur _LeCompteurSelectDatagrid = new CsCompteur(); CsTcompteur _LeCompteurSelect = new CsTcompteur(); //_LeCompteurSelectDatagrid = (CsCompteur)ctr.dataGrid1.SelectedItem; LeCompteurSelect.COMPTEUR = _LeCompteurSelectDatagrid.NUMERO; LeCompteurSelect.MCOMPT = _LeCompteurSelectDatagrid.MARQUE; //LeCompteurSelect.TCOMP = _LeCompteurSelectDatagrid.TCOMPT; LeCompteurSelect.ANNEEFAB = _LeCompteurSelectDatagrid.ANNEEFAB; LeCompteurSelect.POINT = determinePoint(LeCompteurSelect.TCOMP); LeCompteurSelect.SAISIE = "Oui"; //Inserer canalisation CsCanalisation _LeCanalisation = new CsCanalisation(); //_LeCanalisation.CENTRE = LaDemande.CENTRE; //_LeCanalisation.CLIENT = LaDemande.CLIENT; //_LeCanalisation.ORDRE = LaDemande.ORDRE; //_LeCanalisation.POINT = LaDemande.POINT; //_LeCanalisation.ANNEEFAB = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.ANNEEFAB) ? string.Empty : _LeCompteurSelectDatagrid.ANNEEFAB; //_LeCanalisation.MCOMPT = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.MCOMPT) ? string.Empty : _LeCompteurSelectDatagrid.MCOMPT; //_LeCanalisation.COMPTEUR = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.COMPTEUR) ? string.Empty : _LeCompteurSelectDatagrid.COMPTEUR ; //_LeCanalisation.CADCOMPT = string.IsNullOrEmpty(_LeCompteurSelectDatagrid.CADCOMP) ? string.Empty : _LeCompteurSelectDatagrid.CADCOMP; //_LeCanalisation.TCOMPT = LeCompteurSelect.PK_TYPE ; //if (LaDemande.TYPEDEMANDE == SessionObject.Enumere.AbonnementSeul || // LaDemande.TYPEDEMANDE == SessionObject.Enumere.BranchementAbonement) // _LeCanalisation.ETATCOMPT = SessionObject.Enumere.CompteurActifValeur; //if (!string.IsNullOrEmpty(_LeCanalisation.COMPTEUR)) //{ // if (LstCanalisation.FirstOrDefault(p=>p.TCOMPT == _LeCanalisation.TCOMPT )==null ) // LstCanalisation.Add(_LeCanalisation); //} UcDemandeSaisieCompteurMt ctrl = new UcDemandeSaisieCompteurMt(LaDemande, LeCompteurSelect); ctrl.Closed += new EventHandler(ctrl_Closed); ctrl.Show(); }
private void OKButton_Click(object sender, RoutedEventArgs e) { this.IsEnabled = false; CsCompteur leCompteur = new CsCompteur() { ANNEEFAB = string.IsNullOrEmpty(this.Txt_AnneeFab.Text) ? string.Empty : this.Txt_AnneeFab.Text, CADRAN = string.IsNullOrEmpty(this.Txt_CodeCadran.Text) ? Convert.ToByte(6) : Convert.ToByte(this.Txt_CodeCadran.Text), NUMERO = string.IsNullOrEmpty(this.Txt_NumCompteur.Text) ? string.Empty : this.Txt_NumCompteur.Text, MARQUE = string.IsNullOrEmpty(this.Txt_CodeMarque.Text) ? string.Empty : this.Txt_CodeMarque.Text, FK_IDMARQUECOMPTEUR = (int)this.Txt_CodeMarque.Tag, TYPECOMPTEUR = string.IsNullOrEmpty(this.Txt_CodeTypeCompteur.Text) ? string.Empty : this.Txt_CodeTypeCompteur.Text }; /*Faire la verification du numero de compteur que si c'est le numero qui change 10/08/2017 AKO*/ if (leCompteur.NUMERO != laDetailDemande.LstCanalistion.First().NUMERO) { VerifieCompteurExiste(leCompteur); } else { ValidationDemande(laDetailDemande); } }