public int InsertOrder(OrderModel orderModel) { var order = MapModelToDbObject(orderModel); dbContext.Orders.InsertOnSubmit(order); dbContext.SubmitChanges(); return(order.OrderID); }
public void DeleteCategory(int ID) { Models.DBObjects.Category categoryToDelete = dbContext.Categories.FirstOrDefault(x => x.CategoryID == ID); if (categoryToDelete != null) { dbContext.Categories.DeleteOnSubmit(categoryToDelete); dbContext.SubmitChanges(); } }
public void InsertAddress(AddressModel addressModel) { dbContext.Addresses.InsertOnSubmit(MapModelToDbObject(addressModel)); dbContext.SubmitChanges(); }
public void InsertPaymentMethod(PaymentMethodModel paymentMethodModel) { dbContext.PaymentMethods.InsertOnSubmit(MapModelToDbObject(paymentMethodModel)); dbContext.SubmitChanges(); }
public void InsertShop(ShopModel shopModel) { dbContext.Shops.InsertOnSubmit(MapModelToDbObject(shopModel)); dbContext.SubmitChanges(); }
public void InsertOrderProduct(OrderProductModel orderProductModel) { dbContext.OrderProducts.InsertOnSubmit(MapModelToDbObject(orderProductModel)); dbContext.SubmitChanges(); }
public void InsertCustomer(CustomerModel customerModel) { dbContext.Customers.InsertOnSubmit(MapModelToDbOject(customerModel)); dbContext.SubmitChanges(); }
public void InsertProduct(ProductModel productModel) { dbContext.Products.InsertOnSubmit(MapModelToDbObject(productModel)); dbContext.SubmitChanges(); }
public void InsertShopPaymentMethod(ShopPaymentMethodModel shopPaymentMethodModel) { dbContext.ShopPaymentMethods.InsertOnSubmit(MapModelToDbObject(shopPaymentMethodModel)); dbContext.SubmitChanges(); }