public bool SaveOptType(console.Models.tbl_OptInType entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tbl_OptInType.Add(entity); result = context.SaveChanges() > 1; } return(result); }
public bool DeleteUser(console.Models.tbl_User entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tbl_User.Remove(entity); result = context.SaveChanges() > 1; } return(result); }
public bool SaveCountry(console.Models.tblCountry entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tblCountries.Add(entity); result = context.SaveChanges() > 1; } return(result); }
public bool DeleteFProduct(console.Models.tblFeaturedProduct entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tblFeaturedProducts.Remove(entity); result = context.SaveChanges() > 1; } return(result); }
public bool DeletePrice(console.Models.btl_ProductPrice entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.btl_ProductPrice.Remove(entity); result = context.SaveChanges() > 1; } return(result); }
public bool DeleteCategory(console.Models.tblProductCategory entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tblProductCategories.Remove(entity); result = context.SaveChanges() > 1; } return(result); }
public bool DeleteDAddress(console.Models.tbl_DelivetyAddresses entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tbl_DelivetyAddresses.Remove(entity); result = context.SaveChanges() > 1; } return(result); }
public bool SaveWishlist(console.Models.tbl_Wishlist entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tbl_Wishlist.Add(entity); result = context.SaveChanges() > 1; } return(result); }
public bool SaveDeliveryOption(console.Models.tbl_DeliveryOptions entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tbl_DeliveryOptions.Add(entity); result = context.SaveChanges() > 1; } return(result); }
public bool SaveBAddress(console.Models.tbl_BillingAddress entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { context.tbl_BillingAddress.Add(entity); result = context.SaveChanges() > 1; } return(result); }
public bool UpdateWishlist(console.Models.tbl_Wishlist entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_Wishlist wishlist = (from w in context.tbl_Wishlist where w.wishlist_id == entity.wishlist_id select w).First(); wishlist.user_id = entity.user_id; result = context.SaveChanges() > 1; } return(result); }
public bool UpdatePrice(console.Models.btl_ProductPrice entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { btl_ProductPrice price = (from p in context.btl_ProductPrice where p.price_id == entity.price_id select p).First(); price.product_price = entity.product_price; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateCategory(console.Models.tblProductCategory entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tblProductCategory cat = (from c in context.tblProductCategories where c.category_id == entity.category_id select c).First(); cat.product_category = entity.product_category; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateDOption(console.Models.tbl_DeliveryOptions entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_DeliveryOptions options = (from d in context.tbl_DeliveryOptions where d.delivery_id == entity.delivery_id select d).First(); options.delivery_option = entity.delivery_option; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateOptType(console.Models.tbl_OptInType entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_OptInType type = (from o in context.tbl_OptInType where o.opt_type_id == entity.opt_type_id select o).First(); type.optin_category = entity.optin_category; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateStatus(console.Models.tbl_OrderStatus entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_OrderStatus status = (from s in context.tbl_OrderStatus where s.status_id == entity.status_id select s).First(); status.status = entity.status; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateFeaturedProd(console.Models.tblFeaturedProduct entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tblFeaturedProduct feature = (from f in context.tblFeaturedProducts where f.feature_id == entity.feature_id select f).First(); feature.active = entity.active; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateCart(console.Models.tbl_Cart entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_Cart cart = (from c in context.tbl_Cart where c.cart_ref == entity.cart_ref select c).First(); cart.cart_ref = entity.cart_ref; cart.cart_total = entity.cart_total; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateOpt(console.Models.tbl_OptIn entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_OptIn opt = (from o in context.tbl_OptIn where o.opt_id == entity.opt_id select o).First(); opt.user_id = entity.user_id; opt.opt_type_id = entity.opt_type_id; result = context.SaveChanges() > 1; } return(result); }
public bool SaveCartItems(List <console.Models.tbl_CartItem> entities) { bool result = false; foreach (var entity in entities) { using (var context = new console.Models.dream_techContext()) { context.tbl_CartItem.Add(entity); result = context.SaveChanges() > 1; } } return(result); }
public bool UpdateContact(console.Models.tbl_CustomerContact entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_CustomerContact contact = (from c in context.tbl_CustomerContact where c.contact_id == entity.contact_id select c).First(); contact.cell_number = entity.cell_number; contact.landline = entity.landline; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateWishlistItem(console.Models.tbl_WishlistItem entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_WishlistItem wishlistItem = (from w in context.tbl_WishlistItem where w.wishlist_item_id == entity.wishlist_item_id select w).First(); wishlistItem.price_id = entity.price_id; wishlistItem.product_id = entity.product_id; wishlistItem.price_id = entity.price_id; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateCartItem(console.Models.tbl_CartItem entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_CartItem cartItem = (from u in context.tbl_CartItem where (u.cart_ref == entity.cart_ref) where (u.product_id == entity.product_id) select u).First(); cartItem.cart_ref = entity.cart_ref; cartItem.product_id = entity.product_id; cartItem.quantity = entity.quantity; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateBAddress(console.Models.tbl_BillingAddress entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_BillingAddress address = (from b in context.tbl_BillingAddress where b.billing_id == entity.billing_id select b).First(); address.address_line = entity.address_line; address.suburb = entity.suburb; address.city = entity.city; address.postal_code = entity.postal_code; address.country_id = entity.country_id; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateProduct(console.Models.tblProduct entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tblProduct product = (from p in context.tblProducts where p.product_id == entity.product_id select p).First(); product.name = entity.name; product.description = entity.description; product.units = entity.units; product.categoty_id = entity.categoty_id; product.price_id = entity.price_id; product.type_id = entity.type_id; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateOrder(console.Models.tbl_Order entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_Order order = (from o in context.tbl_Order where o.order_id == entity.order_id select o).First(); order.user_id = entity.user_id; order.cart_ref = entity.cart_ref; order.order_status_id = entity.order_status_id; order.delivery_address_id = entity.delivery_address_id; order.order_total = entity.order_total; order.promo_id = entity.promo_id; result = context.SaveChanges() > 1; } return(result); }
public bool UpdateUser(console.Models.tbl_User entity) { bool result = false; using (var context = new console.Models.dream_techContext()) { tbl_User user = (from u in context.tbl_User where u.email_address == entity.email_address select u).First(); user.user_name = entity.user_name; user.user_surname = entity.user_surname; user.email_address = entity.email_address; user.password = entity.password; user.delivery_id = entity.delivery_id; user.billing_id = entity.billing_id; user.contact_id = entity.contact_id; result = context.SaveChanges() > 1; } return(result); }