Example #1
0
        public IHttpActionResult followUp(CorrespondenceFollowupBindingModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                var senderRole = User.IsInRole(AuthorizationRoles.Role_Adviser) ?
                                 BusinessLayerParameters.correspondenceSenderRole_adviser
                            : BusinessLayerParameters.correspondenceSenderRole_client;
                CorrespondenceFollowup message = new CorrespondenceFollowup {
                    existingNoteId = model.existingNoteId,
                    body           = model.body
                };

                edisRepo.CreateMessageFollowup(message, senderRole);
                return(Ok());
            }
            else
            {
                if (model == null)
                {
                    ModelState.AddModelError("", "Model is not provided");
                }
                return(BadRequest(ModelState));
            }
        }