public IHttpActionResult DeleteContactMessage(int partnerId)
        {
            ContactMessageRequest request = new ContactMessageRequest
            {
                ContactMessageDto = new ContactMessageDto {
                    ContactMessageId = partnerId
                }
            };
            List <string>         errors  = ValidateDeleteContactMessage(request);
            ContactMessageMessage message = new ContactMessageMessage();

            if (errors != null && errors.Any())
            {
                message.ErrorMessage     = ContactMessageResource.ValidationErrors;
                message.ErrorType        = ErrorType.ValidationError;
                message.Errors           = new List <string>();
                message.OperationSuccess = false;
                message.Errors.AddRange(errors);
            }
            else
            {
                message = _serviceContactMessageClient.DeleteContactMessage(request);
            }
            return(Json(message));
        }
예제 #2
0
        /// <summary>
        /// Search ContactMessage
        /// </summary>
        /// <param name="request">contactMessage request.</param>
        /// <returns>ContactMessage message.</returns>
        public ContactMessageMessage FindContactMessages(ContactMessageRequest request)
        {
            ContactMessageMessage message = new ContactMessageMessage();

            try
            {
                message = _serviceContactMessage.FindContactMessages(request.ToPivot()).ToMessage();
                message.OperationSuccess = true;
            }
            catch (Exception e)
            {
                message.ErrorType    = ErrorType.TechnicalError;
                message.ErrorMessage = e.Message;
            }
            return(message);
        }
예제 #3
0
        /// <summary>
        /// Get list of ContactMessage
        /// </summary>
        /// <returns>ContactMessage message.</returns>
        public ContactMessageMessage GetAllContactMessages()
        {
            ContactMessageMessage message = new ContactMessageMessage();

            try
            {
                message = _serviceContactMessage.GetAllContactMessages().ToMessage();
                message.OperationSuccess = true;
            }
            catch (Exception e)
            {
                message.ErrorType    = ErrorType.TechnicalError;
                message.ErrorMessage = e.Message;
            }
            return(message);
        }
        public IHttpActionResult CreateContactMessage(ContactMessageRequest request)
        {
            List <string>         errors  = ValidateCreateContactMessage(request);
            ContactMessageMessage message = new ContactMessageMessage();

            if (errors != null && errors.Any())
            {
                message.ErrorMessage     = ContactMessageResource.ValidationErrors;
                message.ErrorType        = ErrorType.ValidationError;
                message.Errors           = new List <string>();
                message.OperationSuccess = false;
                message.Errors.AddRange(errors);
            }
            else
            {
                message = _serviceContactMessageClient.CreateContactMessage(request);
            }
            return(Json(message));
        }
        public IHttpActionResult GetAllContactMessages()
        {
            ContactMessageMessage message = _serviceContactMessageClient.GetAllContactMessages();

            return(Json(message));
        }