public static void ModifyResourceCategoryItemOrder(ResourceCategoryItem categoryItem) { using (var context = Exigo.Sql()) { context.Execute(@" UPDATE ExigoWebContext.ResourceCategoryItems SET ItemOrder = @neworder WHERE ItemID = @itemid AND CategoryID = @categoryid ", new { neworder = categoryItem.ItemOrder, itemid = categoryItem.ItemID, categoryid = categoryItem.CategoryID }); } }
public static void CreateResourceCategoryItem(ResourceCategoryItem item) { using (var context = Exigo.Sql()) { context.Execute(@" INSERT ExigoWebContext.ResourceCategoryItems (ItemID, CategoryID, ItemOrder) VALUES (@itemid, @categoryid, @itemorder) ", new { itemid = item.ItemID, categoryid = item.CategoryID, itemorder = item.ItemOrder }); } }