public void AddToCart(Car car) { appDbContent.ShopCartItem.Add(new ShopCartItem { ShopCartId = ShopCartId, car = car, price = car.Price }); appDbContent.SaveChanges(); }
public void AddToCart(Product product /*, int amount*/) { appDbContent.ShopCartItem.Add(new ShopCartItem { ShopCartId = ShopCartId, product = product, price = product.Price }); appDbContent.SaveChanges(); }
public void CreateCar(Car car) { if (car.Id == 0) { content.Cars.Add(car); } else { Car newCar = content.Cars.FirstOrDefault(p => p.Id == car.Id); newCar.Name = car.Name; newCar.Img1 = car.Img1; newCar.Price = car.Price; newCar.CategoryId = car.CategoryId; newCar.Category = car.Category; } content.SaveChanges(); }
public void AddToCart(Car car) { content.CartItems.Add( new CartItem { Car = car, CarId = car.Id, CartName = CartName } ); content.SaveChanges(); }
public void AddToCart(moto moto) { appDbContent.ShopCartItem.Add(new ShopCartItem { ShopCartId = ShopCartId, moto = moto, price = moto.price }); appDbContent.SaveChanges(); }
public void AddToCart(RentItem rentItem, uint quantity) { this.appDbContent.RentCartItems.Add(new RentCartItem { RentCartId = RentCartId, RentItem = rentItem, Quantity = quantity }); appDbContent.SaveChanges(); }
public void AddCart(Car car) { appDbContent.CartItems.Add( new CartItem { Car = car, Price = car.Price, CartName = CartName } ); appDbContent.SaveChanges(); }
public void AddToCart(Food food) { appDbContent.RapsodyCartItem.Add(new RapsodyCartItem { RapsodyCartId = RapsodyCartId, Food = food, Price = food.Price, }); appDbContent.SaveChanges(); }
public void AddToCart(CarModel car) { appDbContent.CartMarketItem.Add(new CartMarketItem { CartMarketId = CartMarketId, car = car, prise = car.price }); appDbContent.SaveChanges(); }
public void AddToCar(Car Car) { this.appDbContent.ShopCarItem.Add(new ShopCarItem { ShopCarId = ShopCarId, Car = Car, Price = Car.Prise }); appDbContent.SaveChanges(); }
public void Create(Car car) { if (car.Id == 0) { content.Cars.Add(car); } else { Car createCar = content.Cars.FirstOrDefault(p => p.Id == car.Id); if (createCar != null) { createCar.Img = car.Img; createCar.Name = car.Name; createCar.Price = car.Price; } } content.SaveChanges(); }
public void AddToCart(Motorcycle motorcycle) { _appDbContent.ShopCartItem.Add(new ShopCartItem { ShopCartId = ShopCartId, motorcycle = motorcycle, price = motorcycle.price }); _appDbContent.SaveChanges(); }
public void SaveOrder(Order order) { content.Orders.Add(order); content.SaveChanges(); var items = cart.Lines; foreach (var el in items) { content.OrderItems.Add( new OrderItem { Name = el.Car.Name, Quantity = el.Quantity, OrderId = order.Id, Price = el.Car.Price }); } content.SaveChanges(); }
public void Add(Product product) { _appDbContent.ShopCartItems.Add(new ShopCartItem { ShopCartId = Id, Product = product, Price = product.Price }); _appDbContent.SaveChanges(); }
public void AddToCart(Phone phone) { appDbContent.ShopPhoneItem.Add(new ShopPhoneItem { ShopCartId = ShopCartId, phone = phone, Price = phone.Price }); appDbContent.SaveChanges(); }
public void CreateOrder(Order order) { order.orderTime = DateTime.Now; appDbContent.Order.Add(order); appDbContent.SaveChanges(); var items = shopCart.listShopItems; foreach (var el in items) { var orderDetail = new OrderDetail() { CarId = el.car.Id, orderId = order.id, price = (uint)el.car.Price }; appDbContent.OrderDetail.Add(orderDetail); } appDbContent.SaveChanges(); }
public void AddToProduct(Product product) { this.appDbContent.StoreProductItems.Add(new StoreProductItem { ShopProductId = storeProductId, product = product, price = product.price }); appDbContent.SaveChanges(); }
public void AddToCart(Coffe coffe) { _appDbContent.ShopCartItem.Add(new ShopCartItem { ShopCartId = ShopCartId, coffe = coffe, price = coffe.price }); _appDbContent.SaveChanges(); }
public void AddToCart(Laptop laptop, int amount) { appDbContent.ShopCartItem.Add(new ShopCartItem { ShopCartId = CartId, Laptop = laptop, Price = laptop.Price }); appDbContent.SaveChanges(); }
public void CreateOrder(Order order) { order.OlderTime = DateTime.Now; appDbContent.Orders.Add(order); appDbContent.SaveChanges(); var items = shopCar.ListShopItems; foreach (var el in items) { var orderDetail = new OrderDetail() { CarId = el.Car.Id, OrderId = order.Id, Price = el.Car.Prise }; appDbContent.OrderDetails.Add(orderDetail); } appDbContent.SaveChanges(); }
public void createOrder(Order order) { order.orderTime = DateTime.Now; appDbContent.order.Add(order); appDbContent.SaveChanges(); var items = storeProduct.listStoreItems; foreach (var el in items) { var orderDetail = new OrderDetail { productID = el.product.Id, orderID = order.id, price = el.product.price }; appDbContent.orderDetail.Add(orderDetail); } appDbContent.SaveChanges(); }
public void CreateOrder(Order order) { order.OrderTime = DateTime.Now; appDBContent.Order.Add(order); var items = shopCart.listShopPhoneItems; foreach (var item in items) { var orderDetail = new OrderDetail(item.phone.Id, item.phone.Price, order.Id); appDBContent.OrderDetails.Add(orderDetail); } appDBContent.SaveChanges(); }
public void CreateOrder(Order order) { content.Orders.Add(order); cart.ListItems = cart.GetCarts(); var items = cart.ListItems; foreach (var el in items) { content.OrderDetailes.Add( new OrderDetaile { CarId = el.Car.Id }); } content.SaveChanges(); }
public void CreatProduct(Product product, string Way) { var newProduct = new Product { name = product.name, shortDesc = product.shortDesc, longDesc = product.longDesc, img = Way, price = product.price, isFavourite = product.isFavourite, available = product.available, categoryID = product.categoryID }; appDbContent.Products.Add(newProduct); appDbContent.SaveChanges(); }
public void createOrder(Order order) { order.orderTime = DateTime.Now; appDbContent.Order.Add(order); var items = cart.listCartItems; foreach (var item in items) { var orderDetail = new OrderDetail() { CarID = item.car.Id, orderID = order.id, prise = item.car.price }; appDbContent.OrderDetail.Add(orderDetail); } appDbContent.SaveChanges(); }
public void createOrder(Order order) { order.orderTime = DateTime.Now; _appDbContent.Order.Add(order); //var items = shopCart.listShopItems; var items = _appDbContent.ShopCartItem.Include(x => x.motorcycle).AsQueryable(); foreach (var el in items) { var orderDetail = new OrderDetail() { MotorcycleID = el.motorcycleId, orderID = order.id, price = el.price }; _appDbContent.OrderDetail.Add(orderDetail); } _appDbContent.SaveChanges(); }
public void CreateOrder(Order order) { order.OrderTime = DateTime.Now; appDbContent.Order.Add(order); var items = shopCart.ToPayList; foreach (var el in items) { var orderDetail = new OrderDetail() { LaptopId = el.Laptop.Id, OrderId = order.Id, Price = el.Laptop.Price }; appDbContent.OrderDetail.Add(orderDetail); } appDbContent.SaveChanges(); }
public void CreateOrder(Order order) { order.OrderTime = DateTime.Now; appDbContent.Order.Add(order); var items = shopCart.listShopItems; foreach (var el in items) { var orderDetail = new OrderDetail() { ProductId = el.product.Id, OrderId = order.Id, Price = el.product.Price }; appDbContent.OrderDetail.Add(orderDetail); } appDbContent.SaveChanges(); }
public void CreateOrder(Order order) { order.OrderTime = DateTime.Now; _AppDbContent.Orders.Add(order); var items = _RentCart.RentCartList; foreach (var item in items) { var orderDetail = new OrderDetail() { RentItemId = item.RentItem.Id, OrderId = order.Id, Quantity = item.Quantity, ItemPrice = item.RentItem.RentPrice }; _AppDbContent.OrderDetails.Add(orderDetail); } _AppDbContent.SaveChanges(); }