Esempio n. 1
0
        void RemplirAgent()
        {
            CTab300 agent;
            RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.Protocole(), Utility.EndPoint("Recouvrement"));

            client.SelectAgentCampagneCompleted += (ss, ee) =>
            {
                try
                {
                    if (ee.Cancelled || ee.Error != null)
                    {
                        string error = ee.Error.Message;
                        Message.Show("Erreur à l'exécution du service", "SelectAgentCampagne");
                        return;
                    }

                    if (ee.Result == null || ee.Result.Count == 0)
                    {
                        Message.Show("Aucune donnée trouvée", "SelectAgentCampagne");
                        return;
                    }

                    List <CTab300> agents = new List <CTab300>();
                    agents.AddRange(ee.Result);

                    if ((agents != null) && (agents.Count > 0))
                    {
                        this.cmbAgent.Items.Clear();
                        foreach (CTab300 a in agents)
                        {
                            agent         = new CTab300();
                            agent.Code    = a.Code;
                            agent.Libelle = a.Libelle;
                            this.cmbAgent.Items.Add(agent);
                        }
                    }
                    //Ligne vide : champ non obligatoire
                    agent      = new CTab300();
                    agent.Code = agent.Libelle = string.Empty;
                    this.cmbAgent.Items.Add(agent);

                    this.cmbAgent.SelectedValue     = "Code";
                    this.cmbAgent.DisplayMemberPath = "Libelle";
                }
                catch (Exception ex)
                {
                    Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                }
            };
            client.SelectAgentCampagneAsync();
        }
Esempio n. 2
0
        void dtpMaj_CalendarClosed(object sender, RoutedEventArgs e)
        {
            try
            {
                var     src            = sender as DatePicker;
                string  comboxselected = string.Empty;
                CTab300 selectedObject = new CTab300();
                if (src != null)
                {
                    string rank = src.Name.Substring(src.Name.Length - 1);
                    rowselectDate[int.Parse(rank)] = src.SelectedDate;

                    donnesDatagrid[int.Parse(rank)].DMAJ = src.SelectedDate;
                    // btnOk.Visibility = System.Windows.Visibility.Visible;

                    CsInit u = donnesDatagrid[int.Parse(rank)];

                    // ajout des element modifies dans la liste des elements modifies

                    if (majData.Count > 0 && majData != null)
                    {
                        if (majData.First(p => p.CENTRE == u.CENTRE && p.ROWID == u.ROWID) != null)
                        {
                            foreach (CsInit t in majData)
                            {
                                if (t.ROWID == u.ROWID)
                                {
                                    t.DMAJ = u.DMAJ;
                                }
                            }
                        }
                        else
                        {
                            majData.Add(u);
                        }
                    }
                    else
                    {
                        majData.Add(u);
                    }
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }