示例#1
0
        public int Delete(int id)
        {
            int ret = 0;

            using (var superStores = new SuperZapatosEntities2())
            {
                SuperZEnt.Stores art = superStores.Stores.First(x => x.id == id);
                superStores.Stores.Remove(art);
                ret = superStores.SaveChanges();
            }
            return(ret);
        }
示例#2
0
        public int Edit(SuperZEnt.Stores store)
        {
            int ret = 0;

            using (var superStores = new SuperZapatosEntities2())
            {
                SuperZEnt.Stores art = superStores.Stores.First(x => x.id == store.id);
                art.id      = store.id;
                art.name    = store.name;
                art.address = store.address;
                ret         = superStores.SaveChanges();
            }
            return(ret);
        }
示例#3
0
        public int Save(SuperZEnt.Stores store)
        {
            int ret = 0;

            using (var superStores = new SuperZapatosEntities2())
            {
                var stor = superStores.Stores
                           .Where(b => b.id == store.id)
                           .FirstOrDefault();

                if (stor == null)
                {
                    superStores.Stores.Add(store);
                    ret = superStores.SaveChanges();
                }
                else
                {
                    ret = -1;
                }
            }
            return(ret);
        }
示例#4
0
        public bool DeleteStore(SuperZEnt.Stores article)
        {
            IStoresClass art = new StoresClass();

            return(art.Delete(article.id) > 0 ? true : false);
        }
示例#5
0
        public bool EditStore(SuperZEnt.Stores article)
        {
            IStoresClass art = new StoresClass();

            return(art.Edit(article) > 0 ? true : false);
        }
示例#6
0
        public int SaveStore(SuperZEnt.Stores article)
        {
            IStoresClass art = new StoresClass();

            return(art.Save(article));
        }