private void MenuItemCommande_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Commande Commande = new Commande();
     Loading.Close();
     Commande.ShowDialog();
 }
 private void ButtonNewArticle_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Article Article = new Article();
     Article.Show();
     Loading.Close();
 }
 private void ButtonImport_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Import Import = new Import();
     Loading.Close();
     Import.ShowDialog();
 }
 private void MenuItemGamme_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Gamme Gamme = new Gamme();
     Loading.Close();
     Gamme.ShowDialog();
 }
 private void MenuItemClient_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Client Client = new Client();
     Loading.Close();
     Client.ShowDialog();
 }
 private void MenuItemCatalogue_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Catalogue Catalogue = new Catalogue();
     Loading.Close();
     Catalogue.ShowDialog();
 }
 private void MenuItemFournisseur_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Fournisseur Fournisseur = new Fournisseur();
     Loading.Close();
     Fournisseur.ShowDialog();
 }
        private void ButtonClearInvoiceHistory_Click(object sender, RoutedEventArgs e)
        {
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();
            AECInvoiceHistory AECInvoiceHistory = new PRESTACONNECT.AECInvoiceHistory(this.datePickerStart.SelectedDate, this.datePickerEnd.SelectedDate, true);

            Loading.Close();
            AECInvoiceHistory.ShowDialog();
        }
        private void ButtonSendCartPreorder_Click(object sender, RoutedEventArgs e)
        {
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();
            CartPreorder form = new CartPreorder();

            form.ShowDialog();
            Loading.Close();
        }
        private void MenuItemConfiguration_Click(object sender, RoutedEventArgs e)
        {
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();
            PRESTACONNECT.Configuration Configuration = new Configuration();
            Loading.Close();
            Configuration.ShowDialog();

            this.ActiveSupplierMenuItem();
        }
 private void MenuItemArticle_Click(object sender, RoutedEventArgs e)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     //PRESTACONNECT.ArticleListe ArticleListe = new ArticleListe();
     //ArticleListe.Show();
     PRESTACONNECT.Articles view = new Articles();
     Loading.Close();
     view.ShowDialog();
 }
 private void DataGridButtonArticleUpdate_Click(object sender, RoutedEventArgs e)
 {
     if (this.DataGridArticle.SelectedItem != null)
     {
         Model.Local.Article   ArticleSend = this.DataGridArticle.SelectedItem as Model.Local.Article;
         PRESTACONNECT.Loading Loading     = new PRESTACONNECT.Loading();
         Loading.Show();
         PRESTACONNECT.Article Article = new Article(ArticleSend);
         Article.Show();
         Loading.Close();
     }
 }
