/// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        /// <param name="targetDb"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public string CreateCommand(string data, string targetDb, int type)
        {
            try
            {
                CommandeRepository commandRepos = new CommandeRepository(targetDb);

                DataSet ds = new DataSet();
                ds.ReadXml(new StringReader(data));
                DataTable dt = ds.Tables[0];

                if (type == 0)
                {
                    return(commandRepos.createCommandeDepot(dt, targetDb));
                }
                else if (type == 1)
                {
                    return(commandRepos.createCommandeRetro(dt, targetDb));
                }
                else
                {
                    return(string.Format("ERREUR Type '{0}'", type));
                }
            }
            catch (Exception e)
            {
                EventLog.WriteEntry(log, e.ToString(), EventLogEntryType.Error, 100);
                return(string.Format("ERREUR : {0}", e.Message));
            }
        }
Esempio n. 2
0
        protected void Mock()
        {
            var cache = new InMemoryCache();

            //Mock et mise en cache facture
            FactureRepository lFactureRepository = new FactureRepository();
            IList <Facture>   listeTouteFactures = lFactureRepository.GetFactures();

            cache.GetOrSet("ListeModelFactures", () => listeTouteFactures);

            //Mock et mise en cache commande
            CommandeRepository lCommandeRepository = new CommandeRepository();
            IList <Commande>   listeTouteCommandes = lCommandeRepository.GetCommandes();

            cache.GetOrSet("ListeModelCommandes", () => listeTouteCommandes);

            //Mock et mise en cache client
            ClientRepository lClientRepository = new ClientRepository();
            IList <Client>   listeTousClients  = lClientRepository.GetClients(listeTouteFactures, listeTouteCommandes);

            cache.GetOrSet("ListeModelClient", () => listeTousClients);
        }
Esempio n. 3
0
        private void Fetch(object sender, DoWorkEventArgs e)
        {
            Debug.Print("Fetch");
            cdeRepos = new CommandeRepository();
            CommandeFiltre filtre = new CommandeFiltre()
            {
                CommandeTypes   = SelectedCommandeTypes,
                CommandeStatuts = SelectedCommandeStatuts,
                DateLivPeriode  = DateLivPeriode,
                DateLivFrom     = DateLivFrom,
                DateLivTo       = DateLivTo,
                DateDocFrom     = DateDocFrom,
                Collabo         = Collabo,
                ApcTypes        = SelectectedApcTypes
            };

            switch (SelectedTab)
            {
            case "AllTab":
                Commandes = null;
                Commandes = new ListCollectionView(cdeRepos.GetAll(filtre));
                break;

            case "CmTab":
                CmCommandes = null;
                CmCommandes = new ListCollectionView(cdeRepos.GetAllCm(filtre));
                break;

            case "RecepTab":
                RecepCommandes = null;
                RecepCommandes = new ListCollectionView(cdeRepos.GetAllRecep());
                break;
            }

            Debug.Print("End Fetch");
        }
        public string ToggleVerrou(string db, string doPiece)
        {
            CommandeRepository commandRepos = new CommandeRepository(db);

            return(commandRepos.toggleVerrou(doPiece));
        }
        /// <summary>
        /// Met à jour la pièce après duplication coté client
        /// </summary>
        /// <param name="clientPiece"></param>
        /// <param name="targetDb"></param>
        /// <param name="fournPiece"></param>
        /// <returns></returns>
        public string SetDoRef(string clientPiece, string targetDb, string fournPiece)
        {
            CommandeRepository commandRepos = new CommandeRepository(targetDb);

            return(commandRepos.setDoRef(clientPiece, targetDb, fournPiece));
        }