private void VerificationDeConnexion(string baseDonnee, string Machine, string userId, string Password)
        {
            string providerName = "SqlClient Data Provider";

            Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient client = new Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration"));
            client.TestBaseDistanteCompleted += (ss, res) =>
            {
                if (res.Cancelled || res.Error != null)
                {
                    string error = res.Error.Message;
                    Message.ShowError(error, Galatee.Silverlight.Resources.Langue.errorTitle);
                    return;
                }
                EtatConnction = res.Result;
                if (res.Result != false)
                {
                    Message.ShowInformation("Connection reussi", Galatee.Silverlight.Resources.Langue.informationTitle);
                    OKButton.IsEnabled = true;
                    return;
                }
                else
                {
                    Message.ShowInformation("Connection  echouer,veuillez contacter le partenaire,puis verifiez les paramettres de connection", Galatee.Silverlight.Resources.Langue.informationTitle);
                    return;
                }
            };
            client.TestBaseDistanteAsync("", providerName, Machine, baseDonnee, userId, Password);
        }
        private void RetournePoste(List<int> lstIdCentrePerimetre)
        {
            //if (SessionObject.ListePoste != null && SessionObject.ListePoste.Count != 0)
            //{
            //    SessionObject.ListePoste.ForEach(t => t.IsSelect = false);
            //    List<ServiceAdministration.CsPoste> lstPoste =SessionObject.ListePoste.Where(t => lstIdCentrePerimetre.Contains(t.FK_IDCENTRE.Value)).ToList();
            //    dtg_Poste.ItemsSource = null;
            //    dtg_Poste.ItemsSource = lstPoste;
            //    return;
            //}
            Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient prgram = new Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration"));
            prgram.RetourneListePosteCompleted += (sprog, resprog) =>
            {
                try
                {
                    if (resprog.Cancelled || resprog.Error != null)
                    {
                        string error = resprog.Error.Message;
                    }
                    if (resprog.Result == null || resprog.Result.Count == 0)
                    {
                    }
                    else
                    {
                        dtg_Poste.ItemsSource = null;
                        SessionObject.ListePoste = resprog.Result;
                        List<ServiceAdministration.CsPoste> lstPoste = SessionObject.ListePoste.Where(t => lstIdCentrePerimetre.Contains(t.FK_IDCENTRE.Value)).ToList();
                        dtg_Poste.ItemsSource = lstPoste;
                    }
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex.Message, "RetournePoste");
                }

            };
            prgram.RetourneListePosteAsync();
        }
Example #3
0
        void ChargerListeUtilisateur(List <int> lstCentre)
        {
            try
            {
                if (SessionObject.ListeDesUtilisateurs != null && SessionObject.ListeDesUtilisateurs.Count != 0)
                {
                    List <ServiceAdministration.CsUtilisateur> lstUtilisateur = SessionObject.ListeDesUtilisateurs.Where(t => lstCentre.Contains(t.FK_IDCENTRE)).ToList();
                    //ListeUtilisateurReleveur.AddRange(lstUtilisateur.Where(t => t.FONCTION == SessionObject.CodeFonctionReleveur));
                    ListeUtilisateurReleveur.AddRange(lstUtilisateur);
                    return;
                }
                Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient client = new Galatee.Silverlight.ServiceAdministration.AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration"));
                client.RetourneListeAllUserCompleted += (ss, res) =>
                {
                    if (res.Cancelled || res.Error != null)
                    {
                        string error = res.Error.Message;
                        Message.ShowError(error, Galatee.Silverlight.Resources.Langue.errorTitle);
                        return;
                    }

                    if (res.Result == null || res.Result.Count == 0)
                    {
                        Message.ShowInformation(Galatee.Silverlight.Resources.Langue.msgNodata, Galatee.Silverlight.Resources.Langue.informationTitle);
                        return;
                    }
                    SessionObject.ListeDesUtilisateurs = res.Result;
                    List <ServiceAdministration.CsUtilisateur> lstUtilisateur = SessionObject.ListeDesUtilisateurs.Where(t => lstCentre.Contains(t.FK_IDCENTRE)).ToList();
                    //ListeUtilisateurReleveur.AddRange(lstUtilisateur.Where(t => t.FONCTION == SessionObject.CodeFonctionReleveur));
                    ListeUtilisateurReleveur.AddRange(lstUtilisateur);
                };
                client.RetourneListeAllUserAsync();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }