Exemplo n.º 1
0
        private void SaveCampane(List <CsLclient> ListFacturation, CsRegCli csRegCli, int?ID_USER)
        {
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.SaveCampaneCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowInformation("L'enregistrement ne c'est pas correctement effecaion veuillez refaire l'opération", "Recouvremen");
                }


                if (chb_AvisDeCredit.IsChecked == true)
                {
                    DetailCampagneGc = (List <CsDetailCampagneGc>)args.Result.First().Valeur;
                    Listid.Add(int.Parse(args.Result.First().Key.ToString().Split('.')[0]));
                    Shared.ClasseMEthodeGenerique.InitWOrkflow((args.Result.First().Key.ToString().Split('.')[0]), UserConnecte.FK_IDCENTRE, "Galatee.Silverlight.Recouvrement.FrmInitailisationCampagne", args.Result.First().Key.ToString().Split('.')[1], SaveMandatement, DetailCampagneGc);
                }
                else
                {
                    Shared.ClasseMEthodeGenerique.InitWOrkflow(args.Result.First().Key.ToString().Split('.')[0], UserConnecte.FK_IDCENTRE, "Galatee.Silverlight.Recouvrement.FrmInitailisationCampagne", args.Result.First().Key.ToString().Split('.')[1]);
                }
                Message.ShowInformation("L'enregistrement effecaion avec succes", "Recouvremen");

                return;
            };
            service.SaveCampaneAsync(ListFacturation, csRegCli, ID_USER);
        }
Exemplo n.º 2
0
        public UcRegCli(object[] pObjects, SessionObject.ExecMode[] pExecMode, DataGrid[] pGrid)
        {
            try
            {
                InitializeComponent();
                Translate();
                var categorieClient = new CsRegCli();
                if (pObjects[0] != null)
                {
                    ObjetSelectionnee = Utility.ParseObject(categorieClient, pObjects[0] as CsRegCli);
                }
                ModeExecution = pExecMode[0];
                dataGrid      = pGrid[0];
                if (dataGrid != null)
                {
                    donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsRegCli>;
                }
                InitialisationControle();
                this.Txt_Regroupement.MaxLength = SessionObject.Enumere.TailleCodeRegroupement;

                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation)
                {
                    AllInOne.ActivateControlsFromXaml(LayoutRoot, false);
                }
                VerifierSaisie();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.RegroupementClient);
            }
        }
Exemplo n.º 3
0
 private bool Insert(CsRegCli pRegCli)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.REGROUPEMENT>(Entities.ConvertObject <Galatee.Entity.Model.REGROUPEMENT, CsRegCli>(pRegCli)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public bool Delete(CsRegCli pRegCli)
 {
     try
     {
         return(Entities.DeleteEntity <Galatee.Entity.Model.REGROUPEMENT>(Entities.ConvertObject <Galatee.Entity.Model.REGROUPEMENT, CsRegCli>(pRegCli)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        //Recherche des factures sen fonction des critère entré
        private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit)
        {
            //Activation du busy indicator
            allowProgressBar();

            //Grisé certain éléments du formulaire pour bloqué certainnes actions
            ActiverElement(false);

            //Exécution du service web recupération des factures
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureAvecProduitCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                Lstfacture = args.Result;
                if (this.Anciennecamp != null)
                {
                    foreach (var item_ in this.Anciennecamp)
                    {
                        foreach (var item in item_.DETAILCAMPAGNEGC_)
                        {
                            CsLclient facture = new CsLclient();
                            facture.CENTRE       = item.CENTRE;
                            facture.CLIENT       = item.CLIENT;
                            facture.ORDRE        = item.ORDRE;
                            facture.NOM          = item.NOM;
                            facture.REFEM        = item.PERIODE;
                            facture.SOLDEFACTURE = item.MONTANT;
                            facture.NDOC         = item.NDOC;
                            Lstfacture.Add(facture);
                        }
                    }
                }

                System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                if (dg_facture.ItemsSource != null)
                {
                    this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
                }

                btn_Rech.IsEnabled = true;
                desableProgressBar();
                ActiverElement(true);

                return;
            };
            service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit);
        }
        private void Remplirfacture(CsRegCli csRegCli, List <string> listperiode)
        {
            allowProgressBar();
            ActiverElement(false);
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                Lstfacture = args.Result;
                if (this.Anciennecamp != null)
                {
                    foreach (var item_ in this.Anciennecamp)
                    {
                        foreach (var item in item_.DETAILCAMPAGNEGC_)
                        {
                            CsLclient facture = new CsLclient();
                            facture.CENTRE       = item.CENTRE;
                            facture.CLIENT       = item.CLIENT;
                            facture.ORDRE        = item.ORDRE;
                            facture.NOM          = item.NOM;
                            facture.REFEM        = item.PERIODE;
                            facture.SOLDEFACTURE = item.MONTANT;
                            facture.NDOC         = item.NDOC;
                            Lstfacture.Add(facture);
                        }
                    }
                }

                System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                if (dg_facture.ItemsSource != null)
                {
                    this.txt_TotalFacture.Text = Lstfacture.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);
                }

                btn_Rech.IsEnabled = true;
                desableProgressBar();
                ActiverElement(true);

                return;
            };
            service.RemplirfactureAsync(csRegCli, listperiode);
        }
