private void Txt_DateAbonnement_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_DateAbonnement.Text.Length == SessionObject.Enumere.TailleDate)
         {
             if (ClasseMEthodeGenerique.IsDateValide(this.Txt_DateAbonnement.Text) == null)
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, "Date invalide", MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_DateAbonnement.Focus();
                 };
                 w.Show();
             }
             else
             {
                 if (typeDemande != SessionObject.Enumere.ModificationAbonnement)
                 {
                     EnregistrerDemande(LaDemande);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
 private void Txt_CodeDiametre_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CodeDiametre.Text.Length == SessionObject.Enumere.TailleDiametre && (LstDiametre != null && LstDiametre.Count != 0))
         {
             CsDiacomp _LeDiametre = ClasseMEthodeGenerique.RetourneObjectFromList(LstDiametre, this.Txt_CodeDiametre.Text, "CODE");
             if (!string.IsNullOrEmpty(_LeDiametre.LIBELLE))
             {
                 LeDiametreSelect = _LeDiametre;
                 this.Txt_LibelleDiametre.Text = _LeDiametre.LIBELLE;
                 EnregistrerInfoSaisie(LaDemande);
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeDiametre.Focus();
                 };
                 w.Show();
                 Txt_CodeDiametre.Text    = string.Empty;
                 Txt_LibelleDiametre.Text = string.Empty;
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
 private void ShowInfoCentre_NumDem()
 {
     if (LstCentre != null)
     {
         if (this.Txt_CodeCentre.Text.Length == SessionObject.Enumere.TailleCentre && LstCentre.Count() > 0)
         {
             //Galatee.Silverlight.ServiceAccueil.CsCentre _LeCentre = new ClasseMEthodeGenerique().RetourneObjectFromList<Galatee.Silverlight.ServiceAccueil.CsCentre>(LstCentre, this.Txt_CodeCentre.Text, "CODECENTRE");
             Galatee.Silverlight.ServiceAccueil.CsCentre _LeCentre = LstCentre.FirstOrDefault(c => c.CODECENTRE == this.Txt_CodeCentre.Text);
             if (_LeCentre != null)
             {
                 this.Txt_LibelleCentre.Text     = _LeCentre.NOM;
                 this.Txt_NumDemande.Text        = _LeCentre.CODECENTRE + _LeCentre.NUMDEM.ToString().PadLeft(10, '0');
                 LaDemande.LaDemande.CENTRE      = _LeCentre.CODECENTRE;
                 LaDemande.LaDemande.FK_IDCENTRE = _LeCentre.PK_ID;
                 LaDemande.LaDemande.NUMDEM      = this.Txt_NumDemande.Text;
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeCentre.Focus();
                 };
                 w.Show();
             }
         }
     }
 }
 private void Txt_CodeCentre_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (this.Txt_CodeCentre.Text.Length == SessionObject.Enumere.TailleCentre && LstCentre != null && LstCentre.Count != 0)
     {
         CsCentre _LeCentre = ClasseMEthodeGenerique.RetourneObjectFromList <CsCentre>(LstCentre, this.Txt_CodeCentre.Text, "CODE");
         if (_LeCentre != null)
         {
             this.Txt_LibelleCentre.Text     = _LeCentre.LIBELLE;
             this.Txt_NumDemande.Text        = _LeCentre.CODE + _LeCentre.NUMDEM.ToString().PadLeft(10, '0');
             LaDemande.LaDemande.CENTRE      = _LeCentre.CODE;;
             LaDemande.LaDemande.FK_IDCENTRE = _LeCentre.PK_ID;
             LaDemande.LaDemande.NUMDEM      = this.Txt_NumDemande.Text;
             LaDemande.LaDemande.MATRICULE   = UserConnecte.matricule;
         }
         else
         {
             var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
             w.OnMessageBoxClosed += (_, result) =>
             {
                 this.Txt_CodeCentre.Focus();
             };
             w.Show();
         }
     }
 }
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                this.OKButton.IsEnabled = false;
                List <CsEvenement> lesEvtDeLagrille = ((List <CsEvenement>) this.dataGrid1.ItemsSource).Where(t => t.IsSaisi == true).ToList();
                List <CsEvenement> lstEvtRetirer    = new List <CsEvenement>();
                foreach (CsEvenement item in lesEvtDeLagrille)
                {
                    lstEvtRetirer.AddRange(ListeEvenementAExtraire.Where(t => t.FK_IDABON == item.FK_IDABON).ToList());
                }

                var ws = new MessageBoxControl.MessageBoxChildWindow(Langue.LibelleModule, "Voulez vous faire un rejet definitif", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Information);
                ws.OnMessageBoxClosed += (l, results) =>
                {
                    if (ws.Result == MessageBoxResult.OK)
                    {
                        lstEvtRetirer.ForEach(t => t.STATUS = SessionObject.Enumere.EvenementSupprimer);
                        MiseAJourEvent(lstEvtRetirer);
                        this.OKButton.IsEnabled = true;
                    }
                    else
                    {
                        lstEvtRetirer.ForEach(t => t.STATUS = SessionObject.Enumere.EvenementRejeter);
                        MiseAJourEvent(lstEvtRetirer);
                        this.OKButton.IsEnabled = true;
                    }
                };
                ws.Show();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Langue.LibelleModule);
            }
        }
