Exemplo n.º 1
0
        public static void Insert(HomeBoxItem homeBoxItem)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                db.HomeBoxItems.Add(homeBoxItem);

                db.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public static void Update(HomeBoxItem homeBoxItem)
        {
            using (var db = OnlineStoreDbContext.Entity)
            {
                var orghomeBoxItem = db.HomeBoxItems.Where(item => item.ID == homeBoxItem.ID).Single();

                orghomeBoxItem.Title      = homeBoxItem.Title;
                orghomeBoxItem.SubTitle   = homeBoxItem.SubTitle;
                orghomeBoxItem.Filename   = homeBoxItem.Filename;
                orghomeBoxItem.StartDate  = homeBoxItem.StartDate;
                orghomeBoxItem.EndDate    = homeBoxItem.EndDate;
                orghomeBoxItem.Link       = homeBoxItem.Link;
                orghomeBoxItem.IsActive   = homeBoxItem.IsActive;
                orghomeBoxItem.OrderID    = homeBoxItem.OrderID;
                orghomeBoxItem.LastUpdate = homeBoxItem.LastUpdate;
            }
        }