예제 #1
0
        /// <summary>
        /// Change ActivityTranslation informations.
        /// </summary>
        /// <param name="request">activityTranslation request.</param>
        /// <returns>ActivityTranslation message.</returns>
        public ActivityTranslationMessage UpdateActivityTranslation(ActivityTranslationRequest request)
        {
            ActivityTranslationMessage message = new ActivityTranslationMessage();

            try
            {
                request.FindActivityTranslationDto = FindActivityTranslationDto.ActivityTranslationId;
                ActivityTranslationResponsePivot response = _serviceActivityTranslation.FindActivityTranslations(request.ToPivot());
                if (response?.ActivityTranslationPivot == null)
                {
                    message.ErrorMessage     = ActivityMessageResource.NotFountTraslation;
                    message.OperationSuccess = false;
                }
                else
                {
                    _serviceActivityTranslation.UpdateActivityTranslation(request.ToPivot());
                    message.OperationSuccess = true;
                }
            }
            catch (Exception e)
            {
                message.ErrorType    = ErrorType.TechnicalError;
                message.ErrorMessage = e.Message;
            }
            return(message);
        }
 /// <summary>
 /// From ActivityTranslation Request to ActivityTranslation Request pivot.
 /// </summary>
 /// <param name="request">the request to assemble.</param>
 /// <returns>ActivityTranslation Request pivot result.</returns>
 public static ActivityTranslationRequestPivot ToPivot(this ActivityTranslationRequest request)
 {
     if (request != null)
     {
         return new ActivityTranslationRequestPivot
                {
                    ActivityTranslationPivot     = request.ActivityTranslationDto.ToPivot(),
                    ActivityTranslationPivotList = request.ActivityTranslationDtoList.ToPivotList(),
                    FindActivityTranslationPivot =
                        Utility.EnumToEnum <FindActivityTranslationDto, FindActivityTranslationPivot>(request
                                                                                                      .FindActivityTranslationDto)
                }
     }
     ;
     return(null);
 }
예제 #3
0
        /// <summary>
        /// Create new ActivityTranslation
        /// </summary>
        /// <param name="request">activityTranslation request.</param>
        /// <returns>ActivityTranslation message.</returns>
        public ActivityTranslationMessage CreateActivityTranslationRange(ActivityTranslationRequest request)
        {
            ActivityTranslationMessage message = new ActivityTranslationMessage();

            try
            {
                message = _serviceActivityTranslation.CreateActivityTranslationRange(request.ToPivot()).ToMessage();
                message.OperationSuccess = true;
            }
            catch (Exception e)
            {
                message.ErrorType    = ErrorType.TechnicalError;
                message.ErrorMessage = e.Message;
            }
            return(message);
        }