Exemplo n.º 1
0
        public object DeleteDataValue(DeleteDataValueRequest request)
        {
            // Variables.
            var result = default(object);


            // Catch all errors.
            try
            {
                // Variables.
                var dataValueId = GuidHelper.GetGuid(request.DataValueId);


                // Delete the data value.
                Persistence.Delete(dataValueId);


                // Success.
                result = new
                {
                    Success = true
                };
            }
            catch (Exception ex)
            {
                // Error.
                LogHelper.Error <DataValuesController>(DeleteDataValueError, ex);
                result = new
                {
                    Success = false,
                    Reason  = UnhandledError
                };
            }


            // Return the result.
            return(result);
        }
Exemplo n.º 2
0
        public object DeleteDataValue(DeleteDataValueRequest request)
        {
            // Variables.
            var result = default(object);

            // Catch all errors.
            try
            {

                // Variables.
                var dataValueId = GuidHelper.GetGuid(request.DataValueId);

                // Delete the data value.
                Persistence.Delete(dataValueId);

                // Success.
                result = new
                {
                    Success = true
                };

            }
            catch (Exception ex)
            {

                // Error.
                LogHelper.Error<DataValuesController>(DeleteDataValueError, ex);
                result = new
                {
                    Success = false,
                    Reason = UnhandledError
                };

            }

            // Return the result.
            return result;
        }