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)); }
/// <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); }
/// <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)); }