Beispiel #1
0
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TipoMaterial = _tipoMaterialData.GetById(id);

            if (TipoMaterial == null)
            {
                return(NotFound());
            }

            var materialesAsociados = _materialData.GetMaterialsForMaterialType(TipoMaterial.ID);

            if (materialesAsociados.Count() > 0)
            {
                Delete = $"Éste tipo de material tiene asociado {materialesAsociados.Count()} materiales";
            }
            else
            {
                Message = $"Éste tipo de material no tiene materiales asociados";
            }

            return(Page());
        }
        public ActionResult <TipoMaterialDTO> GetTipoMaterial(int id)
        {
            var tipoMaterial = _tipoMaterialData.GetById(id);

            if (tipoMaterial == null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <TipoMaterialDTO>(tipoMaterial)));
        }
        public IActionResult OnGet(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TipoMaterial = _tipoMaterialData.GetById(id);

            if (TipoMaterial == null)
            {
                return(NotFound());
            }
            return(Page());
        }