public JsonResult AddToCloset(WishListSelection wls) { closetRepository.DbContext.BeginTransaction(); // Remove from Wish List Garment g = new MasterGarment(wls.GarmentId); WishList wl = wishListRepository.GetForUser(this.ProxyLoggedUser); wl.RemoveWishGarment(new WishGarment(wls.WishListId)); // Add to closet Closet c = closetRepository.Get(this.ClosetId); c.AddGarment(g); closetRepository.DbContext.CommitTransaction(); List <int> ids = new List <int>(); ids.Add(wls.GarmentId); // Update the closet combinations (new FashionAde.Utils.OutfitEngineService.OutfitEngineServiceClient()).AddOutfits(this.ClosetId, ids); return(Json(new { Success = true })); }
public jsonGarment(MasterGarment garment) { this.id = garment.Id; this.title = garment.Title; this.imageUri = garment.ImageUri; }