Index: App/BusinessLogic/OnBoarding/I9Verification.cs =================================================================== --- App/BusinessLogic/OnBoarding/I9Verification.cs (revision 82129) +++ App/BusinessLogic/OnBoarding/I9Verification.cs (working copy) @@ -1,13 +1,16 @@ -using System; +using Microsoft.VisualBasic; +using System; +using System.Collections; using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; using System.Linq; using System.Text; using ValueObjects; -using System.Data.SqlClient; -using Microsoft.VisualBasic; -using System.Collections; -using System.Data; +using ValueObjects.WORKTERRA; using WORKTERRA; +using WORKTERRA.Shared; +using ServiceConsumer; namespace OnBoarding { @@ -38,7 +41,11 @@ //string sqlquery = string.Empty; StringBuilder queryStringBuilder = null; + //Added by Sushodhan(NF-677) + StringBuilder failedCompanyIDs = new StringBuilder(); + + public override bool Save(object I_Object, bool I_mode, object I_context) { bool functionReturnValue = false; @@ -1539,7 +1546,7 @@ return ApproveReturnStatus; } - public string UpdateResponseCodes(object I_Object, bool I_mode, Hashtable I_Criteria) + public string UpdateResponseCodes(object I_Object, bool I_mode, Hashtable I_Criteria, long EVerifyCompanyID=0) { const string subName = "UpdateResponseCodes"; int result = 0; @@ -1565,18 +1572,29 @@ arrletterTypeCode = letterTypeCode.Split(','); } + //Added by Sushodhan (NF-677) + if (EVerifyCompanyID != 0) + companyID = EVerifyCompanyID; _dataAccess = OnBoarding.GetDataAccess(companyID); for (count = 0; count <= arrcasenumbers.Length-1; count++) { - strQuery.Append("UPDATE [ob].[Employee_I9Verification_section2] SET ApproveReturnStatus='").Append(arrresponsecodes[count]).Append("' WHERE CaseNumber ='" ).Append( arrcasenumbers[count]).Append( "'"); + //Added by Sushodhan to skip already updated statuses (NF-677) + strQuery.Append("IF NOT EXISTS(SELECT TOP (1) * FROM [ob].[Employee_I9Verification_section2] WHERE ApproveReturnStatus='").Append(arrresponsecodes[count]).Append("' AND CaseNumber='").Append(arrcasenumbers[count]).Append("')"); + strQuery.Append("\n BEGIN \n"); + strQuery.Append("UPDATE [ob].[Employee_I9Verification_section2] SET ApproveReturnStatus='").Append(arrresponsecodes[count]).Append("',DateTimeStamp=GETDATE() WHERE CaseNumber ='" ).Append( arrcasenumbers[count]).Append( "'"); + strQuery.Append("\n END"); result = _dataAccess.ExecuteNonQuery(strQuery.ToString()); strQuery.Clear(); - strQuery.Append("UPDATE EI SET ApproveReturnStatus='").Append(GetSection1Status(arrresponsecodes[count])).Append("'"); + //Added by Sushodhan to skip already updated statuses (NF-677) + strQuery.Append("IF NOT EXISTS(SELECT TOP (1) * FROM [ob].[Employee_I9Verification] EI inner join [ob].[Employee_I9Verification_Section2] EIS on EIS.EmployeeID = EI.EmployeeID WHERE EIS.CaseNumber ='").Append(arrcasenumbers[count]).Append("'").Append(" AND EI.ApproveReturnStatus='").Append(GetSection1Status(arrresponsecodes[count])).Append("')"); + strQuery.Append("\n BEGIN \n"); + strQuery.Append("UPDATE EI SET ApproveReturnStatus='").Append(GetSection1Status(arrresponsecodes[count])).Append("',DateTimeStamp=GETDATE() "); strQuery.Append(" from [ob].[Employee_I9Verification] EI inner join [ob].[Employee_I9Verification_Section2] EIS on EIS.EmployeeID = EI.EmployeeID"); strQuery.Append(" WHERE EIS.CaseNumber ='").Append(arrcasenumbers[count]).Append("'"); + strQuery.Append("\n END"); result = _dataAccess.ExecuteNonQuery(strQuery.ToString()); strQuery.Clear(); @@ -3033,5 +3051,181 @@ } - } + //Added by Sushodhan (NF-677) + #region Towards Service Consumer + + + //Added by Sushodhan (NF-677) + public string GetAndSendI9Statuses(string CompanyIDs) + { + string SubName = "GetAndSendI9Statuses"; + try + { + string[] arrCompanyIDs = CompanyIDs.Split(','); + Hashtable I_Criteria = ResponseHelper.GetResolvedCases(); + if (I_Criteria.Count != 0) + { + foreach (var companyId in arrCompanyIDs) + { + long numCompanyID = Convert.ToInt32(companyId); + + /* Update in DB statuses for each company */ + I9Verification objI9Verification = new I9Verification(); + objI9Verification.UpdateResponseCodes(0, false, I_Criteria, numCompanyID); + + //Get API endpoint details of client + if (!SendUpdatedI9ResponsesToAPI(numCompanyID)) + { + failedCompanyIDs = failedCompanyIDs.Append(numCompanyID ).Append(','); + } + } + } + } + catch (ExceptionHandler customizedException) + { + customizedException.ErrorSource = _className + "." + SubName + _exceptionSourceSeperator + customizedException.ErrorSource; + throw customizedException; + failedCompanyIDs.Append(companyID).Append(','); + } + catch (Exception ex) + { + ExceptionHandler customizedException = new ExceptionHandler(); + customizedException.ErrorSource = _className + "." + SubName; + customizedException.ErrorMessage = ex.Message; + failedCompanyIDs.Append(companyID).Append(','); + } + return (failedCompanyIDs.ToString()); + + } + + //Added by Sushodhan (NF-677) + private List<string> GetUpdatedI9StatusesFromDB(long companyID) + { + string SubName = "GetUpdatedI9StatusesFromDB"; + List<string> objEmployeeI9StatusesCollection = new List<string>(); + SqlHelper _objDataAccess; + ConnectionInfo objConnectionInfo; + SqlDataReader objDataReader; + try + { + objConnectionInfo = new ConnectionInfo(); + string connString = objConnectionInfo.GetConnectionString(companyID); + _objDataAccess = new SqlHelper(connString); + objDataReader = _objDataAccess.ExecuteReader("SELECT EmployeeID,ApproveReturnStatus FROM [ob].[Employee_I9Verification] WHERE DateDiff(D,DateTimeStamp,GETDATE()) <=1"); + if (objDataReader != null && objDataReader.HasRows) + { + while (objDataReader.Read()) + { + string result = objDataReader["EmployeeID"] + "~" + objDataReader["ApproveReturnStatus"]; + objEmployeeI9StatusesCollection.Add(result); + } + } + return objEmployeeI9StatusesCollection; + } + catch (ExceptionHandler customException) + { + customException.ErrorSource = _className + "." + SubName + _exceptionSourceSeperator + customException.ErrorSource; + throw customException; + failedCompanyIDs.Append(companyID).Append(','); + } + catch (Exception ex) + { + ExceptionHandler customException = new ExceptionHandler(); + customException.ErrorSource = _className + "." + SubName; + customException.ErrorMessage = ex.Message; + throw customException; + failedCompanyIDs.Append(companyID).Append(','); + } + finally + { + _objDataAccess = null; + objConnectionInfo = null; + objDataReader = null; + + } + + } + + + //Added by Sushodhan (NF-677) for sending Updated I9Statues from last 24 hours to API endpoints + public bool SendUpdatedI9ResponsesToAPI(long CompanyID) + { + APIStatusMappings objAPIStatusMappings = new APIStatusMappings(); + Hashtable Criteria = new Hashtable(); + string SubName = "SendUpdatedI9ResponsesToAPI"; + bool returnResult = false; + try + { + Criteria.Add("APIStatusResponseType", WORKTERRASharedFunction.APIStatusResponse.I9VerificationStatus); + Serialization objSerialization = new Serialization(); + var objApiClientEndpointDetails = (APIClientEndPointDetails)objSerialization.DeSerializeBinary(objAPIStatusMappings.GetClientAPIEndpointDetails(Criteria, CompanyID)); + + if (objApiClientEndpointDetails != null) + { + /*Fetch updated records from DB*/ + List<string> objEmployeeI9StatusesCollection = GetUpdatedI9StatusesFromDB(CompanyID); + if (objEmployeeI9StatusesCollection.Count > 0) //Checks if no new statuses are updated in DB + { + //Creating ResponseContent and Sending status + foreach (var objEmployeeI9Statuses in objEmployeeI9StatusesCollection) + { + if (!string.IsNullOrWhiteSpace(objEmployeeI9Statuses)) + { + string[] response = objEmployeeI9Statuses.Split('~'); + string employeeId = response[0]; + int I9Status = Convert.ToInt32(response[1]); + + //Get response values + string values = objSerialization.DeSerializeBinary(objAPIStatusMappings.GetTourDetailsForI9StatusResponse(Convert.ToInt64(employeeId))).ToString(); + if (!string.IsNullOrWhiteSpace(values)) + { + string[] arrValue = values.Split('~'); + string empId = arrValue[0]; + string tourId = arrValue[1]; + string jobId = arrValue[2]; + if (!(string.IsNullOrWhiteSpace(empId) || string.IsNullOrWhiteSpace(empId) || string.IsNullOrWhiteSpace(empId))) + { + Hashtable responseContent = new Hashtable(); + responseContent.Add("EmpID", empId); + responseContent.Add("TourID", tourId); + responseContent.Add("JobID", jobId); + + //Send response for particular employee + if (ResponseHelper.SendStatusResponseToAPI(WORKTERRASharedFunction.APIStatusResponse.I9VerificationStatus, I9Status, objApiClientEndpointDetails, responseContent)) + { + returnResult = true; + } + } + } + } + } + } + else + { + returnResult = true; + } + } + else + { + returnResult = true; + } + } + catch (ExceptionHandler customException) + { + customException.ErrorSource = _className + "." + SubName + _exceptionSourceSeperator + customException.ErrorSource; + throw customException; + failedCompanyIDs.Append(companyID).Append(','); + } + catch (Exception ex) + { + ExceptionHandler customException = new ExceptionHandler(); + customException.ErrorSource = _className + "." + SubName; + customException.ErrorMessage = ex.Message; + throw customException; + failedCompanyIDs.Append(companyID).Append(','); + } + return returnResult; + } + #endregion + } } Index: App/BusinessLogic/OnBoarding/OnBoarding.csproj =================================================================== --- App/BusinessLogic/OnBoarding/OnBoarding.csproj (revision 82129) +++ App/BusinessLogic/OnBoarding/OnBoarding.csproj (working copy) @@ -72,6 +72,10 @@ <HintPath>C:\Assembly Repository\itextsharp.dll</HintPath> </Reference> <Reference Include="Microsoft.VisualBasic" /> + <Reference Include="ServiceConsumer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\ServiceConsumer.dll</HintPath> + </Reference> <Reference Include="SharedFunction"> <HintPath>C:\Assembly Repository WORKTERRA\SharedFunction.dll</HintPath> <Private>False</Private> @@ -96,6 +100,10 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\Shared Library\ValueObjects\ValueObjects\obj\Debug\ValueObjects.dll</HintPath> </Reference> + <Reference Include="WORKTERRA, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\WORKTERRA.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="AddNewStep.cs" /> Index: App/BusinessLogic/WORKTERRA/APIStatusMappings.cs =================================================================== --- App/BusinessLogic/WORKTERRA/APIStatusMappings.cs (revision 82129) +++ App/BusinessLogic/WORKTERRA/APIStatusMappings.cs (working copy) @@ -1,5 +1,7 @@ -using System; +using ServiceConsumer; +using System; using System.Collections; +using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Text; @@ -223,7 +225,7 @@ } //Added by Sushodhan (NF-393) - public string GetClientAPIEndpointDetails(Hashtable I_criteria,int companyID=0) + public string GetClientAPIEndpointDetails(Hashtable I_criteria,long companyID=0) { string SubName = "GetClientAPIEndpointDetails"; APIClientEndPointDetails objAPIDetails = new APIClientEndPointDetails(); @@ -277,7 +279,7 @@ } //Added by Sushodhan (NF-677) - public string GetTourDetailsForI9StatusResponse() + public string GetTourDetailsForI9StatusResponse(long employeeId=0) { string SubName="GetTourDetailsForI9StatusResponse"; string result = string.Empty; @@ -289,7 +291,7 @@ var _with = objTourDetailsParam; _with.ParameterName = "@EmployeeID"; - _with.Value = SessionHash["EmployeeID"]; + _with.Value = (employeeId != 0) ? employeeId : SessionHash["EmployeeID"]; _with.SqlDbType = SqlDbType.BigInt; objReader = _dataAccess.ExecuteReader("ob.OES_SP_GetTourDetailsForI9StatusResponse", objTourDetailsParam); @@ -361,35 +363,5 @@ } #endregion - - #region Towards Service Consumer - //Added by Sushodhan (NF-677) - public bool GetAndSendI9Statuses(int companyID=0) - { - bool result = false; - string SubName = "GetAndSendI9Statuses"; - try - { - Hashtable Criteria = new Hashtable(); - Criteria.Add("APIClientEndPointDetails", WORKTERRASharedFunction.APIStatusResponse.I9VerificationStatus); - Serialization objSerialization = new Serialization(); - var apiClientEndpointDetails = (APIClientEndPointDetails)objSerialization.DeSerializeBinary(GetClientAPIEndpointDetails(Criteria)); - - } - catch (ExceptionHandler customizedException) - { - customizedException.ErrorSource = _className + "." + SubName + _exceptionSourceSeperator + customizedException.ErrorSource; - throw customizedException; - } - catch (Exception ex) - { - ExceptionHandler customizedException = new ExceptionHandler(); - customizedException.ErrorSource = _className + "." + SubName; - customizedException.ErrorMessage = ex.Message; - } - return result; - - } - #endregion } } Index: App/Supporting Projects/ServiceConsumer/ServiceConsumer/app.config =================================================================== --- App/Supporting Projects/ServiceConsumer/ServiceConsumer/app.config (revision 82129) +++ App/Supporting Projects/ServiceConsumer/ServiceConsumer/app.config (working copy) @@ -7,10 +7,12 @@ <add key="Aurico_PackageID" value="-1"/> <add key="Aurico_ATS_ResponseURL" value="https://stage.workterra.net/wtservices/SaveBackgroundCheckStatus.svc"/> <add key="Aurico_ATS_ID" value="9999"/> - <add key="ErrorLogLocation" value="c:\temp\OnlineEnrollmentErrorLog"/> + <add key="ErrorLogLocation" value="c:\temp\OnlineEnrollmentErrorLog"/> + <add key="EmployerSerUserName" value="ATHO7170"/> + <add key ="EmployerSerPassword" value="Ebs77U$er"/> </appSettings> <system.serviceModel> - <bindings> + <bindings> <basicHttpBinding> <binding name="TxLifeSoap"> <security mode="Transport" /> @@ -20,7 +22,27 @@ <security mode="Transport" /> </binding> <binding name="SubmitRelease WebserviceSoap1" /> + <binding name="BasicHttpBinding_IEmployerWebServiceV29"> + <security mode="TransportWithMessageCredential" /> + </binding> + <binding name="basicWCFBinding"> + <security mode="TransportWithMessageCredential" /> + </binding> </basicHttpBinding> + <wsHttpBinding> + <binding name="WSHttpBinding_IEmployerWebServiceV29"> + <security mode="TransportWithMessageCredential"> + <transport clientCredentialType="None" /> + <message clientCredentialType="UserName" /> + </security> + </binding> + <binding name="WSHttpBinding_IAdministration"> + <security mode="TransportWithMessageCredential"> + <transport clientCredentialType="None" /> + <message clientCredentialType="UserName" /> + </security> + </binding> + </wsHttpBinding> </bindings> <client> <endpoint address="https://extranetapps-mo.tagtpa.com/TxLifeImport/TxLife.asmx" @@ -29,6 +51,20 @@ <endpoint address="https://rewrite.auricosecure.com/AuricoReleaseWS/Service1.asmx" binding="basicHttpBinding" bindingConfiguration="SubmitRelease WebserviceSoap" contract="AuricoReleaseWS.SubmitReleaseWebserviceSoap" name="SubmitRelease WebserviceSoap" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/EmployerWebServiceV29.svc/basic" + binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEmployerWebServiceV29" + contract="DHS_StageEVerify.IEmployerWebServiceV29" name="BasicHttpBinding_IEmployerWebServiceV29" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/EmployerWebServiceV29.svc" + binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEmployerWebServiceV29" + contract="DHS_StageEVerify.IEmployerWebServiceV29" name="WSHttpBinding_IEmployerWebServiceV29" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/Administration.svc/basic" + binding="basicHttpBinding" bindingConfiguration="basicWCFBinding" + contract="DHS_StageEVerify_Administration.IAdministration" + name="basicWCFBinding" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/Administration.svc" + binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAdministration" + contract="DHS_StageEVerify_Administration.IAdministration" + name="WSHttpBinding_IAdministration" /> </client> </system.serviceModel> </configuration> \ No newline at end of file Index: App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs =================================================================== --- App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs (revision 0) +++ App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs (working copy) @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using WORKTERRA.OnBoard; + +namespace ServiceConsumer +{ + public class EmployeeI9StatusResponse + { + public string employee_id { get; set; } + public Int64 tour_id { get; set; } + public string job_id { get; set; } + public Int32 status_id { get; set; } + public string status_label { get; set; } + public string date { get; set; } + + public static EmployeeI9StatusResponse CreateEmployeeI9StatusResponse(string employee_id, string tour_id, string job_id, string status_label) + { + OnBoardSharedFunction.I9VerificationStatus status = (OnBoardSharedFunction.I9VerificationStatus)Enum.Parse(typeof(OnBoardSharedFunction.I9VerificationStatus), status_label); + + switch (status) + { + case OnBoardSharedFunction.I9VerificationStatus.Authorized: + status_label = "Authorized from E-Verify"; + break; + case OnBoardSharedFunction.I9VerificationStatus.Case_Closed: + status_label = "Case Closed"; + break; + case OnBoardSharedFunction.I9VerificationStatus.Incomplete: + status_label = "Incomplete"; + break; + case OnBoardSharedFunction.I9VerificationStatus.Pending_for_Verification: + status_label = "Pending for verification by E-Verify"; + break; + case OnBoardSharedFunction.I9VerificationStatus.Pending_Initial_Submission: + status_label = "Pending Employer Verification"; + break; + case OnBoardSharedFunction.I9VerificationStatus.Rejected: + status_label = "Rejected by E-Verify"; + break; + } + + return new EmployeeI9StatusResponse() + { + employee_id = employee_id, + tour_id = Convert.ToInt64(tour_id), + job_id = job_id, + status_id = (Int32)Enum.Parse(typeof(OnBoardSharedFunction.I9VerificationStatus), Convert.ToString(status)), + status_label = status_label, + date = XmlConvert.ToString(DateTime.UtcNow, XmlDateTimeSerializationMode.Utc) + }; + } + } +} Index: App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs =================================================================== --- App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs (revision 0) +++ App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs (working copy) Property changes on: App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/EmployeeI9StatusResponse.cs ___________________________________________________________________ Added: svn:needs-lock ## -0,0 +1 ## +* \ No newline at end of property Index: App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs =================================================================== --- App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs (revision 0) +++ App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs (working copy) @@ -0,0 +1,247 @@ +using Newtonsoft.Json; +using ServiceConsumer.DHS_StageEVerify; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using ValueObjects.WORKTERRA; +using ServiceConsumer; +using WORKTERRA.Shared; + +namespace ServiceConsumer +{ + public class ResponseHelper + { + //Added by Sushodhan (NF-393) + public static bool SendStatusResponseToAPI(WORKTERRASharedFunction.APIStatusResponse objAPIStatusResponse, object status, APIClientEndPointDetails objAPIEndpoint,Hashtable responseContent) + { + try + { + ResponseHelper.CreateAndSendResponse(objAPIStatusResponse, objAPIEndpoint, status, responseContent); + return true; + } + catch (Exception e) + { + //customException.ErrorSource = SubName; + } + return false; + } + + + //Added by Sushodhan (NF-393) + public enum APIAuthenticationType + { + NoAuth = 1, + BasicAuth = 2, + OAuth1 = 3, + OAuth2 = 4 + } + + + + #region Private Methods + + private static string SendResponseWithBasicAuthentication(APIClientEndPointDetails objAPIDetails, object ResponseContent) + { + using (var client = new HttpClient()) + { + + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes(objAPIDetails.userName + ":" + objAPIDetails.password))); + + var response = client.PostAsync(objAPIDetails.URL, new StringContent(JsonConvert.SerializeObject(ResponseContent), Encoding.UTF8, "application/json")).Result; //, content); + + var responseString = response.Content.ReadAsStringAsync().Result; + + return responseString; + } + } + + + private static string SendResponseWithoutAuthentication(APIClientEndPointDetails objAPIDetails, object ResponseContent) + { + using (var client = new HttpClient()) + { + var response = client.GetAsync(objAPIDetails.URL).Result; + + var responseString = response.Content.ReadAsStringAsync().Result; + + return responseString; + } + } + + + private static bool CreateAndSendResponse(WORKTERRASharedFunction.APIStatusResponse objAPIStatusResponse, APIClientEndPointDetails objAPIDetail, object status, Hashtable responseData) + { + object objResponseToSend = null; + bool result = false; + + objResponseToSend = CreateResponseObject(objAPIStatusResponse, status, responseData); + + result = SendResponse(objAPIDetail, objResponseToSend); + + return result; + } + + + private static object CreateResponseObject(WORKTERRASharedFunction.APIStatusResponse objStatusResponseType, object status, Hashtable responseData) + { + object objResponse = null; + + switch (objStatusResponseType) + { + + case WORKTERRASharedFunction.APIStatusResponse.I9VerificationStatus: + { + string strStatus = status.ToString(); + string employeeId = responseData["EmpID"].ToString(); + string tourId = responseData["TourID"].ToString(); + string jobId = responseData["JobID"].ToString(); + + objResponse = EmployeeI9StatusResponse.CreateEmployeeI9StatusResponse(employeeId, tourId, jobId, strStatus); + break; + } + } + return objResponse; + } + + + private static bool SendResponse(APIClientEndPointDetails objAPIDetails, object responseObject) + { + bool result = false; + APIAuthenticationType objAuthenticationType = (APIAuthenticationType)objAPIDetails.authenticationTypeID; + try + { + switch (objAuthenticationType) + { + case APIAuthenticationType.NoAuth: + { + SendResponseWithoutAuthentication(objAPIDetails, responseObject); + result = true; + break; + } + case APIAuthenticationType.BasicAuth: + { + SendResponseWithBasicAuthentication(objAPIDetails, responseObject); + result = true; + break; + } + } + } + catch (Exception ex) + { + throw ex; + } + return result; + } + + + //Added by Sushodhan to get I9 Verification responses from DHS(NF-677) + private static string GetMessageCode(ResolvedCaseListRecord resolvedCase) + { + string MessageCode = ""; + if (resolvedCase.MessageCode == null && resolvedCase.EligibilityStatement != null) + { + switch (resolvedCase.EligibilityStatement) + { + case "DHS Tentative Nonconfirmation (TNC)": + MessageCode = "U"; + break; + case "DHS Case in Continuance": + MessageCode = "I"; + break; + case "DHS Final Nonconfirmation": + MessageCode = "N"; + break; + case "Employment Authorized": + MessageCode = "O"; + break; + case "Passport Data verified": + MessageCode = "P"; + break; + case "Photo Matching Required": //TO DO : Check Message Code + MessageCode = "P"; + break; + case "DHS No Show": + MessageCode = "S"; + break; + case "Close and Resubmit the case": + MessageCode = "X"; + break; + } + } + else + MessageCode = resolvedCase.MessageCode.ToString(); + + return MessageCode; + } + + #endregion + //Added by Sushodhan to get I9 Verification responses from DHS(NF-677) + public static Hashtable GetResolvedCases() + { + string letterTypeCodes = "", Msg = ""; + Hashtable Criteria = new Hashtable(); + StringBuilder sbCaseNumbers = new StringBuilder(); + StringBuilder sbResponseCodes = new StringBuilder(); + StringBuilder sbLetterTypeCodes = new StringBuilder(); + StringBuilder sbStateCodes = new StringBuilder(); + + GetResolvedCasesResult objeResolvedCasesResult = new GetResolvedCasesResult(); + GetResolvedCasesRequest objResolvedCasesRequest = new GetResolvedCasesRequest(); + //EmployerWebServiceV29 empservice = new EmployerWebServiceV29(); + EmployerWebServiceV29Client objWebService = new EmployerWebServiceV29Client("BasicHttpBinding_IEmployerWebServiceV29"); + try + { + objWebService.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["EmployerSerUserName"].ToString(); + objWebService.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["EmployerSerPassword"].ToString(); + ResolvedCaseListRecord[] caseList = new ResolvedCaseListRecord[] { }; + LetterTypeCodeType[] LetterTypeCodeList = new LetterTypeCodeType[] { }; + StringBuilder sb = new StringBuilder(); + objWebService.Open(); + + + //TO DO : Move number of records key to config file + objResolvedCasesRequest.NumberOfRecords = 50; + objeResolvedCasesResult = objWebService.GetResolvedCases(objResolvedCasesRequest); + + sbCaseNumbers.Clear(); + sbResponseCodes.Clear(); + sbStateCodes.Clear(); + sbLetterTypeCodes.Clear(); + caseList = objeResolvedCasesResult.CaseList; + + foreach (ResolvedCaseListRecord resolvedCase in caseList) + { + sbCaseNumbers.Append(",").Append(resolvedCase.CaseNumber).ToString(); + sbStateCodes.Append(",").Append(resolvedCase.CurrentStateCode).ToString(); + sbResponseCodes.Append(",").Append(GetMessageCode(resolvedCase)).ToString(); + + if (LetterTypeCodeList != null && LetterTypeCodeList.Length > 0) + { + //TO DO : Get EmployeeID or Remocve SaveLetter Option + //LetterTypeCodeList = resolvedCase.LetterTypeCodeList; + letterTypeCodes = String.Join(",", LetterTypeCodeList); + //I9Model.SaveLetters(LetterTypeCodeList, resolvedCase.CaseNumber, EmployeeID.ToString()); + } + } + + Criteria["CaseNumbers"] = sbCaseNumbers.ToString(); + Criteria["LetterTypeCode"] = letterTypeCodes; + Criteria["ResponseCodes"] = sbResponseCodes.ToString(); + Criteria["StateCodes"] = sbStateCodes.ToString(); + } + catch (Exception ex) + { + Msg = ex.Message; + } + return Criteria; + } + + } +} Index: App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs =================================================================== --- App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs (revision 0) +++ App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs (working copy) Property changes on: App/Supporting Projects/ServiceConsumer/ServiceConsumer/Classes/ResponseHelper.cs ___________________________________________________________________ Added: svn:needs-lock ## -0,0 +1 ## +* \ No newline at end of property Index: App/Supporting Projects/ServiceConsumer/ServiceConsumer/ServiceConsumer.csproj =================================================================== --- App/Supporting Projects/ServiceConsumer/ServiceConsumer/ServiceConsumer.csproj (revision 82129) +++ App/Supporting Projects/ServiceConsumer/ServiceConsumer/ServiceConsumer.csproj (working copy) @@ -37,13 +37,23 @@ <SpecificVersion>False</SpecificVersion> <HintPath>C:\Assembly Repository WORKTERRA\ExceptionHandler.dll</HintPath> </Reference> + <Reference Include="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\Microsoft.Web.Services3.dll</HintPath> + </Reference> + <Reference Include="Newtonsoft.Json.Net35, Version=4.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\Newtonsoft.Json.Net35.dll</HintPath> + </Reference> <Reference Include="SharedFunction, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Assembly Repository WORKTERRA\SharedFunction.dll</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.Configuration" /> <Reference Include="System.Core" /> + <Reference Include="System.Net.Http" /> <Reference Include="System.Runtime.Serialization" /> <Reference Include="System.ServiceModel" /> <Reference Include="System.Web" /> @@ -53,12 +63,18 @@ <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> + <Reference Include="ValueObjects, Version=1.0.6291.26985, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\ValueObjects.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Classes\AuricoHelper.cs" /> <Compile Include="Classes\BostonMutualService.cs" /> + <Compile Include="Classes\EmployeeI9StatusResponse.cs" /> <Compile Include="Classes\InspectorBehavior.cs" /> <Compile Include="Classes\MessageInspector.cs" /> + <Compile Include="Classes\ResponseHelper.cs" /> <Compile Include="ExecuteService.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Service References\AuricoReleaseWS\Reference.cs"> @@ -66,6 +82,16 @@ <DesignTime>True</DesignTime> <DependentUpon>Reference.svcmap</DependentUpon> </Compile> + <Compile Include="Service References\DHS_StageEVerify\Reference.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Reference.svcmap</DependentUpon> + </Compile> + <Compile Include="Service References\DHS_StageEVerify_Administration\Reference.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Reference.svcmap</DependentUpon> + </Compile> <Compile Include="Service References\TxLife\Reference.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -106,6 +132,225 @@ <None Include="Service References\AuricoReleaseWS\ServiceConsumer.AuricoReleaseWS.SubmitReleaseResponse.datasource"> <DependentUpon>Reference.svcmap</DependentUpon> </None> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV29.wsdl" /> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV29.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV291.wsdl" /> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV291.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV292.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV293.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV294.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.CloseCaseResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.CloseCaseResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ConfirmDocumentPhotoResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ConfirmDocumentPhotoResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ConfirmResolvedCasesReceivedResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ConfirmResolvedCasesReceivedResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ContinueDuplicateCaseResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ContinueDuplicateCaseResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ContinueDuplicateCaseWithChangeResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.ContinueDuplicateCaseWithChangeResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetAvailableDocumentTypesResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetAvailableDocumentTypesResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseAlertCountsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseAlertCountsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseClosureReasonsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseClosureReasonsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseDetailsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseDetailsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseDhsReverifyFieldsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCaseDhsReverifyFieldsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCasesByAlertTypeResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCasesByAlertTypeResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCitizenshipStatusesResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCitizenshipStatusesResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCountryOfIssuanceListResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetCountryOfIssuanceListResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetDuplicateCaseContinueReasonsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetDuplicateCaseContinueReasonsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetDuplicateCaseListResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetDuplicateCaseListResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetEmploymentVerificationFieldsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetEmploymentVerificationFieldsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetIssuingAuthoritiesResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetIssuingAuthoritiesResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetLateVerificationReasonsResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetLateVerificationReasonsResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetListBCDocumentTypesResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetListBCDocumentTypesResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetResolvedCasesResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetResolvedCasesResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetSupportingDocumentTypesResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.GetSupportingDocumentTypesResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.RetrieveDocumentPhotoResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.RetrieveDocumentPhotoResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.RetrieveLetterResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.RetrieveLetterResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SetDhsTncNotificationResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SetSsaTncNotificationResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitAdditionalVerificationResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitAdditionalVerificationResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitDhsReferralResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitDhsReferralResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitDhsReverifyResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitDhsReverifyResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitInitialVerificationResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitInitialVerificationResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitSsaReferralResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitSsaReferralResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitSsaResubmittalResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitSsaResubmittalResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitSsaReverifyResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify\ServiceConsumer.DHS_StageEVerify.SubmitSsaReverifyResult.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify_Administration\Administration.wsdl" /> + <None Include="Service References\DHS_StageEVerify_Administration\Administration.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify_Administration\Administration1.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify_Administration\Administration2.xsd"> + <SubType>Designer</SubType> + </None> + <None Include="Service References\DHS_StageEVerify_Administration\ServiceConsumer.DHS_StageEVerify_Administration.SetUserPasswordResponse.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> + <None Include="Service References\DHS_StageEVerify_Administration\ServiceConsumer.DHS_StageEVerify_Administration.SetUserPasswordResponse1.datasource"> + <DependentUpon>Reference.svcmap</DependentUpon> + </None> <None Include="Service References\TxLife\ServiceConsumer.TxLife.GetHostResponse.datasource"> <DependentUpon>Reference.svcmap</DependentUpon> </None> @@ -122,6 +367,8 @@ </ItemGroup> <ItemGroup> <WCFMetadataStorage Include="Service References\AuricoReleaseWS\" /> + <WCFMetadataStorage Include="Service References\DHS_StageEVerify\" /> + <WCFMetadataStorage Include="Service References\DHS_StageEVerify_Administration\" /> <WCFMetadataStorage Include="Service References\TxLife\" /> </ItemGroup> <ItemGroup> @@ -151,6 +398,36 @@ <LastGenOutput>Reference.cs</LastGenOutput> </None> </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify\EmployerWebServiceV29.disco" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify\configuration91.svcinfo" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify\configuration.svcinfo" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify\Reference.svcmap"> + <Generator>WCF Proxy Generator</Generator> + <LastGenOutput>Reference.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify_Administration\Administration.disco" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify_Administration\configuration91.svcinfo" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify_Administration\configuration.svcinfo" /> + </ItemGroup> + <ItemGroup> + <None Include="Service References\DHS_StageEVerify_Administration\Reference.svcmap"> + <Generator>WCF Proxy Generator</Generator> + <LastGenOutput>Reference.cs</LastGenOutput> + </None> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Index: App/Supporting Projects/ServiceScheduler/App.config =================================================================== --- App/Supporting Projects/ServiceScheduler/App.config (revision 82129) +++ App/Supporting Projects/ServiceScheduler/App.config (working copy) @@ -24,9 +24,57 @@ <basicHttpBinding> <binding maxReceivedMessageSize="10485760"></binding> <binding name="BasicHttpBinding_IPDFService" /> + <binding name="TxLifeSoap"> + <security mode="Transport" /> + </binding> + <binding name="TxLifeSoap1" /> + <binding name="SubmitRelease WebserviceSoap"> + <security mode="Transport" /> + </binding> + <binding name="SubmitRelease WebserviceSoap1" /> + <binding name="BasicHttpBinding_IEmployerWebServiceV29"> + <security mode="TransportWithMessageCredential" /> + </binding> + <binding name="basicWCFBinding"> + <security mode="TransportWithMessageCredential" /> + </binding> </basicHttpBinding> + <wsHttpBinding> + <binding name="WSHttpBinding_IEmployerWebServiceV29"> + <security mode="TransportWithMessageCredential"> + <transport clientCredentialType="None" /> + <message clientCredentialType="UserName" /> + </security> + </binding> + <binding name="WSHttpBinding_IAdministration"> + <security mode="TransportWithMessageCredential"> + <transport clientCredentialType="None" /> + <message clientCredentialType="UserName" /> + </security> + </binding> + </wsHttpBinding> </bindings> - <client> + <client> + <endpoint address="https://extranetapps-mo.tagtpa.com/TxLifeImport/TxLife.asmx" + binding="basicHttpBinding" bindingConfiguration="TxLifeSoap" + contract="TxLife.TxLifeSoap" name="TxLifeSoap" /> + <endpoint address="https://rewrite.auricosecure.com/AuricoReleaseWS/Service1.asmx" + binding="basicHttpBinding" bindingConfiguration="SubmitRelease WebserviceSoap" + contract="AuricoReleaseWS.SubmitReleaseWebserviceSoap" name="SubmitRelease WebserviceSoap" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/EmployerWebServiceV29.svc/basic" + binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEmployerWebServiceV29" + contract="DHS_StageEVerify.IEmployerWebServiceV29" name="BasicHttpBinding_IEmployerWebServiceV29" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/EmployerWebServiceV29.svc" + binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEmployerWebServiceV29" + contract="DHS_StageEVerify.IEmployerWebServiceV29" name="WSHttpBinding_IEmployerWebServiceV29" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/Administration.svc/basic" + binding="basicHttpBinding" bindingConfiguration="basicWCFBinding" + contract="DHS_StageEVerify_Administration.IAdministration" + name="basicWCFBinding" /> + <endpoint address="https://stage.e-verify.uscis.gov/WcfWebService/Administration.svc" + binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAdministration" + contract="DHS_StageEVerify_Administration.IAdministration" + name="WSHttpBinding_IAdministration" /> <endpoint address="http://10.0.1.21/PDFService/PDFService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPDFService" contract="IPDFService" name="BasicHttpBinding_IPDFService" /> </client> </system.serviceModel> @@ -41,7 +89,9 @@ <add key="ImpersonateUser" value="RiHvvEbH5pwVsxNEZuHxkA=="/> <add key="ImpersonatePassword" value="Fzu3HQyf3ZQwCowK8Au4xw=="/> <add key="ImpersonateUserDomain" value="hqD2IVIOzTG0zAj5lHj19Q=="/> - <add key="CompanyIDs" value="13413"/> + <add key="CompanyIDs" value="13480"/> + <!--Added by Sushodhan (NF-677)--> + <add key ="EVerifyCompanyIDs" value="13480"/> <add key="SenderEmailAddress" value="test@harbingergroup.com"/> <add key="ReceiverEmailAddress" value="bhavesh@harbingergroup.com"/> <add key="DBServerPhysicalPath" value="D:\WORKterra\Temp\"/> @@ -64,6 +114,9 @@ <add key="MaxDegreeOfParallelism" value="4"/> <add key="EffectiveDateServiceMaxDegreeOfParallelism" value="1"/> <add key="BatchSize" value="500"/> + <!-- Added by Sushodhan (NF-677)--> + <add key="EmployerSerUserName" value="ATHO7170"/> + <add key ="EmployerSerPassword" value="Ebs77U$er"/> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> Index: App/Supporting Projects/ServiceScheduler/ServiceScheduler.vb =================================================================== --- App/Supporting Projects/ServiceScheduler/ServiceScheduler.vb (revision 82129) +++ App/Supporting Projects/ServiceScheduler/ServiceScheduler.vb (working copy) @@ -25,6 +25,7 @@ Imports System.Data.SqlClient Imports System.Reflection Imports System.Threading.Tasks +Imports OnBoarding Module ServiceScheduler @@ -58,7 +59,7 @@ ServiceID = CType(input_data, Integer) - If input_data <> "14" Then + If input_data <> "14" And input_data <> "31" Then connectionStringColl = objCommonFunctions.GetConnectionStringsCollection() End If @@ -131,6 +132,11 @@ connectionStringColl = objCommonFunctions.GetConnectionStringsCollection(objCommonFunctions.ReadConfig("EnableLoginComapnyID")) Case 30 Console.WriteLine("Recruit Pending Interview Email Service Running ...") + + 'Added by Sushodhan(NF-677) + Case 31 + Console.WriteLine("Getting I9 statuses from DHS and Sending it to API endpoints") + Case Else Console.WriteLine("Not a valid argument specified. Please provice argument from range 1 - 26") Console.WriteLine("------------------------------------------------------------") @@ -164,10 +170,11 @@ Console.WriteLine(" 28. Terminate Election On Plan End Date Service ") Console.WriteLine(" 29. Enable Employees Login for New Hire ") Console.WriteLine(" 30. Recruit Pending Interview Email Service ") + Console.WriteLine(" 31. Get I9 statuses from DHS and Send those to API endpoints") Console.WriteLine("=============================================================") End Select - If ServiceID <= 30 Then + If ServiceID <= 31 Then ' Call the Service scheduler exution subroutine. Call ExecuteServiceScheduler(ServiceID) @@ -336,6 +343,26 @@ Case 30 ServiceNameForMail = "Recruit Pending Interview Email Service" ServiceSchedularLog.Append(ServiceNameForMail).Append(vbCrLf) + 'Added by Sushodhan(NF-677) + Case 31 + + Try + ServiceNameForMail = "Get and Send I9 status responses" + ServiceSchedularLog.Append(ServiceNameForMail).Append(vbCrLf).Append("Get and Send I9 status responses Service Started") + 'Added by Sushodhan(NF-677) + Dim objI9Verification As New I9Verification() + Dim CompanyIDs As String + Dim objCommonFunctions As New CommonFunctions + Dim returnResult As String + 'The companies are traverset inside business logic as it is not possible to distinguish from adhs account for which company verification is filed + CompanyIDs = objCommonFunctions.ReadConfig("EVerifyCompanyIDs") + returnResult = objI9Verification.GetAndSendI9Statuses(CompanyIDs) + Dim failedCompanies As String = returnResult + ServiceSchedularLog.Append("Get and Send I9 status responses Service Started \n Failed Company ID's are ").Append(failedCompanies) + + Catch ex As Exception + + End Try End Select ServiceSchedularLog.Append("============================================================").Append(vbCrLf) @@ -532,7 +559,6 @@ Case 30 Dim objRecruitService As New SchedulePendingInterviewService() returnValue = objRecruitService.GetEmailFor_SchedulePendingInterview(_dataAccess, localString, lcompanyID) - End Select Return returnValue End Function Index: App/Supporting Projects/ServiceScheduler/ServiceScheduler.vbproj =================================================================== --- App/Supporting Projects/ServiceScheduler/ServiceScheduler.vbproj (revision 82129) +++ App/Supporting Projects/ServiceScheduler/ServiceScheduler.vbproj (working copy) @@ -94,14 +94,13 @@ <Prefer32Bit>false</Prefer32Bit> </PropertyGroup> <ItemGroup> - <Reference Include="BaseBenefitModel"> - <Name>BaseBenefitModel</Name> - <HintPath>C:\Assembly Repository\BaseBenefitModel.dll</HintPath> - <Private>False</Private> + <Reference Include="BaseBenefitModel, Version=1.0.6304.19931, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\BaseBenefitModel.dll</HintPath> </Reference> - <Reference Include="Benefits, Version=1.0.5833.18827, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Benefits, Version=1.0.6305.21218, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\BusinessLogic\Benefits\obj\Debug\Benefits.dll</HintPath> + <HintPath>C:\Assembly Repository WORKTERRA\Benefits.dll</HintPath> </Reference> <Reference Include="DataAccessLayer"> <Name>DataAccessLayer</Name> @@ -112,10 +111,9 @@ <SpecificVersion>False</SpecificVersion> <HintPath>C:\Assembly Repository WORKTERRA\EligibilityEngine.dll</HintPath> </Reference> - <Reference Include="Employee"> - <Name>Employee</Name> - <HintPath>C:\Assembly Repository\Employee.dll</HintPath> - <Private>False</Private> + <Reference Include="Employee, Version=1.0.6304.31002, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\Employee.dll</HintPath> </Reference> <Reference Include="ExceptionHandler"> <Name>ExceptionHandler</Name> @@ -135,6 +133,10 @@ <SpecificVersion>False</SpecificVersion> <HintPath>C:\Assembly Repository WORKTERRA\Newtonsoft.Json.Net35.dll</HintPath> </Reference> + <Reference Include="OnBoarding, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\OnBoarding.dll</HintPath> + </Reference> <Reference Include="SharedFunction, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Assembly Repository WORKTERRA\SharedFunction.dll</HintPath> @@ -171,10 +173,9 @@ <Reference Include="System.Xml"> <Name>System.XML</Name> </Reference> - <Reference Include="ValueObjects"> - <Name>ValueObjects</Name> - <HintPath>C:\Assembly Repository\ValueObjects.dll</HintPath> - <Private>True</Private> + <Reference Include="ValueObjects, Version=1.0.6303.29133, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Assembly Repository WORKTERRA\ValueObjects.dll</HintPath> </Reference> <Reference Include="WORKTERRA, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion>