public static void Insert(PriceListSection priceListSection) { using (var db = OnlineStoreDbContext.Entity) { db.PriceListSections.Add(priceListSection); db.SaveChanges(); } }
public static void Update(PriceListSection priceListSection) { using (var db = OnlineStoreDbContext.Entity) { var orgPriceListSection = db.PriceListSections.Where(item => item.ID == priceListSection.ID).Single(); orgPriceListSection.Title = priceListSection.Title; orgPriceListSection.Image = priceListSection.Image; orgPriceListSection.PriceListSectionType = priceListSection.PriceListSectionType; orgPriceListSection.OrderID = priceListSection.OrderID; orgPriceListSection.ColumnID = priceListSection.ColumnID; orgPriceListSection.LastUpdate = priceListSection.LastUpdate; db.SaveChanges(); } }