예제 #1
0
        public ActionResult SaveDetails(WebGarmentDetails detail)
        {
            ClosetGarment garment = closetRepository.GetClosetGarment(detail.ClosetGarmentId);

            if (garment.Details == null)
            {
                garment.Details = new GarmentDetails();
            }
            garment.Details.CareConditions = detail.CareConditions;
            garment.Details.IsTailored     = false;
            if (detail.IsTailored == "True")
            {
                garment.Details.IsTailored = true;
            }
            garment.Details.MadeBy          = detail.MadeBy;
            garment.Details.MadeOf          = detail.MadeOf;
            garment.Details.PurchasedAt     = detail.PurchasedAt;
            garment.Details.PurchasedOn     = Convert.ToDateTime(detail.PurchasedOn);
            garment.Details.StoreConditions = detail.StoreConditions;
            closetRepository.SaveOrUpdateGeneric(garment);

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