Exemplo n.º 1
0
        public ActionResult RemoveGarmentFromCloset(int garmentSelected)
        {
            Closet        closet = closetRepository.Get(this.ClosetId);
            ClosetGarment cg     = new List <ClosetGarment>(closet.Garments).Find(e => e.Id.Equals(garmentSelected));
            Garment       g      = cg.Garment;

            closet.RemoveGarment(cg);
            closetRepository.SaveOrUpdate(closet);
            closetRepository.RemoveGarmentFromCloset(closet.Id, g.Id);
            return(Json(new { Success = true }));
        }
Exemplo n.º 2
0
        public ActionResult RemoveGarmentFromCloset(int garmentSelected)
        {
            MembershipUser mu      = Membership.GetUser();
            RegisteredUser user    = registeredUserRepository.GetByMembershipId(Convert.ToInt32(mu.ProviderUserKey));
            Closet         closet  = user.Closet;
            ClosetGarment  garment = closetRepository.GetClosetGarment(garmentSelected);

            closet.RemoveGarment(garment);
            closetRepository.SaveOrUpdate(closet);
            closetRepository.RemoveGarmentFromCloset(garment.Id, closet.Id);

            return(Json(new { Success = true }));
        }