コード例 #1
0
        public ActionResult AddNotateToCloset(OutfitNotate outfitNotate)
        {
            ClosetOutfit outfit = closetOutfitRepository.Get(outfitNotate.OutfitSelected);

            if (StringHelper.IsDateTime(outfitNotate.WornDate))
            {
                IFormatProvider formatProvider = new CultureInfo("en-US");
                outfit.Notate(outfitNotate.Location, Convert.ToDateTime(outfitNotate.WornDate, formatProvider));
                if (outfit.Detail == null)
                {
                    outfit.Detail = new MaxOutfitDetail();
                    outfit.Detail.ClosetOutfit = outfit;
                }
                if (outfit.Detail.WornDate < Convert.ToDateTime(outfitNotate.WornDate, formatProvider))
                {
                    outfit.Detail.WornDate = Convert.ToDateTime(outfitNotate.WornDate, formatProvider);
                    outfit.Detail.Location = outfitNotate.Location;
                }
                else
                {
                    outfitNotate.Location = outfit.Detail.Location;
                    outfitNotate.WornDate = outfit.Detail.WornDate.ToString("MM/dd/yyyy");
                }

                closetOutfitRepository.SaveOrUpdate(outfit);

                // Update index on notate...
                using (SearchEngineService ses = SearchEngineService.GetByCloset(ClosetId))
                    ses.AddEntry(outfit.ToSearchEngineEntry());

                return(Json(new { Success = true, outfitNotate.WornDate, outfitNotate.Location }));
            }

            return(Json(new { Success = false }));
        }
コード例 #2
0
        public ActionResult AddNotateToCloset(OutfitNotate outfitNotate)
        {
            ClosetOutfit outfit = closetOutfitRepository.Get(outfitNotate.OutfitSelected);

            outfit.Notate(outfitNotate.Location, Convert.ToDateTime(outfitNotate.WornDate));
            closetOutfitRepository.SaveOrUpdate(outfit);

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