Esempio n. 6
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Confirmez-vous la mise à jour de la demande ?", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Information);
         messageBox.OnMessageBoxClosed += (_, result) =>
         {
             if (messageBox.Result == MessageBoxResult.OK)
             {
                 if (laDetailDemande != null)
                 {
                     ValiderDemande(laDetailDemande);
                 }
             }
             else
             {
                 return;
             }
         };
         messageBox.Show();
     }
     catch (Exception ex)
     {
         this.DialogResult = false;
         Message.Show(ex.Message, Languages.txtDevis);
     }
 }
Esempio n. 7
0
 private void Txt_CodeCommune_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.Txt_CodeCommune.Text) &&
         this.Txt_CodeCommune.Text.Length == SessionObject.Enumere.TailleCodeQuartier &&
         LstCommuneAll.Where(t => t.FK_IDCENTRE == (int)laDetailDemande.Ag.FK_IDCENTRE).ToList().Count != 0)
     {
         CsCommune LaCommuneSelect = ClasseMEthodeGenerique.RetourneObjectFromList(LstCommuneAll.Where(t => t.FK_IDCENTRE == (int)laDetailDemande.Ag.FK_IDCENTRE).ToList(), this.Txt_CodeCommune.Text, "CODE");
         if (!string.IsNullOrEmpty(LaCommuneSelect.LIBELLE))
         {
             this.Txt_LibelleCommune.Text = LaCommuneSelect.LIBELLE;
             this.Txt_CodeCommune.Tag     = LaCommuneSelect.PK_ID;
         }
         else
         {
             var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.Msg_CommuneNonTrouve, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
             w.OnMessageBoxClosed += (_, result) =>
             {
                 this.Txt_LibelleCommune.Text = string.Empty;
                 this.Txt_CodeCommune.Text    = string.Empty;
                 this.Txt_CodeCommune.Focus();
             };
             w.Show();
         }
     }
 }
        private void btn_suppression_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var w = new MessageBoxControl.MessageBoxChildWindow("Suppression Releveur", "Voulez vous executer cette action", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                w.OnMessageBoxClosed += (_, result) =>
                {
                    if (w.Result == MessageBoxResult.OK)
                    {
                        if (dataGrid1.SelectedItem == null)
                        {
                            return;
                        }
                        CsReleveur releveur = (CsReleveur)dataGrid1.SelectedItem;

                        releveur.USERMODIFICATION = UserConnecte.matricule;
                        releveur.DATEMODIFICATION = DateTime.Now.Date;
                        releveur.SUPPRIMER        = true;
                        SupprimerReleveur(releveur);
                    }
                    else
                    {
                        DialogResult = false;
                    }
                };
                w.Show();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex, "Erreur");
            }
        }
 void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         OKButton.IsEnabled = false;
         var w = new MessageBoxControl.MessageBoxChildWindow(Galatee.Silverlight.Resources.Langue.ConfirmationTitle, Galatee.Silverlight.Resources.Administration.Langue.confirmHabilitationMsg, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Information);
         w.OnMessageBoxClosed += (_, result) =>
         {
             if (w.Result == MessageBoxResult.OK)
             {
                 ValidaterAttributionProfil();
             }
             else
             {
                 OKButton.IsEnabled = true;
             }
         };
         w.Show();
     }
     catch (Exception ex)
     {
         OKButton.IsEnabled = true;
         Message.ShowError(ex, Langue.informationTitle);
     }
 }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Confirmez-vous cette demande ?", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Information);
         messageBox.OnMessageBoxClosed += (_, result) =>
         {
             if (messageBox.Result == MessageBoxResult.OK)
             {
                 if (this.laDetailDemande != null)
                 {
                     MiseAjourDemande();
                 }
                 else
                 {
                     ValiderInitialisation();
                 }
             }
             else
             {
                 return;
             }
         };
         messageBox.Show();
     }
     catch (Exception es)
     {
         throw es;
     }
 }
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Ête-vous sure de vouloire supprimer la ligne?", MessageBoxControl.MessageBoxButtons.OkCancel, MessageBoxControl.MessageBoxIcon.Information);

            messageBox.OnMessageBoxClosed += (_, result) =>
            {
                if (messageBox.Result == MessageBoxResult.OK)
                {
                    CsCoper_Type_Compte redevenceSelectionne = (CsCoper_Type_Compte)dgListeCompteSpecifique.SelectedItem;


                    if (redevenceSelectionne != null)
                    {
                        List <CsCoper_Type_Compte> CompteSpecifiqueRecuToDelete = new List <CsCoper_Type_Compte>();
                        CompteSpecifiqueRecuToDelete.Add(redevenceSelectionne);
                        Save(new List <CsCoper_Type_Compte>(), new List <CsCoper_Type_Compte>(), CompteSpecifiqueRecuToDelete);


                        ListeCompteSpecifique.Remove(redevenceSelectionne);

                        //SessionObject.ListeCompteSpecifique = ListeCompteSpecifique.ToList();
                        LoadDatagrid();
                    }
                    else
                    {
                        Message.ShowInformation("Veuillez selection une ligne", "Avertissement");
                    }
                }
                else
                {
                    return;
                }
            };
            messageBox.Show();
        }
