//create new equipment public IActionResult Create() { List <EquipmentType> equipmentTypes = _equipmentTypeSvc.GetAll(); ViewBag.EquipmentType = new SelectList(equipmentTypes, "Id", "Name"); return(View()); }
private IEnumerable <EquipmentTypeVM> BuildEquipmentTypeSearchQuery(params string[] words) { IEnumerable <EquipmentTypeDTO> equipmentTypeDTOs = EquipmentTypeService .GetAll() .ToList() .Where(d => words.All(d.Name.ToLower().Contains)); IEnumerable <EquipmentTypeVM> equipmentTypeVMs = Mapper.Map <IEnumerable <EquipmentTypeVM> >(equipmentTypeDTOs); return(equipmentTypeVMs); }
private async void LoadEquipmentTypes() { var equipmentTypes = (await _equipmentTypeService.GetAll()).ToList(); equipmentTypes.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.Ordinal)); AllEquipmentTypes.Clear(); foreach (var equipmentType in equipmentTypes) { var amount = await _equipmentItemService.CountByType(equipmentType); AllEquipmentTypes.Add(new EquipmentTypeBindableViewModel(equipmentType, amount)); } }
private async void LoadFreeEquipmentTypes() { var equipmentTypes = (await _equipmentTypeService.GetAll()).ToList(); var tempObsCol = new ObservableCollection <EquipmentTypeBindableViewModel>(); foreach (var equipmentType in equipmentTypes) { var amount = await _equipmentItemService.CountFreeByType(equipmentType); if (amount > 0) { tempObsCol.Add(new EquipmentTypeBindableViewModel(equipmentType, amount)); } } FreeEquipmentTypes = tempObsCol; }
public SelectList GetEquipmentTypeIdSelectList(Guid?selectedValue = null) { return(new SelectList(EquipmentTypeService.GetAll(), "Id", "Name", selectedValue)); }