/// <summary> /// Delete Partner /// </summary> /// <param name="request">partner request.</param> /// <returns>Partner message.</returns> public PartnerMessage DeletePartner(PartnerRequest request) { PartnerMessage message = new PartnerMessage(); try { _servicePartner.DeletePartner(request.ToPivot()); message.OperationSuccess = true; } catch (Exception e) { message.ErrorType = ErrorType.TechnicalError; message.ErrorMessage = e.Message; } return(message); }
/// <summary> /// Get list of Partner /// </summary> /// <returns>Partner message.</returns> public PartnerMessage GetAllPartners() { PartnerMessage message = new PartnerMessage(); try { message = _servicePartner.GetAllPartners().ToMessage(); message.OperationSuccess = true; } catch (Exception e) { message.ErrorType = ErrorType.TechnicalError; message.ErrorMessage = e.Message; } return(message); }
public IHttpActionResult UpdatePartner(PartnerRequest request) { List <string> errors = ValidateUpdatePartner(request); PartnerMessage message = new PartnerMessage(); if (errors != null && errors.Any()) { message.ErrorMessage = PartnerMessageResource.ValidationErrors; message.ErrorType = ErrorType.ValidationError; message.Errors = new List <string>(); message.OperationSuccess = false; message.Errors.AddRange(errors); } else { message = _servicePartnerClient.UpdatePartner(request); } return(Json(message)); }
public IHttpActionResult GetAllPartners() { PartnerMessage message = _servicePartnerClient.GetAllPartners(); return(Json(message)); }
public PartnerMessage GetDemographicMessage() { return(PartnerMessage.Create(this)); }