Esempio n. 12
0
        private void btn_Supprimer_click(object sender, RoutedEventArgs e)
        {
            if (lnkLetter.Tag != null)
            {
                var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.msgSuppressionFichier, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                w.OnMessageBoxClosed += (_, result) =>
                {
                    if (w.Result == MessageBoxResult.OK)
                    {
                        if (LaDemande != null && LaDemande.LaDemande != null && LaDemande.LaDemande.FICHIERJOINT != new Guid("00000000-0000-0000-0000-000000000000"))
                        {
                            LaDemande.LaDemande.FICHIERJOINT = new Guid("00000000-0000-0000-0000-000000000000");
                        }

                        this.btn_Supprime.Visibility = System.Windows.Visibility.Collapsed;
                        this.btn_Modifier.Visibility = System.Windows.Visibility.Collapsed;
                        lnkLetter.Tag          = null;
                        this.lnkLetter.Content = "Motif de la modification";
                    }
                };
                w.Show();
            }
            else
            {
                Message.ShowInformation(Langue.msgAucunfichier, Langue.lbl_Menu);
            }
        }
 private void Txt_CodeForfait_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (LstForfait.Count != 0 && this.Txt_CodeForfait.Text.Length == SessionObject.Enumere.TailleForfait)
         {
             CsForfait _LeForfait = LstForfait.FirstOrDefault(p => p.PRODUIT == this.txtProduit.Text && p.CODE == this.Txt_CodeForfait.Text);
             if (_LeForfait != null)
             {
                 this.Txt_LibelleForfait.Text = _LeForfait.LIBELLE;
                 this.Txt_CodeForfait.Tag     = _LeForfait.PK_ID;
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Galatee.Silverlight.Resources.Accueil.Langue.lbl_Menu, Galatee.Silverlight.Resources.Accueil.Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeForfait.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Galatee.Silverlight.Resources.Accueil.Langue.lbl_Menu);
     }
 }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (laDemandeSelect != null)
         {
             var ws = new MessageBoxControl.MessageBoxChildWindow("Demande", "Voulez vous supprimer la demande", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Information);
             ws.OnMessageBoxClosed += (l, results) =>
             {
                 if (ws.Result == MessageBoxResult.No)
                 {
                 }
                 else if (ws.Result == MessageBoxResult.OK)
                 {
                     laDemandeSelect.ISSUPPRIME      = true;
                     laDemandeSelect.USERSUPPRESSION = UserConnecte.matricule;
                     laDemandeSelect.DATESUPPRESSION = System.DateTime.Now;
                     laDemandeSelect.STATUTDEMANDE   = "1";
                     SupprimerDemande(laDemandeSelect);
                 }
             };
             ws.Show();
         }
     }
     catch (Exception ex)
     {
         this.DialogResult = false;
         Message.Show(ex.Message, Languages.txtDevis);
     }
 }
