public void EditWatch(Watch watch) { _db.Entry(watch).State = EntityState.Modified; //_db.Entry(watch.Brand).State = EntityState.Modified; //foreach (var image in watch.Images) //{ // _db.Entry(image).State = EntityState.Modified; //} _db.SaveChanges(); }
public Image ConvertFileToImageDataAndBind(HttpPostedFileBase file,Watch watch) { Image image = new Image(); image.FileName = file.FileName; image.ImageSize = file.ContentLength; byte[] data = new byte[image.ImageSize]; file.InputStream.Read(data, 0, image.ImageSize); image.ImageData = data; image.WatchId = watch.Id; return image; }
public void AddItem(Watch watch, int quantity) { var line = _cartLines.FirstOrDefault(p => p.Watch.Id == watch.Id); if (line == null) { _cartLines.Add(new CartLine { Watch = watch, Quantity = quantity }); } else { line.Quantity += quantity; } }
public void RemoveDependency(Order order, Watch watch, int quantity) { _orderWatchRepository.RemoveDependency(order, watch, quantity); }
public void RemoveWatchId(Watch watch) { _watchIds.RemoveAll(w => w == watch.Id); }
public void AddWatchId(Watch watch) { var instance = _watchService.GetAllWatches().FirstOrDefault(w => w.Id == watch.Id); if (instance != null) _watchIds.Add(instance.Id); }
public void RemoveItem(Watch watch) { _cartLines.RemoveAll(w => w.Watch.Id==watch.Id); }
public void EditWatch(Watch watch) { _watchRepository.EditWatch(watch); }
public void CreateWatch(Watch watch) { _watchRepository.CreateWatch(watch); }
public void CreateWatch(Watch watch) { _db.Watches.Add(watch); _db.SaveChanges(); }