Exemplo n.º 1
0
        public IHttpActionResult DeleteSheetTranslation(int translationId)
        {
            SheetTranslationRequest request = new SheetTranslationRequest
            {
                SheetTranslationDto = new SheetTranslationDto {
                    TranslationId = translationId
                },
                FindSheetTranslationDto = FindSheetTranslationDto.SheetTranslationId
            };

            SheetTranslationMessage message = new SheetTranslationMessage();
            List <string>           errors  = ValidateDeleteSheetTranslation(request);

            if (errors != null && errors.Any())
            {
                message.ErrorMessage     = CountryMessageResource.ValidationErrors;
                message.ErrorType        = ErrorType.ValidationError;
                message.Errors           = new List <string>();
                message.OperationSuccess = false;
                message.Errors.AddRange(errors);
            }
            else
            {
                message = _serviceSheetTranslationClient.DeleteSheetTranslation(request);
            }
            return(Json(message));
        }
        /// <summary>
        /// Change SheetTranslation informations.
        /// </summary>
        /// <param name="request">sheetTranslation request.</param>
        /// <returns>SheetTranslation message.</returns>
        public SheetTranslationMessage UpdateSheetTranslation(SheetTranslationRequest request)
        {
            SheetTranslationMessage message = new SheetTranslationMessage();

            try
            {
                _serviceSheetTranslation.UpdateSheetTranslation(request.ToPivot());
                message.OperationSuccess = true;
            }
            catch (Exception e)
            {
                message.ErrorType    = ErrorType.TechnicalError;
                message.ErrorMessage = e.Message;
            }
            return(message);
        }
        /// <summary>
        /// Get list of SheetTranslation
        /// </summary>
        /// <returns>SheetTranslation message.</returns>
        public SheetTranslationMessage GetAllSheetTranslations()
        {
            SheetTranslationMessage message = new SheetTranslationMessage();

            try
            {
                message = _serviceSheetTranslation.GetAllSheetTranslations().ToMessage();
                message.OperationSuccess = true;
            }
            catch (Exception e)
            {
                message.ErrorType    = ErrorType.TechnicalError;
                message.ErrorMessage = e.Message;
            }
            return(message);
        }
Exemplo n.º 4
0
        public IHttpActionResult UpdateSheetTranslationRange(SheetTranslationRequest request)
        {
            SheetTranslationMessage message = new SheetTranslationMessage();
            List <string>           errors  = ValidateUpdateSheetTranslationRange(request);

            if (errors != null && errors.Any())
            {
                message.ErrorMessage     = CountryMessageResource.ValidationErrors;
                message.ErrorType        = ErrorType.ValidationError;
                message.Errors           = new List <string>();
                message.OperationSuccess = false;
                message.Errors.AddRange(errors);
            }
            else
            {
                message = _serviceSheetTranslationClient.UpdateSheetTranslationRange(request);
            }
            return(Json(message));
        }
Exemplo n.º 5
0
        public IHttpActionResult GetAllSheetTranslations()
        {
            SheetTranslationMessage message = _serviceSheetTranslationClient.GetAllSheetTranslations();

            return(Json(message));
        }