示例#13
0
        private void ButtonOustanding_Click(object sender, RoutedEventArgs e)
        {
            if (Core.Global.GetConfig().ModuleAECCustomerOutstandingActif)
            {
                PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
                Loading.Show();

                PRESTACONNECT.AECCustomerOutstanding AECCustomerOutstanding = new AECCustomerOutstanding();
                AECCustomerOutstanding.ShowDialog();

                Loading.Close();
            }
        }
        public void LaunchReimportSage()
        {
            if (MessageBox.Show("Lancer la réimportation des données depuis Sage ?", "Réimport Sage",
                                MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes)
            {
                PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
                Loading.Show();

                ReimportArticle ReimportArticle = new ReimportArticle(ListArticles);
                ReimportArticle.ShowDialog();

                Loading.Close();
            }
        }
示例#15
0
 private void ShowItem(int article)
 {
     PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
     Loading.Show();
     PRESTACONNECT.Article Article = new Article(new Model.Local.ArticleRepository().ReadArticle(article));
     Loading.Close();
     Article.ShowDialog();
     #region Refresh ligne article
     // rafraichissement des données affichées pour l'article par rapport à la base de données
     // sans perte du focus nécessaire à la continuité de saisie au clavier (accessibilité)
     Model.Local.Article temp = new Model.Local.ArticleRepository().ReadArticle(article);
     if (temp != null)
     {
         Model.Local.Article select = DataContext.SelectedCatalogItems.FirstOrDefault(a => a.Art_Id == article);
         select.Art_Name      = temp.Art_Name;
         select.Art_Ean13     = temp.Art_Ean13;
         select.Art_Sync      = temp.Art_Sync;
         select.Art_SyncPrice = temp.Art_SyncPrice;
         select.Art_Active    = temp.Art_Active;
         select.Art_Date      = temp.Art_Date;
         select.Art_Type      = temp.Art_Type;
         select.Pre_Id        = temp.Pre_Id;
         if (temp.prestashopProduct != null)
         {
             select.RefreshPrestashopProductData();
         }
         if (temp.TypeArticle == Model.Local.Article.enum_TypeArticle.ArticleComposition)
         {
             select.TypeArticle = Model.Local.Article.enum_TypeArticle.defaut;
             if (temp.CompositionArticle != null)
             {
                 List <int> list_composition = temp.CompositionArticle.Select(ca => ca.ComArt_F_ARTICLE_SagId).ToList();
                 foreach (Model.Local.Article composition in DataContext.SelectedCatalogItems.Where(a => list_composition.Contains(a.Sag_Id)))
                 {
                     Model.Local.Article temp_compo = new Model.Local.ArticleRepository().ReadArticle(composition.Art_Id);
                     composition.Art_Sync      = temp_compo.Art_Sync;
                     composition.Art_SyncPrice = temp_compo.Art_SyncPrice;
                     composition.Art_Active    = temp_compo.Art_Active;
                     composition.Art_Date      = temp_compo.Art_Date;
                 }
             }
         }
     }
     else
     {
         DataContext.LoadSelectedCatalogItems();
     }
     #endregion
 }
示例#16
0
 public void OpenLienConditionnement()
 {
     try
     {
         PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
         Loading.Show();
         LienConditionnement form = new LienConditionnement();
         Loading.Close();
         form.ShowDialog();
     }
     catch (Exception ex)
     {
         Core.Error.SendMailError(ex.ToString());
     }
 }
示例#17
0
        private void ButtonSync_Click(object sender, RoutedEventArgs e)
        {
            if (this.isValid == false)
            {
                MessageBoxResult Result = MessageBox.Show("Voulez vous enregistrer votre fournisseur en cours ?", "Fournisseur", MessageBoxButton.YesNo);
                if (Result == MessageBoxResult.Yes)
                {
                    this.ButtonSubmit_Click(sender, e);
                }
            }
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();
            SynchronisationFournisseur Sync = new SynchronisationFournisseur();

            Sync.ShowDialog();
            Loading.Close();
        }
        internal void Sync()
        {
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();
            if (SyncSelected && SelectedCatalog != null)
            {
                List <int> selection = Catalogs.Where(c => c.ChildrenContainsCatalog(SelectedCatalog.Cat_Id)).Select(c => c.Cat_Id).ToList();
                selection.Add(SelectedCatalog.Cat_Id);
                SynchronisationCatalogue Sync = new SynchronisationCatalogue(selection);
                Sync.ShowDialog();
            }
            else
            {
                SynchronisationCatalogue Sync = new SynchronisationCatalogue();
                Sync.ShowDialog();
            }

            Loading.Close();
        }
示例#19
0
        private void buttonSyncPayment_Click(object sender, RoutedEventArgs e)
        {
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();

            DateTime?filtre = null, old_config = Core.Global.GetConfig().ConfigCommandeFiltreDate;

            if (DataContext.SyncDay)
            {
                filtre = DateTime.Now.Date;
            }
            else if (DataContext.SyncWeek)
            {
                filtre = DateTime.Now.Date.AddDays(-7);
            }
            else if (DataContext.SyncMonth)
            {
                filtre = DateTime.Now.Date.AddMonths(-1);
            }

            if (filtre != null)
            {
                Core.Global.GetConfig().UpdateConfigCommandeFiltreDate(filtre, true);
            }

            SynchronisationPaiement form = new SynchronisationPaiement();

            form.ShowDialog();

            Loading.Close();

            if (filtre != null)
            {
                Core.Global.GetConfig().UpdateConfigCommandeFiltreDate(old_config, true);
            }
        }
示例#20
0
        private void ButtonSync_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
                Loading.Show();


                DateTime?filtre = null, old_config = Core.Global.GetConfig().ConfigCommandeFiltreDate;
                if (DataContext.SyncDay)
                {
                    filtre = DateTime.Now.Date;
                }
                else if (DataContext.SyncWeek)
                {
                    filtre = DateTime.Now.Date.AddDays(-7);
                }
                else if (DataContext.SyncMonth)
                {
                    filtre = DateTime.Now.Date.AddMonths(-1);
                }

                if (filtre != null)
                {
                    Core.Global.GetConfig().UpdateConfigCommandeFiltreDate(filtre, true);
                }


                if (Core.Global.GetConfig().ConfigBToC)
                {
                    PRESTACONNECT.SynchronisationClient SynchronisationClient = new SynchronisationClient();
                    SynchronisationClient.ShowDialog();
                }

                PRESTACONNECT.SynchronisationLivraison SynchronisationLivraison = new SynchronisationLivraison();
                SynchronisationLivraison.ShowDialog();


                if (filtre != null)
                {
                    Core.Global.GetConfig().UpdateConfigCommandeFiltreDate(old_config, true);
                }

                Loading.Close();

                if (this.TabItemClientBToC.IsEnabled)
                {
                    Core.Temp.ListLocalCustomer  = new Model.Local.CustomerRepository().List();
                    Core.Temp.ListF_COMPTET_BtoB = new Model.Sage.F_COMPTETRepository().ListBtoB((short)ABSTRACTION_SAGE.F_COMPTET.Obj._Enum_CT_Type.Client);

                    Model.Prestashop.PsCustomerRepository PsCustomerRepository = new Model.Prestashop.PsCustomerRepository();

                    this.DataGridClient.ItemsSource = (Core.Global.GetConfig().ConfigClientFiltreCommande)
                                ? PsCustomerRepository.ListTopActiveOrderByDateAdd(60, 1, Core.Global.CurrentShop.IDShop)
                                : PsCustomerRepository.ListTopActiveOrderByDateAddWithOrder(60, 1, Core.Global.CurrentShop.IDShop);
                }
            }
            catch (Exception ex)
            {
                Core.Error.SendMailError(ex.ToString());
            }
        }
        public void CreateCompositionArticle()
        {
            if (SelectedResultSearchCompositionArticle != null)
            {
                Model.Sage.F_ARTICLE F_ARTICLE = new Model.Sage.F_ARTICLERepository().ReadArticle(SelectedResultSearchCompositionArticle.cbMarq);
                if (F_ARTICLE != null)
                {
                    Model.Local.ArticleRepository ArticleRepository = new Model.Local.ArticleRepository();

                    string dft = Core.Global.RemovePurge(SelectedResultSearchCompositionArticle.AR_Design, 255);

                    Model.Local.Article Article = new Model.Local.Article()
                    {
                        Art_Name              = dft,
                        Art_Type              = (short)Model.Local.Article.enum_TypeArticle.ArticleComposition,
                        Art_Description       = SelectedResultSearchCompositionArticle.AR_Design,
                        Art_Description_Short = SelectedResultSearchCompositionArticle.AR_Design,
                        Art_MetaTitle         = dft,
                        Art_MetaDescription   = dft,
                        Art_MetaKeyword       = Core.Global.RemovePurgeMeta(dft, 255),
                        Art_LinkRewrite       = Core.Global.ReadLinkRewrite(dft),
                        Art_Active            = Core.Global.GetConfig().ImportArticleStatutActif,
                        Art_Date              = DateTime.Now,
                        Art_Solde             = false,
                        Art_Sync              = false,
                        Sag_Id              = 0,
                        Cat_Id              = 0,
                        Art_RedirectType    = new Model.Internal.RedirectType(Core.Parametres.RedirectType.NoRedirect404).Page,
                        Art_RedirectProduct = 0,
                        // champs non renseignés pour les compositions
                        Art_Pack  = false,
                        Art_Ref   = string.Empty,
                        Art_Ean13 = string.Empty,
                    };

                    Core.ImportSage.ImportArticle ImportArticle = new Core.ImportSage.ImportArticle();
                    Article.Cat_Id = ImportArticle.ReadCatalog(F_ARTICLE);

                    if (Article.Cat_Id == 0 && Core.Temp.selectedcatalog_composition != 0)
                    {
                        Article.Cat_Id = Core.Temp.selectedcatalog_composition;
                    }

                    if (Article.Cat_Id != 0)
                    {
                        ArticleRepository.Add(Article);

                        ImportArticle.AssignCatalog(0, Article.Cat_Id, Article, Core.Global.GetConfig().ImportArticleRattachementParents);

                        Core.ImportSage.ImportStatInfoLibreArticle ImportStatInfoLibreArticle = new Core.ImportSage.ImportStatInfoLibreArticle();
                        ImportStatInfoLibreArticle.ImportValues(Article, F_ARTICLE.AR_Ref);

                        PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
                        Loading.Show();

                        Core.Temp.selected_taxe_composition  = SelectedF_TAXE;
                        Core.Temp.reference_sage_composition = F_ARTICLE.AR_Ref;
                        Core.Temp.designation_composition    = F_ARTICLE.AR_Design;

                        PRESTACONNECT.Article Form = new Article(Article);
                        Loading.Close();
                        Form.ShowDialog();

                        if (FilterComposition)
                        {
                            SearchArticleComposition();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Aucune correspondance catalogue n'a été trouvée !", "Lien catalogue absent", MessageBoxButton.OK, MessageBoxImage.Stop);
                    }
                }
            }
        }
示例#22
0
        private void Sync(bool Sage, bool Prestashop)
        {
            PRESTACONNECT.Loading Loading = new PRESTACONNECT.Loading();
            Loading.Show();

            DateTime?filtre = null, old_config = Core.Global.GetConfig().ConfigCommandeFiltreDate;

            if (DataContext.SyncDay)
            {
                filtre = DateTime.Now.Date;
            }
            else if (DataContext.SyncWeek)
            {
                filtre = DateTime.Now.Date.AddDays(-7);
            }
            else if (DataContext.SyncMonth)
            {
                filtre = DateTime.Now.Date.AddMonths(-1);
            }

            if (filtre != null)
            {
                Core.Global.GetConfig().UpdateConfigCommandeFiltreDate(filtre, true);
            }

            if (Sage)
            {
                if (Core.Global.GetConfig().ConfigBToC)
                {
                    PRESTACONNECT.SynchronisationClient SynchronisationClient = new SynchronisationClient();
                    SynchronisationClient.ShowDialog();
                }

                PRESTACONNECT.SynchronisationLivraison SynchronisationLivraison = new SynchronisationLivraison();
                SynchronisationLivraison.ShowDialog();

                PRESTACONNECT.SynchronisationCommande Sync = new SynchronisationCommande(filtre);
                Sync.ShowDialog();
            }

            if (Prestashop && Core.Global.GetConfig().HasPrestaShopStateToChange())
            {
                int NJours = 0;
                if (DataContext.SyncDay)
                {
                    NJours = 1;
                }
                else if (DataContext.SyncWeek)
                {
                    NJours = 7;
                }
                else if (DataContext.SyncMonth)
                {
                    NJours = 30;
                }
                PRESTACONNECT.SynchronisationStatutCommande SyncStatut = new SynchronisationStatutCommande(NJours);
                SyncStatut.ShowDialog();
            }

            Loading.Close();

            if (filtre != null)
            {
                Core.Global.GetConfig().UpdateConfigCommandeFiltreDate(old_config, true);
            }

            Actualiser();
        }