public async Task <IActionResult> SingleEquipment([FromRoute] string request) { try { var result = await _service.GetEquipment(request); return(Ok(result)); } catch (BusinessLogicException ex) { return(BadRequest(new Response { Status = false, Message = ex.Message })); } catch (Exception e) { return(BadRequest(new Response { Status = false, Message = ErrorMessages.UnkownError })); } }
public IActionResult UpdateEquipment(int id) { var evm = new EquipmentViewModel(); evm.Equipment = _dal.GetEquipment(id); evm.DependencyEquipments = _dal.GetDependencyEquipments().Select(i => new SelectListItem() { Value = i.ID.ToString(), Text = i.Name }).ToList(); evm.EquipmentTypes = _dal.GetEquipmentTypes().Select(i => new SelectListItem() { Value = i.ID.ToString(), Text = i.Name }).ToList(); return(View(evm)); }