private void ProcessSQLRow(BaseRequest baseRequest, string messageText, Guid messageLogId, TREntities entitiesModel)
 {
     WFMHelper wfmHelper = new WFMHelper(wfmUser, wfmPassword, baseRequest.BusinessUnitID, entitiesModel);
     if (wfmHelper.AuthenticationResultSuccessful)
     {
         if (baseRequest.RequestType == RequestTypes.RequestTypeEnum.Person)
         {
             PersonRequest personRequest = xmlHelper.ProcessInputXMLPerson(messageText);
             if (personRequest.XMLReturnCode == 0)
             {
                 try
                 {
                     var res1 = entitiesModel.fsp_MessageLog_WFMBeginUpdate(messageLogId, 0).FirstOrDefault();
                     personRequest = wfmHelper.ProcessPersonRequest(personRequest);
                     var res2 =
                         entitiesModel.fsp_MessageLog_WFMUpdate(messageLogId, personRequest.WFMReturnCode,
                             personRequest.WFMReturnMessage, 0).FirstOrDefault();
                 }
                 catch (Exception ex)
                 {
                     Utilities.WriteExceptionMessageToLog(ex);
                 }
             }
             personRequest.ReturnCode = personRequest.WFMReturnCode;
             personRequest.ReturnMessage = personRequest.WFMReturnMessage;
             consumer.MessageSend(messageLogId, personRequest);
         }
         else if (baseRequest.RequestType == RequestTypes.RequestTypeEnum.Report)
         {
             ReportRequest reportRequest = xmlHelper.ProcessInputXMLReport(messageText);
             if (reportRequest.XMLReturnCode == 0)
             {
                 var res1 = entitiesModel.fsp_MessageLog_WFMBeginUpdate(messageLogId, 0).FirstOrDefault();
                 reportRequest = wfmHelper.ProcessReportRequest(reportRequest);
                 var res2 =
                     entitiesModel.fsp_MessageLog_WFMUpdate(messageLogId,
                         reportRequest.WFMReturnCode,
                         reportRequest.WFMReturnMessage, 0).FirstOrDefault();
             }
             consumer.MessageSend(messageLogId, reportRequest);
         }
     }
     else // неудачная идентификация
     {
         baseRequest.ReturnCode = -1;
         baseRequest.ReturnMessage = @"Неудачная авторизация в WFM";
         baseRequest.ReturnType = ReturnTypes.ReturnTypeEnum.SystemError;
         consumer.MessageSend(messageLogId, baseRequest);
     }
 }
 private void ProcessSQLRow(BaseRequest baseRequest, string messageText, Guid messageLogId)
 {
     WFMHelper wfmHelper = new WFMHelper(wfmUser, wfmPassword, baseRequest.BusinessUnitID, entitiesModel);
     if (wfmHelper.AuthenticationResultSuccessful)
     {
         if (baseRequest.RequestType == RequestTypes.RequestTypeEnum.Person)
         {
             PersonRequest personRequest = xmlHelper.ProcessInputXMLPerson(messageText);
             if (personRequest.XMLReturnCode == 0)
             {
                 personRequest = wfmHelper.ProcessPersonRequest(personRequest);
                 var resUpdateWFMResult =
                     entitiesModel.fsp_MessageLog_WFMUpdate(messageLogId,
                         personRequest.WFMReturnCode,
                         personRequest.WFMReturnMessage, 0).FirstOrDefault();
             }
             MessageSend(messageLogId, personRequest);
         }
         else if (baseRequest.RequestType == RequestTypes.RequestTypeEnum.Report)
         {
             ReportRequest reportRequest = xmlHelper.ProcessInputXMLReport(messageText);
             if (reportRequest.XMLReturnCode == 0)
             {
                 reportRequest = wfmHelper.ProcessReportRequest(reportRequest);
                 var resUpdateWFMResult =
                     entitiesModel.fsp_MessageLog_WFMUpdate(messageLogId,
                         reportRequest.WFMReturnCode,
                         reportRequest.WFMReturnMessage, 0).FirstOrDefault();
             }
             reportRequest.ReturnMessage = reportRequest.ReportResultXML;
             MessageSend(messageLogId, reportRequest);
         }
     }
     else // неудачная идентификация
     {
         baseRequest.ReturnCode = -1;
         baseRequest.ReturnMessage = @"Неудачная авторизация в WFM";
         baseRequest.ReturnType = ReturnTypes.ReturnTypeEnum.SystemError;
         MessageSend(messageLogId, baseRequest);
     }
 }