Example #1
0
        public bool addArticle(BEArticle art)
        {
            bool            res = false;
            bdshoesEntities dc;

            articles nuevo = new articles
            {
                id             = art.id,
                name           = art.name,
                description    = art.description,
                price          = art.price,
                store_id       = art.store_id,
                total_in_shelf = art.total_in_shelf,
                total_in_vault = art.total_in_vault,
            };

            using (dc = new bdshoesEntities())
            {
                dc.articles.Add(nuevo);
                dc.SaveChanges();

                art.id = nuevo.id;

                res = art.id > 0;
            }

            return(res);
        }