Exemplo n.º 1
0
 private void GetDataForIndex()
 {
     ViewData["StylePhotograph"] = stylePhotographRepository.GetAll();
     ViewData["BrandSet"]        = brandSetRepository.GetAll();
     ViewData["Wording"]         = wordingRepository.GetAll();
     ViewData["EventType"]       = eventTypeRepository.GetAll();
 }
Exemplo n.º 2
0
        public EventTypeController(IEventTypeRepository eventTypeRepository)
        {
            _eventTypeRepository = eventTypeRepository;

            // TODO Remove before publish
            // Use this block just to create a first fake event type (browser tests) (to run the unit tests it isn´t necessary)
            if (_eventTypeRepository.GetAll().Result.Count == 0)
            {
                var eventType = new EventType("Celebration");

                _eventTypeRepository.Add(eventType);
                _eventTypeRepository.SaveChanges();
            }
        }
        public ViewResult Index()
        {
            if (ClosetState.Flavors == null)
            {
                Response.Redirect(Url.RouteUrl(new { controller = "FlavorSelect", action = "Index" }));
            }

            if (ClosetState.EventTypes != null)
            {
                ViewData["EventTypeSelected"] = ClosetState.EventTypes;
            }

            ViewData["previousUrl"] = Session["previousUrl"];
            return(View(eventTypeRepository.GetAll()));
        }
Exemplo n.º 4
0
        public List <EventType> GetAllEventTypes()
        {
            Result.Reset();

            List <EventType> eventTypes = eventTypeContext.GetAll().ToList();

            if (eventTypes == null)
            {
                Result.CustomMessage = "Could not find the requested EventTypes";
            }

            if (eventTypeContext.Result.IsError)
            {
                Result = eventTypeContext.Result;
                Result.CustomMessage = "There was a problem retrieving the requested EventTypes";
            }

            return(eventTypes);
        }
Exemplo n.º 5
0
 public List <EventType> GetAllTypes()
 {
     return(eventTypeRepository.GetAll());
 }
Exemplo n.º 6
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());
        }
Exemplo n.º 7
0
 public IEnumerable <EventTypeDto> Get()
 {
     return(Mapper.Map <List <EventType>, List <EventTypeDto> >(_eventTypeRepository.GetAll().Result));
 }
Exemplo n.º 8
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());
        }