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_Libelle", Languages.Libelle.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.ListeCelluleSiege.ToUpper());

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

                var messageBox = new MessageBoxControl.MessageBoxChildWindow(Languages.LibelleCelluleSiege, Languages.QuestionImpressionDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question);
                messageBox.OnMessageBoxClosed += (_, result) =>
                {
                    if (messageBox.Result == MessageBoxResult.OK)
                    {
                        var key     = Utility.getKey();
                        var service = new ParametrageClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Parametrage"));
                        service.EditerListeCelluleDuSiegeCompleted += (snder, print) =>
                        {
                            if (print.Cancelled || print.Error != null)
                            {
                                var dialogResult = new DialogResult(print.Error.Message, Languages.LibelleCelluleSiege, false, true, false);
                                dialogResult.Closed += new EventHandler(DialogResultOk);
                                dialogResult.Show();
                            }
                            if (!print.Result)
                            {
                                var dialogResult = new DialogResult(Languages.ErreurImpressionDonnees, Languages.LibelleCelluleSiege, false, true, false);
                                dialogResult.Closed += new EventHandler(DialogResultOk);
                                dialogResult.Show();
                            }
                            Utility.ActionImpressionDirect(null, key, "CelluleDuSiege", "Parametrage");
                        };
                        service.EditerListeCelluleDuSiegeAsync(key, dictionaryParam);
                    }
                    else
                    {
                        return;
                    }
                };
                messageBox.Show();
            }
            catch (Exception ex)
            {
                Message.Show(ex.Message, Languages.LibelleCelluleSiege);
            }
        }
 private void Txt_DateEvt_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (this.Txt_DateEvt.Text.Length == SessionObject.Enumere.TailleDate)
     {
         if (ClasseMEthodeGenerique.IsDateValide(this.Txt_DateEvt.Text) == null)
         {
             DialogResult dialogue = new DialogResult("Date invalide", "Saisie date", false, true, false);
             dialogue.Closed += new EventHandler(dialogue_Closed);
             dialogue.Show();
         }
     }
 }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DialogResult resultat = new DialogResult("Confirmer vous la saisie", false);//, "Warming", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         resultat.Closed += new EventHandler(DialogClosed);
         resultat.Show();
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, "Erreru");
     }
 }
Esempio n. 4
0
        private void btn_Search_Click(object sender, RoutedEventArgs e)
        {
            aParam critere = new aParam();

            critere.Cashier  = cbo_ref.SelectedItem == null ? string.Empty : cbo_ref.SelectedItem == FisrtUser ? string.Empty : (cbo_ref.SelectedItem as CsUtilisateur).MATRICULE == null ? string.Empty : (cbo_ref.SelectedItem as CsUtilisateur).MATRICULE;
            critere.KeyedBy  = cbo_keydby.SelectedItem == null ? string.Empty : cbo_keydby.SelectedItem == FisrtUser ? string.Empty : (cbo_keydby.SelectedItem as CsUtilisateur).MATRICULE == null ? string.Empty : (cbo_keydby.SelectedItem as CsUtilisateur).MATRICULE;
            critere.Who      = cbo_openby.SelectedItem == null ? string.Empty : cbo_openby.SelectedItem == FisrtUser ? string.Empty : (cbo_openby.SelectedItem as CsUtilisateur).MATRICULE == null ? string.Empty : (cbo_openby.SelectedItem as CsUtilisateur).MATRICULE;
            critere.isDirect = txt_keyby.IsEnabled == false;
            critere.Day      = dtpDate_paymentDay.SelectedDate.ToString();
            critere.When     = dtp_openday.SelectedDate.ToString();
            AcceuilServiceClient accueilshearch = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));

            accueilshearch.GET_OPENING_DAYSCompleted += (searchS, resultS) =>
            {
                if (resultS.Cancelled || resultS.Error != null)
                {
                    string error = resultS.Error.Message;
                    MessageBox.Show(Langue.ErrorMsgOnInvokingService, Langue.ErrorMsgTitleOnInvokingService, MessageBoxButton.OK);
                    var dialogResult = new DialogResult(Langue.ErrorMsgOnInvokingService, Langue.ErrorMsgTitleOnInvokingService, false, true, false);
                    desableProgressBar();
                    dgt_searchResult.ItemsSource = null;
                    return;
                }

                if (resultS.Result == null || resultS.Result.Count == 0)
                {
                    var dialogResult = new DialogResult(Langue.NoDataMsg, "", false, true, false);
                    dialogResult.Show();
                    //MessageBox.Show(Langue.NoDataMsg, "", MessageBoxButton.OK);
                    desableProgressBar();
                    dgt_searchResult.ItemsSource = null;
                    return;
                }

                searchList.AddRange(resultS.Result);
                dgt_searchResult.ItemsSource = resultS.Result;
            };
            accueilshearch.GET_OPENING_DAYSAsync(critere);
        }