public ActionResult Items(int id) { var model = new AdminItemsViewModel { Items = _itemService.GetAllItems(id), ItemTypeId = id, ItemTypeName = _typeService.GetItemTypeById(id).Name, PartName = _partService.GetPartById(_typeService.GetItemTypeById(id).PartId).Name, ProductName = _productService.GetProductById(_partService.GetPartById(_typeService.GetItemTypeById(id).PartId).ProductId).Name, PartId = _typeService.GetItemTypeById(id).PartId, ProductId = _partService.GetPartById(_typeService.GetItemTypeById(id).PartId).ProductId }; return(View(model)); }
public ActionResult Insert(string mainToken, SolarSystemStructureDto dto) { var main = _characterService.GetMainCharacterByToken(mainToken); var maskId = main.MaskType == MaskType.Alliance && main.Pilot.Corporation.AllianceId != null ? main.Pilot.Corporation.Alliance.MaskId : main.Pilot.Corporation.MaskId; _itemTypeService.GetItemTypeById(dto.ItemTypeId); var newStructure = new SolarSystemStructure { Name = dto.Name, SolarSystemId = dto.SolarSystemId, Description = dto.Description, MaskId = maskId, ItemTypeId = dto.ItemTypeId }; _solarSystemStructureService.Insert(newStructure); return(Ok()); }