Exemplo n.º 7
0
        private List <CsRegCli> GetInformationsFromScreen()
        {
            var listObjetForInsertOrUpdate = new List <CsRegCli>();

            try
            {
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
                {
                    var regCli = new CsRegCli();
                    regCli.CODE         = Txt_Regroupement.Text;
                    regCli.BUREAU       = Txt_Bureau.Text;
                    regCli.CODPOS       = Txt_CodePostal.Text;
                    regCli.NOM          = Txt_Libelle.Text;
                    regCli.ADR1         = Txt_Adresse1.Text;
                    regCli.ADR2         = Txt_Adresse2.Text;
                    regCli.TRAITFAC     = Txt_Traitement.Text;
                    regCli.DATECREATION = DateTime.Now;
                    regCli.USERCREATION = UserConnecte.matricule;
                    if (!string.IsNullOrEmpty(Txt_Regroupement.Text) && donnesDatagrid.FirstOrDefault(p => p.CODE == regCli.CODE) != null)
                    {
                        throw new Exception(Languages.CetElementExisteDeja);
                    }
                    listObjetForInsertOrUpdate.Add(regCli);
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
                {
                    ObjetSelectionnee.CODE         = Txt_Regroupement.Text;
                    ObjetSelectionnee.BUREAU       = Txt_Bureau.Text;
                    ObjetSelectionnee.CODPOS       = Txt_CodePostal.Text;
                    ObjetSelectionnee.NOM          = Txt_Libelle.Text;
                    ObjetSelectionnee.ADR1         = Txt_Adresse1.Text;
                    ObjetSelectionnee.ADR2         = Txt_Adresse2.Text;
                    ObjetSelectionnee.TRAITFAC     = Txt_Traitement.Text;
                    ObjetSelectionnee.DATECREATION = DateTime.Now;
                    ObjetSelectionnee.USERCREATION = UserConnecte.matricule;
                    listObjetForInsertOrUpdate.Add(ObjetSelectionnee);
                }
                return(listObjetForInsertOrUpdate);
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.RegroupementClient);
                return(null);
            }
        }
 private void VerifierCampagneExiste(CsRegCli csRegCli, string periode)
 {
     Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
     service.VerifierCampagneExisteCompleted += (s, args) =>
     {
         if (args != null && args.Cancelled)
         {
             return;
         }
         if (args.Result == null)
         {
             return;
         }
         FrmCampagne frm = new FrmCampagne(args.Result);
         frm.CallBack += frm_CallBack;
         frm.Closing  += frm_Closing;
         frm.Show();
         return;
     };
     service.VerifierCampagneExisteAsync(csRegCli, periode);
 }
        private void SaveCampane(List <CsLclient> ListFacturation, CsRegCli csRegCli, int?ID_USER)
        {
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.SaveCampaneCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result == null)
                {
                    Message.ShowInformation("L'enregistrement ne c'est pas correctement effecaion veuillez refaire l'opération", "Recouvremen");
                }
                Shared.ClasseMEthodeGenerique.InitWOrkflow(args.Result.Split('.')[0], UserConnecte.FK_IDCENTRE, "Galatee.Silverlight.Recouvrement.FrmInitailisationCampagne", args.Result.Split('.')[1]);

                Message.ShowInformation("L'enregistrement effecaion avec succes", "Recouvremen");

                return;
            };
            service.SaveCampaneAsync(ListFacturation, csRegCli, ID_USER);
        }
