Exemple #1
0
        public IHttpActionResult GetWithMetaDataById(int Id)
        {
            EquipmentModels equipmentModel = new EquipmentModels();

            try
            {
                return(Ok(equipmentModel.getEquipmentWithMetaDataById(Id)));
            }
            catch
            {
                return(NotFound());
            }
        }
        public IHttpActionResult GetEquipmentWithMetaDataById(string equipmentId)
        {
            try
            {
                int companyId = GetCompanyIdFromToken();
                if (!General.IsEquipmentUnderCompany(equipmentId, companyId))
                {
                    return(Unauthorized());
                }

                EquipmentModels equipmentModel = new EquipmentModels();
                return(Ok(equipmentModel.getEquipmentWithMetaDataById(equipmentId)));
            }
            catch (Exception ex)
            {
                StringBuilder logMessage = LogUtility.BuildExceptionMessage(ex);
                string        logAPI     = "[Get] " + Request.RequestUri.ToString();
                Startup._sfAppLogger.Error(logAPI + logMessage);

                return(InternalServerError());
            }
        }