Esempio n. 15
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.txt_MontantPayes.Text) &&
         !string.IsNullOrEmpty(this.Txt_TotalTTC.Text) &&
         decimal.Parse(this.txt_MontantPayes.Text) > decimal.Parse(this.Txt_TotalTTC.Text))
     {
         var w = new MessageBoxControl.MessageBoxChildWindow(Langue.LibelleModule, Langue.Msg_MontantPayeSuperieur + "  " + this.Txt_TotalTTC.Text, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
         w.OnMessageBoxClosed += (_, result) =>
         {
         };
         w.Show();
     }
     else
     {
         if (!string.IsNullOrEmpty(this.txt_MontantPayes.Text) && VerifieMontantPaye())
         {
             List <CsLclient> _LesFactureFactureInit = (List <CsLclient>) this.LsvFacture.ItemsSource;
             List <CsLclient> _LesFactureASolde      = SoldeFacture(_LesFactureFactureInit, decimal.Parse(this.txt_MontantPayes.Text));
             if (!_LesFactureASolde.First().ISDECAISSEMENT)
             {
                 UcValideEncaissement UcValider = new UcValideEncaissement(_LesFactureASolde, SessionObject.Enumere.OperationDeCaisseEncaissementDevis);
                 UcValider.Closed += new EventHandler(UcValideEncaissementClosed);
                 UcValider.Show();
             }
             if (_LesFactureASolde.First().ISDECAISSEMENT)
             {
                 UcValideEncaissement UcValider = new UcValideEncaissement(_LesFactureASolde, SessionObject.Enumere.OperationDeCaisseEncaissementDevis, "OUI");
                 UcValider.Closed += new EventHandler(UcValideEncaissementClosed);
                 UcValider.Show();
             }
         }
     }
 }