Exemplo n.º 10
0
 private void UpdateParentList(CsRegCli pRegCli)
 {
     try
     {
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
         {
             GetDataNew();
             //donnesDatagrid.Add(pRegCli);
             //donnesDatagrid.OrderBy(p => p.PK_ID);
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
         {
             GetDataNew();
             //var regCli = donnesDatagrid.First(p => p.PK_ID == pRegCli.PK_ID);
             //donnesDatagrid.Remove(regCli);
             //donnesDatagrid.Add(pRegCli);
             //donnesDatagrid.OrderBy(p => p.PK_ID);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        //Recherche des factures sen fonction des critère entré
        private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit)
        {
            //Activation du busy indicator
            allowProgressBar();

            //Grisé certain éléments du formulaire pour bloqué certainnes actions
            ActiverElement(false);

            //Exécution du service web recupération des factures
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureAvecProduitCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                List <CsLclient> lstFactureGeneral = new List <CsLclient>();
                List <CsLclient> lstFactureExist   = new List <CsLclient>();
                lstFactureGeneral = args.Result;

                /*LKO  15/01/2021 VERFICATION DE DOUBLON A LA CREATION D'UNE CAMPAGNE */
                if (lstFactureGeneral != null && lstFactureGeneral.Count != 0)
                {
                    lstFactureExist = lstFactureGeneral.Where(t => t.IsPAIEMENTANTICIPE).ToList();
                    Lstfacture      = lstFactureGeneral.Where(t => !t.IsPAIEMENTANTICIPE).ToList();
                }
                if (lstFactureExist != null && lstFactureExist.Count != 0)
                {
                    List <object> _LstObj = new List <object>();
                    _LstObj = ClasseMEthodeGenerique.RetourneListeObjet(lstFactureExist);
                    Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>();
                    _LstColonneAffich.Add("NUMDEM", "CAMPAGNE");
                    _LstColonneAffich.Add("CENTRE", "CENTRE");
                    _LstColonneAffich.Add("CLIENT", "CLIENT");
                    _LstColonneAffich.Add("ORDRE", "ORDRE");
                    _LstColonneAffich.Add("NDOC", "NUM FACTURE");
                    _LstColonneAffich.Add("REFEM", "PERIODE");

                    List <object> obj = Shared.ClasseMEthodeGenerique.RetourneListeObjet(_LstObj);
                    MainView.UcListeClientMultiple ctrl = new MainView.UcListeClientMultiple(obj, _LstColonneAffich, false, "Liste des factures deja dans une campagne");
                    ctrl.Closed += new EventHandler(galatee_OkClickedChoixClient);
                    ctrl.Show();
                    return;
                }    /*****/
                else
                {
                    if (this.Anciennecamp != null)
                    {
                        foreach (var item_ in this.Anciennecamp)
                        {
                            foreach (var item in item_.DETAILCAMPAGNEGC_)
                            {
                                CsLclient facture = new CsLclient();
                                facture.CENTRE       = item.CENTRE;
                                facture.CLIENT       = item.CLIENT;
                                facture.ORDRE        = item.ORDRE;
                                facture.NOM          = item.NOM;
                                facture.REFEM        = item.PERIODE;
                                facture.SOLDEFACTURE = item.MONTANT;
                                facture.NDOC         = item.NDOC;
                                Lstfacture.Add(facture);
                            }
                        }
                    }

                    System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                    LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                    if (dg_facture.ItemsSource != null)
                    {
                        this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
                    }

                    btn_Rech.IsEnabled = true;
                    desableProgressBar();
                    ActiverElement(true);

                    return;
                }
            };
            service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit);
        }