private List <SelectListItem> EditGetColorsListItems() { var colors = new List <SelectListItem>(); colors.AddRange(_colorRepository.GetAll().Select(col => new SelectListItem { Text = col.Title, Value = col.Id.ToString() })); return(colors); }
// GET: Color public ActionResult Index() { var colors = colorRepository.GetAll() .Select(x => new ColorDTO() { ColorID = x.ColorID, ColorName = x.ColorName }) .ToList(); return(Json(colors, JsonRequestBehavior.AllowGet)); }
public BaseSearchDto <ProductDetailDto> GetAll(BaseSearchDto <ProductDetailDto> searchDto) { var productdetailSearch = _repo.GetAll(searchDto); var colors = _colorRepo.GetAll().ToList(); var sizes = _sizeRepo.GetAll().ToList(); var products = _productRepo.GetAll().ToList(); foreach (ProductDetail c in productdetailSearch.result) { c.Product = products.Where(s => s.Id == c.ProductId).FirstOrDefault(); c.Size = sizes.Where(s => s.Id == c.SizeId).FirstOrDefault(); c.Color = colors.Where(s => s.Id == c.ColorId).FirstOrDefault(); } BaseSearchDto <ProductDetailDto> productdetailDtoSearch = new BaseSearchDto <ProductDetailDto> { currentPage = productdetailSearch.currentPage, recordOfPage = productdetailSearch.recordOfPage, totalRecords = productdetailSearch.totalRecords, sortAsc = productdetailSearch.sortAsc, sortBy = productdetailSearch.sortBy, createdDateSort = productdetailSearch.createdDateSort, pagingRange = productdetailSearch.pagingRange, result = _mapper.Map <List <ProductDetailDto> >(productdetailSearch.result) }; return(productdetailDtoSearch); }
public IEnumerable <Color> GetListColor(string filter) { if (!string.IsNullOrEmpty(filter)) { return(_colorRepository.GetMulti(x => x.Name.Contains(filter))); } return(_colorRepository.GetAll()); }
public async Task <IEnumerable <ColorModel> > GetAllColors() { var entitiesList = await _colorRepository.GetAll(); var model = entitiesList?.MapTo <ColorModel>(); return(model); }
public ActionResult Add() { AddVehicleViewModel model = new AddVehicleViewModel(); model.Car = new Car(); model.Makes = _makeRepo.GetAll().ToList(); model.Models = new List <Model>(); model.Types = new List <string>() { "New", "Used" }; model.Tranmissions = _transmissionRepository.GetAll().ToList(); model.Colors = _colorRepo.GetAll().ToList(); model.BodyStyles = _bodyStyleRepository.GetAll().ToList(); return(View("AddVehicle", model)); }
/// <summary> /// Load product all colors /// </summary> /// <returns></returns> public async Task <IEnumerable <ColorPallet> > GetColors() { if (_colors == null) { _colors = await _colorRepository.GetAll(); } return(_colors); }
public Response AddCars(Cars car) { Response response = new Response(); if (carsRepository.GetAll().Any(t => t.Vin == car.Vin)) { response.Success = false; response.Message = "ERROR: Vin already exists"; } if (bodyStyleRepository.GetAll().All(c => c.BodyStyleId != car.BodyStyleId)) { response.Success = false; response.Message = "ERROR: no BodyStyles have id=" + car.BodyStyleId; } else if (carModelRepository.GetAll().All(c => c.CarModelId != car.CarModelId)) { response.Success = false; response.Message = "ERROR: no CarModel have id=" + car.CarId; } else if (carTypeRepository.GetAll().All(c => c.CarTypeId != car.CarTypeId)) { response.Success = false; response.Message = "ERROR: no CarType have id=" + car.CarId; } else if (colorRepository.GetAll().All(c => c.ColorId != car.ColorId)) { response.Success = false; response.Message = "ERROR: no Colors have id=" + car.ColorId; } else if (transmissionRepository.GetAll().All(c => c.TransmissionId != car.TransmissionId)) { response.Success = false; response.Message = "ERROR: no Transmission have id=" + car.TransmissionId; } else if (interiorColorRepository.GetAll().All(c => c.InteriorColorId != car.InteriorColorId)) { response.Success = false; response.Message = "ERROR: no InteriorColor have id=" + car.InteriorColorId; } else { carsRepository.Add(car); response.Success = true; response.Message = "Car added"; } return(response); }
private List <Person> GetPersonsMapped() { _csvService.VerifyAndFormatCsvFile(fileLocationPath); var data = _csvService.GetCsvData(fileLocationPath); var colors = _colorRep.GetAll().ToList(); data.ForEach(x => x.Color = colors.FirstOrDefault(a => a.Id == x.ColorId)); return(data); }
public ProductFullDto GetProductFull(int id) { var product = _productRepo.GetById(id); product.SubCategory = _subCategoryRepo.GetById(product.SubCategoryId); var productFull = _mapper.Map <ProductFullDto>(product); var colors = _colorRepo.GetAll().ToList(); var sizes = _sizeRepo.GetAll().ToList(); var productDetails = _productDetailRepo.GetByProduct(id); foreach (ProductDetail d in productDetails) { d.Color = colors.Where(s => s.Id == d.ColorId).FirstOrDefault(); d.Size = sizes.Where(s => s.Id == d.SizeId).FirstOrDefault(); } var productDetailDtos = _mapper.Map <List <ProductDetailDto> >(productDetails); productFull.ProductDetails = productDetailDtos; return(productFull); }
private OutfitView BuildOutfitView(OutfitSearch outfitSearch, int?userId) { int totalCount; string originalSearch = outfitSearch.Search; bool showAsPublicCloset = ShowAsPublicCloset(userId); RegisteredUser user = (showAsPublicCloset) ? registeredUserRepository.Get(userId.Value) : registeredUserRepository.Get(this.ProxyLoggedUser.Id); BasicUser currentUser = null; if (User.Identity.IsAuthenticated) { currentUser = registeredUserRepository.Get(this.UserId); } if (!AccessClosetService.CanViewCloset(currentUser, user.Closet)) { throw new NotPublicClosetException(); } if (originalSearch == SEARCH_TEXT) { outfitSearch.Search = string.Empty; } GetOutfitsInfo(showAsPublicCloset); IList <ClosetOutfitView> lstResults = new List <ClosetOutfitView>(); lstResults = this.Search(out totalCount, outfitSearch, user); string userName = Membership.GetUser(user.MembershipUserId).UserName; OutfitView ov = new OutfitView(); ov.Search = new OutfitSearch(); if (showAsPublicCloset) { ov.StyleAlerts = contentService.GetRandomStyleAlerts(); foreach (ClosetOutfitView cov in lstResults) { cov.Disabled = true; cov.ShowAddToMyCloset = true; cov.SendToFriends = false; } userName += "'s Outfits"; } else { ov.StyleAlerts = contentService.GetRandomStyleAlerts((IList <FashionFlavor>)ViewData["fashionFlavors"]); } ov.FilterText = originalSearch; ov.Closet = user.Closet; ov.UserName = userName; ov.Outfits = lstResults; ov.TotalOutfits = totalCount; ov.Season = outfitSearch.Season; ov.PrivacyLevel = user.Closet.PrivacyLevel.ToString(); ov.CurrentPage = outfitSearch.Page; ov.ShowAsPublicCloset = showAsPublicCloset; ov.Search.ShowAsPublicCloset = showAsPublicCloset; ov.Search.Patterns = patterRepository.GetAll() as List <Pattern>; ov.Search.Categories = new List <SelectListItem>(); SelectListItem noCategory = new SelectListItem(); noCategory.Text = NOCATEGORY; noCategory.Value = "0"; ov.Search.Categories.Add(noCategory); ov.Search.Categories.AddRange(GetCategorySelectListItemList(categoryRepository.GetAll())); ov.Search.Trends = new List <SelectListItem>(); SelectListItem noTrend = new SelectListItem(); noTrend.Text = NOTREND; noTrend.Value = "0"; ov.Search.Trends.Add(noTrend); ov.Search.Trends.AddRange(GetTrendSelectListItemList(trendRepository.GetCurrentTrends())); ov.Search.Colors = colorRepository.GetAll() as List <Color>; ov.Search.Page = outfitSearch.Page; ov.Search.Season = outfitSearch.Season; ov.Search.SeasonName = outfitSearch.SeasonName; ov.Search.EventTypes = new List <SelectListItem>(); foreach (EventType eventType in user.EventTypes) { SelectListItem item = new SelectListItem(); item.Text = eventType.Description; item.Value = eventType.Id.ToString(); ov.Search.EventTypes.Add(item); } ov.Search.Flavors = new List <SelectListItem>(); foreach (UserFlavor userFlavor in user.UserFlavors) { SelectListItem item = new SelectListItem(); item.Text = userFlavor.Flavor.Name; item.Value = userFlavor.Flavor.Id.ToString(); ov.Search.Flavors.Add(item); } ov.Search.SavedFilters = savedFilterRepository.GetAllFor(UserId) as List <SavedFilter>; if (user.Closet.FavoriteOutfit != null) { ClosetOutfitView couv = closetOutfitRepository.GetByClosetOutfitId(ov.FavoriteOutfitId); if (couv != null) { ov.FavoriteOutfitId = user.Closet.FavoriteOutfit.Id; ov.FavoriteOutfit = couv.ShortEventTypes + ov.FavoriteOutfitId; } } else { ov.FavoriteOutfit = "None Selected"; } ViewData["procesingCloset"] = user.Closet.CreationStatus == ClosetGarmentStatus.Pending && IsSameUser(user.Id); ViewData["userId"] = user.Id; ViewData["closetUserId"] = user.MembershipUserId; ov.Pager = PagingHelper.Paging(totalCount, Convert.ToInt32(outfitSearch.Page), Convert.ToInt32(outfitSearch.PageSize), 4); ViewData["Pages"] = ov.Pager; //TODO: Hacer modificable este seteo ViewData["StyleAlertsStep"] = 5; foreach (ClosetOutfitView cov in lstResults) { if (cov.OutfitUpdater == null) { cov.OutfitUpdater = outfitUpdaterRepository.Get(ConfigurationManager.AppSettings["DefaultOU"]); } //We also need to be able to obtain the number of impressiones (views) of an outfit updaters. TrackingHelper.SaveOutfitUpdaterInfo(cov.OutfitUpdater.Id.ToString(), cov.ClosetOutfitId.ToString()); } ov.Search.Public = false; return(ov); }
public List <ColorDto> GetColors() { return(_mapper.Map <List <ColorDto> >(_colorRepository.GetAll().ToList())); }
public List <Color> GetListColor() { return(_colorRepository.GetAll().ToList()); }
public IEnumerable <Color> GetAll() { return(_colorRepository.GetAll(new string[] { })); }
public IEnumerable <ColorViewModel> GetAllColors() { var colors = _iColorRepository.GetAll(); return(colors.Select(x => x.ToViewModel())); }
public IEnumerable <ColorDto> GetAll() { var colors = _repo.GetAll(); return(_mapper.Map <IEnumerable <ColorDto> >(colors)); }
public IActionResult Index() { return(View(_colorRepository.GetAll())); }
public List <Color> GetAll() { return(colorRepo.GetAll().ToList()); }
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()); }
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()); }
public IEnumerable <Color> GetAll() { return(_colorRepository.GetAll()); }
public IEnumerable <Color> GetColores() { var colores = colorRepository.GetAll().OrderBy(x => x.Codigo); return(colores); }
public List <ColorViewModel> GetAllColorsViewModel() { var colorsEntity = mColorRepository.GetAll().ToList(); return(mASMapper.Map(colorsEntity)); }
public async Task <ActionResult <IEnumerable <ColorEntity> > > Get() => Ok(await _colorRepository.GetAll());