Esempio n. 16
0
 private void Txt_CodeMarque_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CodeMarque.Text.Length == SessionObject.Enumere.TailleCodeMarqueCompteur && (LstMarque != null && LstMarque.Count != 0))
         {
             CsMarqueCompteur _LaMarque = ClasseMEthodeGenerique.RetourneObjectFromList(LstMarque, this.Txt_CodeMarque.Text, "CODE");
             if (!string.IsNullOrEmpty(_LaMarque.LIBELLE))
             {
                 this.Txt_LibelleMarque.Text = _LaMarque.LIBELLE;
                 this.Txt_CodeMarque.Tag     = _LaMarque.PK_ID;
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeMarque.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
Esempio n. 17
0
 private void Txt_CodeMateriel_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CodeMateriel.Text.Length == SessionObject.Enumere.TailleCodeMateriel && (LstDeMaterielBrt != null && LstDeMaterielBrt.Count != 0))
         {
             CsMaterielBranchement _leMateriel = ClasseMEthodeGenerique.RetourneObjectFromList <CsMaterielBranchement>(LstDeMaterielBrt, this.Txt_CodeMateriel.Text, "CODE");
             if (_leMateriel != null && !string.IsNullOrEmpty(_leMateriel.LIBELLE))
             {
                 this.Txt_LibelleMateriel.Text = _leMateriel.LIBELLE;
                 LeDeMaterielBrtSelect         = _leMateriel;
                 if (TypeDemande != SessionObject.Enumere.ModificationBranchement)
                 {
                     EnregisterDemande(LaDemande);
                 }
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeMateriel.Focus();
                     this.Txt_CodeMateriel.Text    = string.Empty;
                     this.Txt_LibelleMateriel.Text = string.Empty;
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Êtes-vous sûr de vouloir supprimer la ligne?", MessageBoxControl.MessageBoxButtons.OkCancel, MessageBoxControl.MessageBoxIcon.Information);

            messageBox.OnMessageBoxClosed += (_, result) =>
            {
                if (messageBox.Result == MessageBoxResult.OK)
                {
                    CsVariableDeTarification LotsScelleRecuToDelete = (CsVariableDeTarification)dgListeVariableTarif.SelectedItem;


                    List <CsVariableDeTarification> VariableTarifoDelete = new List <CsVariableDeTarification>();
                    VariableTarifoDelete.Add(LotsScelleRecuToDelete);
                    Save(new List <CsVariableDeTarification>(), new List <CsVariableDeTarification>(), VariableTarifoDelete);


                    ListeVariableTarif.Remove(LotsScelleRecuToDelete);

                    SessionObject.ListeVariableTarif = ListeVariableTarif.ToList();
                    LoadDatagrid();
                }
                else
                {
                    return;
                }
            };
            messageBox.Show();
        }
Esempio n. 19
0
 private void Txt_CodePoste_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (this.Txt_CodePoste.Text.Length == SessionObject.Enumere.TailleCodeQuartier && (LstDePosteElectrique != null && LstDePosteElectrique.Count != 0))
     {
         CsPosteElectrique _lePoste = ClasseMEthodeGenerique.RetourneObjectFromList <CsPosteElectrique>(LstDePosteElectrique, this.Txt_CodePoste.Text, "CODE");
         if (_lePoste != null && !string.IsNullOrEmpty(_lePoste.LIBELLE))
         {
             this.Txt_LibellePoste.Text = _lePoste.LIBELLE;
             LePosteBrtSelect           = _lePoste;
             if (TypeDemande != SessionObject.Enumere.ModificationBranchement)
             {
                 EnregisterDemande(LaDemande);
             }
         }
         else
         {
             var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
             w.OnMessageBoxClosed += (_, result) =>
             {
                 this.Txt_CodePoste.Focus();
                 this.Txt_CodePoste.Text    = string.Empty;
                 this.Txt_LibellePoste.Text = string.Empty;
             };
             w.Show();
         }
     }
 }
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (DonnesDatagrid.Count == 0)
                {
                    throw new Exception(Languages.AucuneDonneeASupprimer);
                }
                if (dtgrdParametre.SelectedItems.Count > 0)
                {
                    var messageBox = new MessageBoxControl.MessageBoxChildWindow(Languages.Centre, Languages.QuestionSuppressionDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                    messageBox.OnMessageBoxClosed += (_, result) =>
                    {
                        if (messageBox.Result == MessageBoxResult.OK)
                        {
                            if (dtgrdParametre.SelectedItem != null)
                            {
                                var selected = dtgrdParametre.SelectedItem as CsCentre;

                                if (selected != null)
                                {
                                    ParametrageClient delete = new ParametrageClient(Utility.Protocole(),
                                                                                     Utility.EndPoint("Parametrage"));
                                    delete.DeleteCentreCompleted += (del, argDel) =>
                                    {
                                        if (argDel.Cancelled || argDel.Error != null)
                                        {
                                            Message.ShowError(argDel.Error.Message, Languages.Centre);
                                            return;
                                        }

                                        if (argDel.Result == false)
                                        {
                                            Message.ShowError(Languages.ErreurSuppressionDonnees, Languages.Centre);
                                            return;
                                        }

                                        DonnesDatagrid.Remove(selected);
                                    };
                                    delete.DeleteCentreAsync(selected);
                                }
                            }
                        }
                        else
                        {
                            return;
                        }
                    };
                    messageBox.Show();
                }
                else
                {
                    throw new Exception(Languages.SelectionnerUnElement);
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.Centre);
            }
        }
 private void Txt_CodeTarif_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) &&
         LstTarif != null && LstTarif.Count != 0 &&
         this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif)
     {
         CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(LstTarif, this.Txt_CodeTarif.Text, "CODE");
         if (_LeTarif != null)
         {
             this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE;
             this.Txt_CodeTarif.Tag     = _LeTarif.PK_ID;
             EnregistrerDemande(LaDemande);
             this.btn_PussSouscrite.IsEnabled = true;
             LstPuissanceTarif = SessionObject.LstTarifPuissance.Where(t => t.PK_ID == _LeTarif.PK_ID).ToList();
             //LstPuissanceTarif.ForEach(t => t.CODEPUISSANCE = (decimal.Parse(t.CODEPUISSANCE)).ToString());
         }
         else
         {
             var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
             w.OnMessageBoxClosed += (_, result) =>
             {
                 this.Txt_CodeTarif.Focus();
             };
             w.Show();
         }
     }
 }
Esempio n. 22
0
 private void Txt_CadranCompteur_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CadranCompteur.Text.Length == SessionObject.Enumere.TailleDigitCompteur && LstCadran != null && LstCadran.Count != 0)
         {
             CsCadran _LeCadran = ClasseMEthodeGenerique.RetourneObjectFromList(LstCadran, this.Txt_CadranCompteur.Text, "CODE");
             if (!string.IsNullOrEmpty(_LeCadran.LIBELLE))
             {
                 this.Txt_LibelleCadran.Text = _LeCadran.LIBELLE;
                 //EnregistrerInfoSaisie(LaDemande);
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CadranCompteur.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void Txt_CodeMoisIndex_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (LstMois.Count != 0 && this.Txt_CodeMoisIndex.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation)
         {
             CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(LstMois, this.Txt_CodeMoisIndex.Text, "CODE");
             if (_LeMois != null)
             {
                 this.Txt_LibelleMoisIndex.Text = _LeMois.LIBELLE;
                 this.Txt_CodeMoisIndex.Tag     = _LeMois.PK_ID;
                 EnregistrerDemande(LaDemande);
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeMoisFacturation.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
 private void Txt_CodeProduit_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         if (this.Txt_CodeProduit.Text.Length == SessionObject.Enumere.TailleCodeProduit)
         {
             LaDemande.LaDemande.PRODUIT = this.Txt_CodeProduit.Text;
             CsProduit _LeProduitSelect = ClasseMEthodeGenerique.RetourneObjectFromList(ListeDesProduitDuSite, this.Txt_CodeProduit.Text, "CODE");
             if (!string.IsNullOrEmpty(_LeProduitSelect.LIBELLE))
             {
                 this.Txt_LibelleProduit.Text     = _LeProduitSelect.LIBELLE;
                 LaDemande.LaDemande.FK_IDPRODUIT = _LeProduitSelect.PK_ID;
             }
             else
             {
                 var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information);
                 w.OnMessageBoxClosed += (_, result) =>
                 {
                     this.Txt_CodeProduit.Focus();
                 };
                 w.Show();
             }
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex.Message, Langue.lbl_Menu);
     }
 }
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            var messageBox = new MessageBoxControl.MessageBoxChildWindow("Attention", "Êtes-vous sûr de vouloir supprimer la ligne?", MessageBoxControl.MessageBoxButtons.OkCancel, MessageBoxControl.MessageBoxIcon.Information);

            messageBox.OnMessageBoxClosed += (_, result) =>
            {
                if (messageBox.Result == MessageBoxResult.OK)
                {
                    CsLotComptClient redevenceSelectionne = (CsLotComptClient)dgListeAjustement.SelectedItem;


                    List <CsLotComptClient> AjustementRecuToDelete = new List <CsLotComptClient>();
                    AjustementRecuToDelete.Add(redevenceSelectionne);
                    Save(new List <CsLotComptClient>(), new List <CsLotComptClient>(), AjustementRecuToDelete);


                    ListeAjustement.Remove(redevenceSelectionne);

                    SessionObject.ListeAjustement = ListeAjustement.ToList();
                    LoadDatagrid();
                }
                else
                {
                    return;
                }
            };
            messageBox.Show();
        }
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            var dictionaryParam = new Dictionary <string, string>();

            try
            {
                dictionaryParam.Add("RptParam_DateCreation", Languages.DateCreation);
                dictionaryParam.Add("RptParam_DateModification", Languages.DateModification);
                dictionaryParam.Add("RptParam_UserCreation", Languages.UserCreation);
                dictionaryParam.Add("RptParam_UserModification", Languages.UserModification);
                dictionaryParam.Add("RptParam_Title", Languages.ListeExoneration.ToUpper());
                dictionaryParam.Add("Rpt_RegCli", Languages.Regroupement.ToUpper());
                dictionaryParam.Add("Rpt_Produit", Languages.LibelleProduit.ToUpper());
                dictionaryParam.Add("Rpt_Centre", Languages.Centre.ToUpper());
                dictionaryParam.Add("Rpt_Avance", Languages.Avance.ToUpper());
                dictionaryParam.Add("Rpt_Dossier", Languages.Dossier.ToUpper());
                dictionaryParam.Add("Rpt_Police", Languages.Police.ToUpper());
                dictionaryParam.Add("Rpt_Traitement", Languages.Traitement.ToUpper());

                if (DonnesDatagrid.Count == 0)
                {
                    throw new Exception(Languages.AucuneDonneeAImprimer);
                }

                var messageBox = new MessageBoxControl.MessageBoxChildWindow(Languages.RegroupementClient, Languages.QuestionImpressionDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                messageBox.OnMessageBoxClosed += (_, result) =>
                {
                    if (messageBox.Result == MessageBoxResult.OK)
                    {
                        string key     = Utility.getKey();
                        var    service = new ParametrageClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Parametrage"));
                        service.EditerListeRegExoCompleted += (snder, print) =>
                        {
                            if (print.Cancelled || print.Error != null)
                            {
                                Message.ShowError(print.Error.Message, Languages.RegroupementExoneration);
                                return;
                            }
                            if (!print.Result)
                            {
                                Message.ShowError(Languages.ErreurImpressionDonnees, Languages.RegroupementExoneration);
                                return;
                            }
                            Utility.ActionImpressionDirect(null, key, "RegExo", "Parametrage");
                        };
                        service.EditerListeRegExoAsync(key, dictionaryParam);
                    }
                    else
                    {
                        return;
                    }
                };
                messageBox.Show();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.RegroupementExoneration);
            }
        }
 private void Supprimer()
 {
     try
     {
         if (DonnesDatagrid.Count == 0)
         {
             throw new Exception(Languages.AucuneDonneeASupprimer);
         }
         if (dtgrdParametre.SelectedItem != null && dtgrdParametre.SelectedItems.Count == 1)
         {
             var w = new MessageBoxControl.MessageBoxChildWindow(Languages.Parametrage, Languages.QuestionSuppressionDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
             w.OnMessageBoxClosed += (_, result) =>
             {
                 if (w.Result == MessageBoxResult.OK)
                 {
                     var selected = dtgrdParametre.SelectedItem as CsGroupeValidation;
                     if (selected != null)
                     {
                         ParametrageClient delete = new ParametrageClient(Utility.Protocole(),
                                                                          Utility.EndPoint("Parametrage"));
                         delete.DeleteGroupeValidationCompleted += (del, argDel) =>
                         {
                             if (argDel.Cancelled || argDel.Error != null)
                             {
                                 Message.Show(argDel.Error.Message, Languages.Parametrage);
                                 return;
                             }
                             if (argDel.Result == false)
                             {
                                 Message.Show(Languages.ErreurSuppressionDonnees, Languages.Parametrage);
                                 return;
                             }
                             DonnesDatagrid.Remove(selected);
                             GetData();
                         };
                         delete.DeleteGroupeValidationAsync(new List <CsGroupeValidation>()
                         {
                             selected
                         });
                     }
                 }
                 else
                 {
                     return;
                 }
             };
             w.Show();
         }
         else
         {
             throw new Exception(Languages.SelectionnerUnElement);
         }
     }
     catch (Exception ex)
     {
         Message.Show(ex.Message, Languages.Parametrage);
     }
 }
 private void HypLinkLogo_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (!IsLogoSelectionnee)
         {
             var openDialog = new OpenFileDialog();
             openDialog.Filter =
                 "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png";
             openDialog.FilterIndex = 1;
             openDialog.Multiselect = false;
             bool?userClickedOk = openDialog.ShowDialog();
             if (userClickedOk == true)
             {
                 if (openDialog.Files != null && openDialog.Files.Count() > 0 && openDialog.File != null)
                 {
                     FileStream stream       = openDialog.File.OpenRead();
                     var        memoryStream = new MemoryStream();
                     stream.CopyTo(memoryStream);
                     HypLinkLogo.Tag = memoryStream.GetBuffer();
                     //var formScanne = new Galatee.Silverlight.Shared.UcLogo(memoryStream, SessionObject.ExecMode.Creation);
                     //formScanne.Closed += new EventHandler(GetInformationFromChildWindowImage);
                     //formScanne.Show();
                 }
             }
         }
         else
         {
             var messBoxControl = new MessageBoxControl.MessageBoxChildWindow("Logo entreprise", "Voulez vous supprimer le logo ? ", MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
             messBoxControl.OnMessageBoxClosed += (_, result) =>
             {
                 if (messBoxControl.Result == MessageBoxResult.OK)
                 {
                     this.IsLogoSelectionnee  = false;
                     this.HypLinkLogo.Content = "Insérer le logo";
                     this.HypLinkLogo.Tag     = null;
                 }
                 else
                 {
                     if (HypLinkLogo.Tag != null)
                     {
                         MemoryStream memoryStream = new MemoryStream(HypLinkLogo.Tag as byte[]);
                         //var uclogo = new Galatee.Silverlight.Shared.UcLogo(memoryStream, SessionObject.ExecMode.Modification);
                         //uclogo.Show();
                     }
                 }
             };
             messBoxControl.Show();
         }
         VerifierSaisie();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            var dictionaryParam = new Dictionary <string, string>();

            try
            {
                dictionaryParam.Add("RptParam_CODE", Languages.Code.ToUpper());
                dictionaryParam.Add("RptParam_PRODUIT", Languages.LibelleProduit.ToUpper());
                dictionaryParam.Add("RptParam_LibelleDIAMETRE", Languages.LibelleDIAMETRE.ToUpper());
                dictionaryParam.Add("RptParam_DESIGNATION", Languages.lblDESIGNATION.ToUpper());
                dictionaryParam.Add("RptParam_DIAMETRE", Languages.LibelleDIAMETRE.ToUpper());
                dictionaryParam.Add("RptParam_QUANTITY", Languages.LibelleQUANTITY.ToUpper());

                dictionaryParam.Add("RptParam_DateCreation", Languages.DateCreation);
                dictionaryParam.Add("RptParam_DateModification", Languages.DateModification);
                dictionaryParam.Add("RptParam_UserCreation", Languages.UserCreation);
                dictionaryParam.Add("RptParam_UserModification", Languages.UserModification);
                dictionaryParam.Add("RptParam_Title", Languages.ListeCaisse.ToUpper());
                if (DonnesDatagrid.Count == 0)
                {
                    throw new Exception(Languages.AucuneDonneeAImprimer);
                }
                var messageBox = new MessageBoxControl.MessageBoxChildWindow(Languages.LibelleProduit, Languages.QuestionImpressionDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                messageBox.OnMessageBoxClosed += (_, result) =>
                {
                    if (messageBox.Result == MessageBoxResult.OK)
                    {
                        string key     = Utility.getKey();
                        var    service = new ParametrageClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Parametrage"));
                        service.EditerListeFournitureCompleted += (snder, print) =>
                        {
                            if (print.Cancelled || print.Error != null)
                            {
                                string error = print.Error.Message;
                                Message.ShowError(error, Languages.LibelleProduit);
                            }
                            if (!print.Result)
                            {
                                Message.ShowError(Languages.ErreurImpressionDonnees, Languages.LibelleProduit);
                            }
                            Utility.ActionImpressionDirect(null, key, "Fourniture", "Parametrage");
                        };
                        //service.EditerListeCaisseAsync(key, dictionaryParam);
                    }
                    else
                    {
                        return;
                    }
                };
                messageBox.Show();
            }
            catch (Exception ex)
            {
                Message.Show(ex.Message, Languages.Fourniture);
            }
        }
        private void Imprimer()
        {
            var dictionaryParam = new Dictionary <string, string>();

            try
            {
                if (ListeRedevance != null && ListeRedevance.Count == 0)
                {
                    throw new Exception(Languages.AucuneDonneeAImprimer);
                }
                dictionaryParam.Add("RptParam_Centre", Languages.Centre.ToUpper());
                dictionaryParam.Add("RptParam_Libelle", Languages.ColonneLibelle.ToUpper());
                dictionaryParam.Add("RptParam_DateCreation", Languages.DateCreation);
                dictionaryParam.Add("RptParam_DateModification", Languages.DateModification);
                dictionaryParam.Add("RptParam_UserCreation", Languages.UserCreation);
                dictionaryParam.Add("RptParam_UserModification", Languages.UserModification);
                dictionaryParam.Add("Rpt_Redevance", Languages.Redevance.ToUpper());
                dictionaryParam.Add("RptParam_Title", Languages.ListeRedevance.ToUpper());
                dictionaryParam.Add("Rpt_Tranche", Languages.ColonneTranche.ToUpper());
                dictionaryParam.Add("Rpt_Produit", Languages.Produit.ToUpper());
                dictionaryParam.Add("Rpt_NatureClient", Languages.NatureClient.ToUpper());
                var w = new MessageBoxControl.MessageBoxChildWindow(Languages.Redevance, Languages.QuestionImpressionDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                w.OnMessageBoxClosed += (_, result) =>
                {
                    if (w.Result == MessageBoxResult.OK)
                    {
                        var    service = new ParametrageClient(Utility.Protocole(), Utility.EndPoint("Parametrage"));
                        string key     = Utility.getKey();
                        service.EditerListeRedevanceCompleted += (snder, print) =>
                        {
                            if (print.Cancelled || print.Error != null)
                            {
                                Message.ShowError(print.Error.Message, Languages.Redevance);
                                return;
                            }
                            if (!print.Result)
                            {
                                Message.ShowError(Languages.ErreurImpressionDonnees, Languages.Redevance);
                                return;
                            }
                            Utility.ActionImpressionDirect(null, key, "Redevance", "Parametrage");
                        };
                        service.EditerListeRedevanceAsync(key, dictionaryParam, ListeRedevance);
                    }
                    else
                    {
                        return;
                    }
                };
                w.Show();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.Redevance);
            }
        }