private void RechercheDetailCampagne(CsCAMPAGNE IdCampagne)
 {
     try
     {
         RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("Recouvrement"));
         client.RechercheAbonneLierCompleted += (ss, ress) =>
         {
             try
             {
                 if (ress.Cancelled || ress.Error != null)
                 {
                     Message.ShowError("Erreur survenue lors de l'appel service", "Informations");
                     return;
                 }
                 if (ress.Result != null && ress.Result.Count != 0)
                 {
                     List <CsDetailCampagnePrecontentieux> lstDetail = ress.Result;
                     this.lvwResultat.ItemsSource = null;
                     this.lvwResultat.ItemsSource = lstDetail;
                 }
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, "Erreur");
             }
         };
         client.RechercheAbonneLierAsync(IdCampagne);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void lvwResultat_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                OKButton.IsEnabled = true;
                if (_returnvalue)
                {
                    btnOk.IsEnabled = true;
                }
                CampagneSelect = lvwResultat.SelectedItem as CsCAMPAGNE;
                if (!CampagneSelect.IsSelect)
                {
                    CampagneSelect.IsSelect = true;
                }
                else
                {
                    CampagneSelect.IsSelect = false;
                    if (LesCampagneSelect.FirstOrDefault(t => t.IDCOUPURE == CampagneSelect.IDCOUPURE) != null)
                    {
                        LesCampagneSelect.Remove(CampagneSelect);
                    }
                    return;
                }
                if (CampagneSelect != null)
                {
                    this.txtCampagne.Text = CampagneSelect.IDCOUPURE;

                    this.txtSite.Text = CampagneSelect.CODESITE;
                    if (lstSiteCampagne.FirstOrDefault(t => t.CODE == CampagneSelect.CODESITE) != null)
                    {
                        this.cmbSite.SelectedItem = lstSiteCampagne.FirstOrDefault(t => t.CODE == CampagneSelect.CODESITE);
                    }

                    this.txtCentre.Text = CampagneSelect.CENTRE;
                    if (lstCentreCampagne.FirstOrDefault(t => t.CODE == CampagneSelect.CENTRE) != null)
                    {
                        this.cmbCentre.SelectedItem = lstCentreCampagne.FirstOrDefault(t => t.CODE == CampagneSelect.CENTRE);
                    }

                    this.txtAgent.Text = CampagneSelect.MATRICULEPIA;
                    if (lstSiteCampagne.FirstOrDefault(t => t.CODE == CampagneSelect.CODESITE) != null)
                    {
                        this.cmbSite.SelectedItem = lstSiteCampagne.FirstOrDefault(t => t.CODE == CampagneSelect.CODESITE);
                    }


                    this.dtpDate.Text = CampagneSelect.DATECREATION.ToShortDateString();
                }
                if (LesCampagneSelect.FirstOrDefault(t => t.IDCOUPURE == CampagneSelect.IDCOUPURE) == null)
                {
                    LesCampagneSelect.Add(CampagneSelect);
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
            }
        }
 private void cmbCampagne_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (this.cmbCampagne.SelectedItem != null)
     {
         CampagneSelect        = (CsCAMPAGNE)this.cmbCampagne.SelectedItem;
         this.txtCampagne.Text = CampagneSelect.IDCOUPURE;
         this.txtCampagne.Tag  = CampagneSelect.PK_ID;
     }
 }
        void Recherche(CsCAMPAGNE laCampagneSelect)
        {
            try
            {
                prgBar.Visibility = System.Windows.Visibility.Visible;

                List <CsCAMPAGNE> lesCampagne = new List <CsCAMPAGNE>();
                lesCampagne.Add(laCampagneSelect);
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.ListeDesClientAResilierAsync(lesCampagne);
                client.ListeDesClientAResilierCompleted += (ss, args) =>
                {
                    try
                    {
                        this.btnsearch.IsEnabled = true;
                        prgBar.Visibility        = System.Windows.Visibility.Collapsed;
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "SearchCampagne");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "SearchCampagne");
                            return;
                        }

                        List <CsDetailCampagne> detailcampagnes = new List <CsDetailCampagne>();
                        detailcampagnes = args.Result;
                        foreach (CsDetailCampagne item in detailcampagnes)
                        {
                            lesClientCampagne.Add(item);
                        }

                        this.lvwResultat.ItemsSource   = null;
                        this.lvwResultat.ItemsSource   = lesClientCampagne;
                        this.lvwResultat.SelectedIndex = 0;

                        OKButton.Visibility = System.Windows.Visibility.Visible;
                    }
                    catch (Exception ex)
                    {
                        this.btnsearch.IsEnabled = true;

                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List <CsDetailCampagne> PaiementCampagne(CsCAMPAGNE lesCampagnes)
        {
            try
            {
                using (galadbEntities context = new galadbEntities())
                {
                    var query = (
                        from camp in context.DETAILCAMPAGNE
                        join y in context.TRANSCAISSE on camp.FK_IDLCLIENT equals y.FK_IDLCLIENT
                        where
                        camp.IDCOUPURE == lesCampagnes.IDCOUPURE &&
                        y.DTRANS >= lesCampagnes.DATECREATION &&
                        string.IsNullOrEmpty(y.TOPANNUL) &&
                        y.NDOC != "TIMBRE"
                        orderby camp.FK_IDCLIENT
                        select new
                    {
                        camp.CLIENT,
                        camp.CENTRE,
                        camp.ORDRE,
                        camp.CLIENT1.NOMABON,
                        camp.FK_IDCLIENT,
                        camp.MONTANT,
                        camp.PK_ID
                    });

                    var query1 = (
                        from camp in context.DETAILCAMPAGNE
                        join y in context.TRANSCAISB on camp.FK_IDLCLIENT equals y.FK_IDLCLIENT
                        where
                        camp.IDCOUPURE == lesCampagnes.IDCOUPURE &&
                        camp.IDCOUPURE == lesCampagnes.IDCOUPURE &&
                        y.DTRANS >= lesCampagnes.DATECREATION &&
                        string.IsNullOrEmpty(y.TOPANNUL) &&
                        y.NDOC != "TIMBRE"
                        orderby camp.FK_IDCLIENT
                        select new
                    {
                        camp.CLIENT,
                        camp.CENTRE,
                        camp.ORDRE,
                        camp.CLIENT1.NOMABON,
                        camp.FK_IDCLIENT,
                        camp.MONTANT,
                        camp.PK_ID
                    });
                    var dt = Galatee.Tools.Utility.ListToDataTable <object>(query.Union(query1));
                    return(Entities.GetEntityListFromQuery <CsDetailCampagne>(dt).Distinct().ToList());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#6
0
        void Recherche(CsCAMPAGNE laCampagneSelect, CsClient LeClientRechercheSelect)
        {
            try
            {
                RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
                client.RetourneDonneeAnnulationFraisAsync(laCampagneSelect, LeClientRechercheSelect);
                client.RetourneDonneeAnnulationFraisCompleted += (ss, args) =>
                {
                    try
                    {
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.Message;
                            Message.ShowError("Erreur à l'exécution du service", "Recouvrement");
                            return;
                        }

                        if (args.Result == null || args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "Recouvrement");
                            return;
                        }

                        List <CsDetailCampagne> detailcampagnes = new List <CsDetailCampagne>();
                        detailcampagnes = args.Result.Where(t => t.ISNONENCAISSABLE != null).ToList();
                        if (detailcampagnes.Count == 0)
                        {
                            Message.ShowInformation("Aucune donnée trouvée", "Recouvrement");
                            return;
                        }
                        lesClientCampagne.Clear();
                        foreach (CsDetailCampagne item in detailcampagnes)
                        {
                            lesClientCampagne.Add(item);
                        }

                        this.lvwResultat.ItemsSource = null;
                        this.lvwResultat.ItemsSource = lesClientCampagne;
                    }
                    catch (Exception ex)
                    {
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
                    }
                };
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 void galatee_OkClickedCampagne(object sender, EventArgs e)
 {
     Galatee.Silverlight.MainView.UcListeGenerique ctrs = sender as Galatee.Silverlight.MainView.UcListeGenerique;
     if (ctrs.isOkClick)
     {
         this.btnRechercheCampagne.IsEnabled = true;
         CsCAMPAGNE leCampagne = (CsCAMPAGNE)ctrs.MyObject;
         this.txtCampagne.Text = leCampagne.IDCOUPURE;
     }
     else
     {
         this.btnRechercheCampagne.IsEnabled = true;
     }
 }
        private void lvwResultat_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                OKButton.IsEnabled = true;

                CampagneSelect = lvwResultat.SelectedItem as CsCAMPAGNE;
                if (CampagneSelect != null)
                {
                }
                //Campaign = (lvwResultat.SelectedItem as CsCAMPAGNE).IdCoupure;
            }
            catch (Exception ex)
            {
                Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
            }
        }
示例#9
0
 private void lvwResultat_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         OKButton.IsEnabled = true;
         if (_returnvalue)
         {
             btnOk.IsEnabled = true;
         }
         CampagneSelect = lvwResultat.SelectedItem as CsCAMPAGNE;
         if (CampagneSelect != null)
         {
             this.txtCampagne.Text = CampagneSelect.IDCOUPURE;
             this.dtpDate.Text     = CampagneSelect.DATECREATION.ToShortDateString();
         }
         //Campaign = (lvwResultat.SelectedItem as CsCAMPAGNE).IdCoupure;
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
        private void btnsearch_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                CampagneSelect = (CsCAMPAGNE)this.cmbCampagne.SelectedItem;
                if (this.cmbCampagne.SelectedItem != null)
                {
                    lesClientCampagne.Clear();
                    List <CsDetailCampagne> lstCampagne = detailcampagnes.Where(t => t.IDCOUPURE == CampagneSelect.IDCOUPURE).ToList();
                    foreach (CsDetailCampagne item in lstCampagne)
                    {
                        lesClientCampagne.Add(item);
                    }

                    this.lvwResultat.ItemsSource = null;
                    this.lvwResultat.ItemsSource = lesClientCampagne;
                }
            }
            catch (Exception ex)
            {
                Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
            }
        }
