コード例 #1
0
        public ActionResult UploadGarment()
        {
            MembershipUser mu = Membership.GetUser();

            if (mu != null)
            {
                ViewData["UserName"] = mu.UserName;
            }

            RegisteredUser user = registeredUserRepository.GetByMembershipId(Convert.ToInt32(mu.ProviderUserKey));

            IList <FashionFlavor> flavors = new List <FashionFlavor>();

            foreach (UserFlavor flavor in user.UserFlavors)
            {
                flavors.Add(flavor.Flavor);
            }
            ViewData["FashionFlavors"] = flavors;

            IList <FashionAde.Core.Clothing.Color> colors = colorRepository.GetAll();
            List <SelectListItem> lstcolors = new List <SelectListItem>();

            foreach (FashionAde.Core.Clothing.Color color in colors)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = color.Description;
                sl.Value = color.Id.ToString();
                lstcolors.Add(sl);
            }
            ViewData["Colors"] = lstcolors;

            IList <Pattern>       patterns    = patternRepository.GetAll();
            List <SelectListItem> lstPatterns = new List <SelectListItem>();

            foreach (Pattern pattern in patterns)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = pattern.Description;
                sl.Value = pattern.Id.ToString();
                lstPatterns.Add(sl);
            }
            ViewData["Patterns"] = lstPatterns;

            IList <Fabric>        fabrics    = fabricRepository.GetAll();
            List <SelectListItem> lstFabrics = new List <SelectListItem>();

            foreach (Fabric fabric in fabrics)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = fabric.Description;
                sl.Value = fabric.Id.ToString();
                lstFabrics.Add(sl);
            }
            ViewData["Fabrics"] = lstFabrics;

            IList <Silouhette>    silouhettes    = silouhetteRepository.GetAll();
            List <SelectListItem> lstsilouhettes = new List <SelectListItem>();

            foreach (Silouhette silouhette in silouhettes)
            {
                SelectListItem sl = new SelectListItem();

                sl.Text  = silouhette.Category.Description + " " + silouhette.Description;
                sl.Value = silouhette.Id.ToString();
                lstsilouhettes.Add(sl);
            }
            ViewData["Titles"] = lstsilouhettes;

            IList <EventType>     eventTypes    = eventTypeRepository.GetAll();
            List <SelectListItem> lsteventTypes = new List <SelectListItem>();

            foreach (EventType type in eventTypes)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = type.Description;
                sl.Value = type.Id.ToString();
                lsteventTypes.Add(sl);
            }
            ViewData["EventTypes"] = lsteventTypes;

            LoadSeasons();

            return(View());
        }
コード例 #2
0
        public ActionResult Index()
        {
            RegisteredUser user = this.ProxyLoggedUser;

            IList <FashionAde.Core.Clothing.Color> colors = colorRepository.GetAll();
            List <SelectListItem> lstcolors = new List <SelectListItem>();

            foreach (FashionAde.Core.Clothing.Color color in colors)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = color.Description;
                sl.Value = color.Id.ToString();
                lstcolors.Add(sl);
            }
            ViewData["Colors"] = lstcolors;

            IList <Pattern>       patterns    = patternRepository.GetAll();
            List <SelectListItem> lstPatterns = new List <SelectListItem>();

            foreach (Pattern pattern in patterns)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = pattern.Description;
                sl.Value = pattern.Id.ToString();
                lstPatterns.Add(sl);
            }
            ViewData["Patterns"] = lstPatterns;

            IList <Fabric>        fabrics    = fabricRepository.GetAll();
            List <SelectListItem> lstFabrics = new List <SelectListItem>();

            foreach (Fabric fabric in fabrics)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = fabric.Description;
                sl.Value = fabric.Id.ToString();
                lstFabrics.Add(sl);
            }
            ViewData["Fabrics"] = lstFabrics;

            IList <Silouhette>    silouhettes    = silouhetteRepository.GetAll();
            List <SelectListItem> lstsilouhettes = new List <SelectListItem>();

            foreach (Silouhette silouhette in silouhettes)
            {
                SelectListItem sl = new SelectListItem();

                sl.Text  = silouhette.Category.Description + " " + silouhette.Description;
                sl.Value = silouhette.Id.ToString();
                lstsilouhettes.Add(sl);
            }
            ViewData["Titles"] = lstsilouhettes;

            IList <EventType>     eventTypes    = eventTypeRepository.GetAll();
            List <SelectListItem> lsteventTypes = new List <SelectListItem>();

            foreach (EventType type in eventTypes)
            {
                SelectListItem sl = new SelectListItem();
                sl.Text  = type.Description;
                sl.Value = type.Id.ToString();
                lsteventTypes.Add(sl);
            }
            ViewData["EventTypes"] = lsteventTypes;

            LoadSeasons();

            return(View());
        }