Ejemplo n.º 1
0
        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 }));
        }
Ejemplo n.º 2
0
 public jsonGarment(MasterGarment garment)
 {
     this.id       = garment.Id;
     this.title    = garment.Title;
     this.imageUri = garment.ImageUri;
 }