Пример #1
0
        public static void Insert(HomeBox homeBox)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                db.HomeBoxes.Add(homeBox);

                db.SaveChanges();
            }
        }
Пример #2
0
        public static void Update(HomeBox homeBox)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                var orghomeBox = db.HomeBoxes.Where(item => item.ID == homeBox.ID).Single();

                orghomeBox.Title       = homeBox.Title;
                orghomeBox.IsVisible   = homeBox.IsVisible;
                orghomeBox.HomeBoxType = homeBox.HomeBoxType;
                orghomeBox.OrderID     = homeBox.OrderID;
                orghomeBox.LastUpdate  = homeBox.LastUpdate;

                db.SaveChanges();
            }
        }