public IHttpActionResult SaveSystemMessageData([FromBody] object eventMessageData)
        {
            WebResponseContentModel <EmailMessageModel> model = null;

            try
            {
                model = JsonConvert.DeserializeObject <WebResponseContentModel <EmailMessageModel> >(eventMessageData.ToString());

                if (model.Content != null)
                {
                    systemEmailMessageEventsRepo.SaveEmailEventMessage(model.Content);
                    model.IsRequestSuccesful = true;
                }
                else
                {
                    model.IsRequestSuccesful = false;
                    model.ValidationError    = ValidationExceptionError.res_09;
                }
            }
            catch (Exception ex)
            {
                model.IsRequestSuccesful = false;
                model.ValidationError    = ExceptionValidationHelper.GetExceptionSource(ex);
                return(Json(model));
            }

            return(Json(model));
        }
        public IHttpActionResult SaveEventData([FromBody] object eventData)
        {
            WebResponseContentModel <EventFullModel> model = null;

            try
            {
                model = JsonConvert.DeserializeObject <WebResponseContentModel <EventFullModel> >(eventData.ToString());

                //messageEventsRepo.ProcessEventMessage(new SystemMessageEvents() { Code = model.Content.Code, MasterID = model.Content.MasterID, Status = model.Content.Status, SystemMessageEventID = model.Content.ID });

                if (model.Content != null)
                {
                    if (model.Content.idDogodek > 0)//We update existing record in DB
                    {
                        eventRepo.SaveEvent(model.Content);
                    }
                    else // We add and save new recod to DB
                    {
                        model.Content.idDogodek = eventRepo.SaveEvent(model.Content, false);
                    }

                    if (model.Content.emailModel != null)
                    {
                        model.Content.emailModel.MasterID = model.Content.idDogodek;
                        messageEventsRepo.SaveEmailEventMessage(model.Content.emailModel);
                    }

                    model.IsRequestSuccesful = true;
                }
                else
                {
                    model.IsRequestSuccesful = false;
                    model.ValidationError    = ValidationExceptionError.res_09;
                }
            }
            catch (Exception ex)
            {
                model.IsRequestSuccesful = false;
                model.ValidationError    = ExceptionValidationHelper.GetExceptionSource(ex);
                return(Json(model));
            }

            return(Json(model));
        }