示例#11
0
 private void cmbCampagne_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     CampagneSelect = (CsCAMPAGNE)this.cmbCampagne.SelectedItem;
 }
        public List <CsDetailCampagnePrecontentieux> PaiementCampagnePrecontantieux(CsCAMPAGNE lesCampagnes)
        {
            try
            {
                using (galadbEntities context = new galadbEntities())
                {
                    DateTime ladateCampagne = Convert.ToDateTime(lesCampagnes.DATECREATION.ToShortDateString());
                    var      query          = (
                        from camp in context.DETAILCAMPAGNEPRENCONTENTIEUX
                        join y in context.TRANSCAISSE on new { camp.FK_IDCENTRE, camp.CENTRE, camp.CLIENT, camp.ORDRE } equals
                        new { y.FK_IDCENTRE, y.CENTRE, y.CLIENT, y.ORDRE }
                        where
                        camp.IDCAMPAGNE == lesCampagnes.IDCOUPURE &&
                        y.DTRANS >= ladateCampagne &&
                        string.IsNullOrEmpty(y.TOPANNUL) &&
                        y.NDOC != "TIMBRE"
                        orderby camp.FK_IDCLIENT
                        select new
                    {
                        camp.CENTRE,
                        camp.CLIENT,
                        camp.ORDRE,
                        camp.TOURNEE,
                        camp.ORDTOUR,
                        camp.CATEGORIE,
                        camp.SOLDEDUE,
                        camp.USERCREATION,
                        camp.DATECREATION,
                        camp.DATEMODIFICATION,
                        camp.USERMODIFICATION,
                        camp.FK_IDCENTRE,
                        camp.FK_IDCLIENT,
                        camp.FK_IDTOURNEE,
                        camp.FK_IDCATEGORIE,
                        camp.FK_IDCAMPAGNE,
                        camp.CLIENT1.NOMABON,
                        camp.ISINVITATIONEDITER,
                        camp.DATERDV,
                        camp.DATERESILIATION,
                        ADRESSE = camp.CLIENT1.ADRMAND1,
                        camp.CLIENT1.AG.RUE,
                        camp.CLIENT1.AG.PORTE,
                        CODESITE = camp.CENTRE1.SITE.CODE,
                        FK_IDSITE = camp.CENTRE1.FK_IDCODESITE,
                        LIBELLECENTRE = camp.CENTRE1.LIBELLE,
                        LIBELLESITE = camp.CENTRE1.SITE.LIBELLE,
                        SOLDECLIENT = y.MONTANT,
                        DENR = y.DTRANS,
                        camp.PK_ID
                    });

                    var query1 = (
                        from camp in context.DETAILCAMPAGNEPRENCONTENTIEUX
                        join y in context.TRANSCAISB on new { camp.FK_IDCENTRE, camp.CENTRE, camp.CLIENT, camp.ORDRE } equals
                        new { y.FK_IDCENTRE, y.CENTRE, y.CLIENT, y.ORDRE }
                        where
                        camp.IDCAMPAGNE == lesCampagnes.IDCOUPURE &&
                        y.DTRANS >= lesCampagnes.DATECREATION &&
                        string.IsNullOrEmpty(y.TOPANNUL) &&
                        y.NDOC != "TIMBRE"
                        orderby camp.FK_IDCLIENT
                        select new
                    {
                        camp.CENTRE,
                        camp.CLIENT,
                        camp.ORDRE,
                        camp.TOURNEE,
                        camp.ORDTOUR,
                        camp.CATEGORIE,
                        camp.SOLDEDUE,
                        camp.USERCREATION,
                        camp.DATECREATION,
                        camp.DATEMODIFICATION,
                        camp.USERMODIFICATION,
                        camp.FK_IDCENTRE,
                        camp.FK_IDCLIENT,
                        camp.FK_IDTOURNEE,
                        camp.FK_IDCATEGORIE,
                        camp.FK_IDCAMPAGNE,
                        camp.CLIENT1.NOMABON,
                        camp.ISINVITATIONEDITER,
                        camp.DATERDV,
                        camp.DATERESILIATION,
                        ADRESSE = camp.CLIENT1.ADRMAND1,
                        camp.CLIENT1.AG.RUE,
                        camp.CLIENT1.AG.PORTE,
                        CODESITE = camp.CENTRE1.SITE.CODE,
                        FK_IDSITE = camp.CENTRE1.FK_IDCODESITE,
                        LIBELLECENTRE = camp.CENTRE1.LIBELLE,
                        LIBELLESITE = camp.CENTRE1.SITE.LIBELLE,
                        SOLDECLIENT = y.MONTANT,
                        DENR = y.DTRANS,
                        camp.PK_ID
                    });
                    var dt = Galatee.Tools.Utility.ListToDataTable <object>(query.Union(query1));
                    return(Entities.GetEntityListFromQuery <CsDetailCampagnePrecontentieux>(dt).Distinct().ToList());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }