EDN Admin
Well-known member
Hi There.
I am not a c# developer but I am trying to debug a web service. I submitting an InfoPath 2010 form to an SQL Server 2008 db using a C# the webservice that was built for me. I have included the error messages and code below.
Here is what I have tried so far:
I have included the error messages and code below.
Any suggestions would be great.
Thank you,
Trevor
----Error Messages--------
Form submission failed. *******
IncidentID=21345, Form ID: urn:schemas-microsoft-comffice:infopath:HR13-Completed:-myXSD-2013-01-11T03-59-31, Type: DataAdapterException, Exception Message: The remote server returned an error: (500) Internal Server Error. System.Web.Services.Protocols.SoapException: Server was unable to read request. --->
System.InvalidOperationException: There is an error in XML document (1, 466). ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Xml.XmlConvert.ToInt32(String s)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read13_SaveIncidentMultiParam()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer4.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() The remote server returned an error: (500) Internal Server Error.)
-----Code-----using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;
namespace BcsItaWS
{
/// <summary>
/// Summary description for BcsItaWs
/// </summary>
[WebService(Namespace = "h t t p://tempuri DOT org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class BcsItaWs : System.Web.Services.WebService
{
[WebMethod]
public string SaveC040MultiParam(
char c_EmployerInjuryReportLostTimeInd,
char c_ClaimModifiedWorkInd,
string ClaimCISReferenceNumber,
string PersonLastName,
string PersonFirstName,
string PersonMiddleName,
string ClientAddressLineOne,
string ClientAddressLineTwo,
string ClientAddressCity,
string ProvinceStateTerritoryTypeCode,
string ClientAddressPostalCode,
string CountryCode,
int i_ClientPhoneAreaCode,
int i_ClientPhoneNumber,
DateTime dt_PersonBirthDate,
string PersonGenderTypeCode,
int i_SocialInsuranceNumber,
char c_PersonalHealthAlbertaInd,
int i_PersonalHealthNumber,
string InjuryReportJobTitleDesc,
string AccidentEmploymentDetailDesc,
DateTime dt_AccidentEmploymentDetailHiredDt,
char c_AccidentEmploymentDetailApprenticeInd,
DateTime dt_AccidentEmploymentDetailJourneymanDate,
int i_EmployerAccountNumber,
int i_EmployerIndustryCode,
int i_ClientPhoneExtension,
string ClientEmailAddress,
char c_EmployerInjuryReportPersonalCovInd,
char c_EmployerInjuryReportPartnerDirInd,
string AccidentEmploymentContactName,
string AccidentEmploymentContactTitle,
string AccidentEmploymentContactOtherTitleDesc,
int AccidentEmploymentContactAreaCd,
int AccidentEmploymentContactPhoneNumber,
DateTime dt_AccidentDate,
DateTime dt_AccidentTime,
string AccidentTimeAMPMInd,
DateTime dt_AccidentDtStartTime,
string AccidentDtStartTimeAMPMInd,
DateTime AccidentDtEndTime,
string AccidentDtEndTimeAMPMInd,
string ClaimProgressiveRepetitiveInjuryInd,
string ClaimProgressiveRepetitiveInjurtInvestigDesc,
string ClaimProgressiveRepetitiveInjuryDesc,
DateTime dt_AccidentReportedToEmployerDt,
string AccidentReportDelayDesc,
string AccidentToWhomReportedName,
string AccidentToWhomReportTitle,
int i_AccidentToWhomReportedAreaCd,
int i_AccidentToWhomReportedTel,
string AccidentActionsPurposeBusinessInd,
string AccidentActionsUsualWorkInd,
string AccidentInjuryAdditionalPOBDesc,
string AccidentOccurredEmployerPremisesInd,
string AccidentLocationStreet,
string AccidentLocationCity,
string AccidentLocationProvinceStateCode,
string AccidentLocationCountryCode,
string AccidentLocationPostalCode,
string AccidentInjuryDetailedDesc,
DateTime dt_ClaimLayoffDt,
DateTime dt_ClaimLayoffTime,
string ClaimLayoffTimeAMPMInd,
char c_EmployerInjuryReportReturnedToWorkInd,
DateTime dt_ClaimLayoffEndDt,
DateTime dt_ClaimLayoffEndOfLayoffTime,
string ClaimLayoffEndOfLayoffTimeAMPMInd,
string ClaimLayoffReturnToWorkTypeCd,
char c_EmployerInjuryReportContPayWorkerInd,
decimal d_EmployerInjuryReportContPayWorkerAmt,
char c_EmployerInjuryReportFullHoursInd,
decimal d_EmployerInjuryReportHoursWorked,
char c_EmployerInjuryReportFullPayInd,
char c_InjRptEmplmntEarnsModWorkOfferedInd,
string InjRptEmplmntEarnsModWorkOfferedDesc,
string ClaimantEmploymentTypeCode,
DateTime dt_InjRptEmplmntEarnsSeasnStrtDt,
DateTime dt_InjRptEmplmntEarnsSeasnEndDt,
DateTime dt_InjRptEmplmntEarnsEmplmntTermDt,
string InjRptEmplmntEarnsEmplmntTermEstInd,
string PartOfBodyCode,
string SideOfBodyCode,
string NatureOfInjuryCode,
int i_InjRptEmplmntEarnsEmplmntDuration,
string InjRptEmplmntEarnsEmplmntDurationCd,
string AccidentEmplymntDtlOthEmplmntTypDesc,
string ClaimEmploymentIncomeSupervisorName,
int i_ClaimEmploymentIncomeSupervisorAreaCd,
int i_ClaimEmploymentIncomeSupervisorPhone,
decimal d_InjRptEmplmntEarnsYearlyGross,
DateTime dt_InjRptEmplmntEarnsYearlyGrossStrtDt,
DateTime dt_InjEmplmntEarnsYearlyGrossEndDt,
char c_InjRptEmplmntEarnsMissedPayInd,
string InjRptEmplmntEarnsMissedPayDesc,
decimal d_InjuryReportClaimEmploymentWagesAmt,
char c_InjuryReportClaimEmplmntWagesVacPayTimeInd,
char c_InjuryReportClaimEmplmntWagesVacPayPaidInd,
decimal d_InjuryReportClaimEmplmntWagesAmt,
DateTime dt_InjuryReportClaimEmplmntPeriodStart,
DateTime dt_InjuryReportClaimEmplmntPeriodEnd,
string ClaimEmploymentShiftCycleTypeInd,
string ClaimEmploymentShiftCycleType,
DateTime dt_InjRptEmplmntEarnsStdShiftCyclStrtDt,
int i_InjRptEmplmntEarnsShiftCyclDays,
DateTime dt_InjRptEmplmntEarnsCstmShiftCyclStrtDt,
string EmployerInjuryReportAdditionalCommentsDesc,
decimal d_ClmEmplmntShiftCycleSunHrs,
decimal d_ClmEmplmntShiftCycleMonHrs,
decimal d_ClmEmplmntShiftCycleTueHrs,
decimal d_ClmEmplmntShiftCycleWedHrs,
decimal d_ClmEmplmntShiftCycleThuHrs,
decimal d_ClmEmplmntShiftCycleFriHrs,
decimal d_ClmEmplmntShiftCycleSatHrs,
string AccidentEmploymentContactCountryCode
)
{
SqlConnection conn = null;
SqlCommand cmd = null;
string strErr = "myFields assignment";
try
{
strErr = "database connection";
conn = new SqlConnection("Server=****;DataBase=*****");
cmd = new SqlCommand("SharePointUpdateC040", conn);
cmd.CommandType = CommandType.StoredProcedure;
strErr = "c040 parameter value assignements";
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportLostTimeInd", c_EmployerInjuryReportLostTimeInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimModifiedWorkInd", c_ClaimModifiedWorkInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimCISReferenceNumber", ClaimCISReferenceNumber));
cmd.Parameters.Add(new SqlParameter("@C040PersonLastName", PersonLastName));
cmd.Parameters.Add(new SqlParameter("@C040PersonFirstName", PersonFirstName));
cmd.Parameters.Add(new SqlParameter("@C040PersonMiddleName", PersonMiddleName));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressLineOne", ClientAddressLineOne));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressLineTwo", ClientAddressLineTwo));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressCity", ClientAddressCity));
cmd.Parameters.Add(new SqlParameter("@C040ProvinceStateTerritoryTypeCode", ProvinceStateTerritoryTypeCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressPostalCode", ClientAddressPostalCode));
cmd.Parameters.Add(new SqlParameter("@C040CountryCode", CountryCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientPhoneAreaCode", i_ClientPhoneAreaCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientPhoneNumber", i_ClientPhoneNumber));
cmd.Parameters.Add(new SqlParameter("@C040PersonBirthDate", dt_PersonBirthDate));
cmd.Parameters.Add(new SqlParameter("@C040PersonGenderTypeCode", PersonGenderTypeCode));
cmd.Parameters.Add(new SqlParameter("@C040SocialInsuranceNumber", i_SocialInsuranceNumber));
cmd.Parameters.Add(new SqlParameter("@C040PersonalHealthAlbertaInd", c_PersonalHealthAlbertaInd));
cmd.Parameters.Add(new SqlParameter("@C040PersonalHealthNumber", i_PersonalHealthNumber));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportJobTitleDesc", InjuryReportJobTitleDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailDesc", AccidentEmploymentDetailDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailHiredDt", dt_AccidentEmploymentDetailHiredDt));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailApprenticeInd", c_AccidentEmploymentDetailApprenticeInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailJourneymanDate", dt_AccidentEmploymentDetailJourneymanDate));
cmd.Parameters.Add(new SqlParameter("@C040EmployerAccountNumber", i_EmployerAccountNumber));
cmd.Parameters.Add(new SqlParameter("@C040EmployerIndustryCode", i_EmployerIndustryCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientPhoneExtension", i_ClientPhoneExtension));
cmd.Parameters.Add(new SqlParameter("@C040ClientEmailAddress", ClientEmailAddress));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportPersonalCovInd", c_EmployerInjuryReportPersonalCovInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportPartnerDirInd", c_EmployerInjuryReportPartnerDirInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactName", AccidentEmploymentContactName));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactTitle", AccidentEmploymentContactTitle));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactOtherTitleDesc", AccidentEmploymentContactOtherTitleDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactAreaCd", AccidentEmploymentContactAreaCd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactPhoneNumber", AccidentEmploymentContactPhoneNumber));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDate", dt_AccidentDate));
cmd.Parameters.Add(new SqlParameter("@C040AccidentTime", dt_AccidentTime));
cmd.Parameters.Add(new SqlParameter("@C040AccidentTimeAMPMInd", AccidentTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtStartTime", dt_AccidentDtStartTime));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtStartTimeAMPMInd", AccidentDtStartTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtEndTime", AccidentDtEndTime));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtEndTimeAMPMInd", AccidentDtEndTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimProgressiveRepetitiveInjuryInd", ClaimProgressiveRepetitiveInjuryInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimProgressiveRepetitiveInjurtInvestigDesc", ClaimProgressiveRepetitiveInjurtInvestigDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimProgressiveRepetitiveInjuryDesc", ClaimProgressiveRepetitiveInjuryDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentReportedToEmployerDt", dt_AccidentReportedToEmployerDt));
cmd.Parameters.Add(new SqlParameter("@C040AccidentReportDelayDesc", AccidentReportDelayDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportedName", AccidentToWhomReportedName));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportTitle", AccidentToWhomReportTitle));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportedAreaCd", i_AccidentToWhomReportedAreaCd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportedTel", i_AccidentToWhomReportedTel));
cmd.Parameters.Add(new SqlParameter("@C040AccidentActionsPurposeBusinessInd", AccidentActionsPurposeBusinessInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentActionsUsualWorkInd", AccidentActionsUsualWorkInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentInjuryAdditionalPOBDesc", AccidentInjuryAdditionalPOBDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentOccurredEmployerPremisesInd", AccidentOccurredEmployerPremisesInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationStreet", AccidentLocationStreet));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationCity", AccidentLocationCity));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationProvinceStateCode", AccidentLocationProvinceStateCode));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationCountryCode", AccidentLocationCountryCode));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationPostalCode", AccidentLocationPostalCode));
cmd.Parameters.Add(new SqlParameter("@C040AccidentInjuryDetailedDesc", AccidentInjuryDetailedDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffDt", dt_ClaimLayoffDt));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffTime", dt_ClaimLayoffTime));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffTimeAMPMInd", ClaimLayoffTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportReturnedToWorkInd", c_EmployerInjuryReportReturnedToWorkInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffEndDt", dt_ClaimLayoffEndDt));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffEndOfLayoffTime", dt_ClaimLayoffEndOfLayoffTime));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffEndOfLayoffTimeAMPMInd", ClaimLayoffEndOfLayoffTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffReturnToWorkTypeCd", ClaimLayoffReturnToWorkTypeCd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportContPayWorkerInd", c_EmployerInjuryReportContPayWorkerInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportContPayWorkerAmt", d_EmployerInjuryReportContPayWorkerAmt));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportFullHoursInd", c_EmployerInjuryReportFullHoursInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportHoursWorked", d_EmployerInjuryReportHoursWorked));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportFullPayInd", c_EmployerInjuryReportFullPayInd));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsModWorkOfferedInd", c_InjRptEmplmntEarnsModWorkOfferedInd));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsModWorkOfferedDesc", InjRptEmplmntEarnsModWorkOfferedDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimantEmploymentTypeCode", ClaimantEmploymentTypeCode));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsSeasnStrtDt", dt_InjRptEmplmntEarnsSeasnStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsSeasnEndDt", dt_InjRptEmplmntEarnsSeasnEndDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntTermDt", dt_InjRptEmplmntEarnsEmplmntTermDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntTermEstInd", InjRptEmplmntEarnsEmplmntTermEstInd));
cmd.Parameters.Add(new SqlParameter("@C040PartOfBodyCode", PartOfBodyCode));
cmd.Parameters.Add(new SqlParameter("@C040SideOfBodyCode", SideOfBodyCode));
cmd.Parameters.Add(new SqlParameter("@C040NatureOfInjuryCode", NatureOfInjuryCode));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntDuration", i_InjRptEmplmntEarnsEmplmntDuration));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntDurationCd", InjRptEmplmntEarnsEmplmntDurationCd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmplymntDtlOthEmplmntTypDesc", AccidentEmplymntDtlOthEmplmntTypDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentIncomeSupervisorName", ClaimEmploymentIncomeSupervisorName));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentIncomeSupervisorAreaCd", i_ClaimEmploymentIncomeSupervisorAreaCd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentIncomeSupervisorPhone", i_ClaimEmploymentIncomeSupervisorPhone));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsYearlyGross", d_InjRptEmplmntEarnsYearlyGross));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsYearlyGrossStrtDt", dt_InjRptEmplmntEarnsYearlyGrossStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040InjEmplmntEarnsYearlyGrossEndDt", dt_InjEmplmntEarnsYearlyGrossEndDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsMissedPayInd", c_InjRptEmplmntEarnsMissedPayInd));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsMissedPayDesc", InjRptEmplmntEarnsMissedPayDesc));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmploymentWagesAmt", d_InjuryReportClaimEmploymentWagesAmt));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntWagesVacPayTimeInd", c_InjuryReportClaimEmplmntWagesVacPayTimeInd));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntWagesVacPayPaidInd", c_InjuryReportClaimEmplmntWagesVacPayPaidInd));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntWagesAmt", d_InjuryReportClaimEmplmntWagesAmt));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntPeriodStart", dt_InjuryReportClaimEmplmntPeriodStart));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntPeriodEnd", dt_InjuryReportClaimEmplmntPeriodEnd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentShiftCycleTypeInd", ClaimEmploymentShiftCycleTypeInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentShiftCycleType", ClaimEmploymentShiftCycleType));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsStdShiftCyclStrtDt", dt_InjRptEmplmntEarnsStdShiftCyclStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsShiftCyclDays", i_InjRptEmplmntEarnsShiftCyclDays));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsCstmShiftCyclStrtDt", dt_InjRptEmplmntEarnsCstmShiftCyclStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportAdditionalCommentsDesc", EmployerInjuryReportAdditionalCommentsDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleSunHrs", d_ClmEmplmntShiftCycleSunHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleMonHrs", d_ClmEmplmntShiftCycleMonHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleTueHrs", d_ClmEmplmntShiftCycleTueHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleWedHrs", d_ClmEmplmntShiftCycleWedHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleThuHrs", d_ClmEmplmntShiftCycleThuHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleFriHrs", d_ClmEmplmntShiftCycleFriHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleSatHrs", d_ClmEmplmntShiftCycleSatHrs));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactCountryCode", AccidentEmploymentContactCountryCode));
strErr = "Execute SharePointUpdateC040 stored procedure";
int recs = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
return strErr + ":" + ex.Message;
}
return string.Empty;
}
[WebMethod]
public string SaveIncidentMultiParam(
int i_GenIncidentID,
int i_GenIncidentStatusID,
int i_GenPersonID,
string GenPositionTitle,
string GenWitnessNames,
string GenInvestigationDetails,
char c_GenBodySide,
string GenBodyPartAdditional,
string GenCauseDetails,
string GenCorrectiveActionSuggestedDetails,
string GenCorrectiveActionTakenDetails,
int i_GenSupervisorOnDutyID,
int i_GenSupervisorReportingID,
int i_GenManagerID,
int i_GenDirectorID,
DateTime dt_GenSupervisorSigDateTime,
DateTime dt_GenManagerSigDateTime,
DateTime dt_GenDirectorSigDateTime,
DateTime dt_GenDirectorSigCATDateTime,
int i_GenHRContactID,
string GenROSSPositionLocation,
string i_GenC040ClaimStatusCode,
int i_ParamID,
int i_ParamDepartmentID,
int i_ParamLocationID,
int i_ParamBodyPartID,
int i_ParamAccidentTypeID,
int i_ParamInjuryTypeID,
int i_ParamInjurySourceID,
int i_ParamIncidentClassID,
int i_ParamCauseID,
int i_ParamSuggestedCorrectiveActionID,
DateTime dt_ParamIncidentDateTime,
DateTime dt_ParamReportedDateTime,
DateTime dt_ParamDateSickBankExpired,
DateTime dt_ParamDateTwoYearTermination,
DateTime dt_ParamDateTimeHRReceivedC040,
DateTime dt_ParamDateTimeC040Submitted,
DateTime dt_ParamDateTimeHRReceivedHR13,
int i_ParamHoursToReported,
int i_ParamEmployeeAge,
int i_ParamMonthsOfService,
int i_ParamShiftsLost,
int i_ParamShiftsModified,
int i_ParamDaysCompensated,
int i_ParamDaysTTD,
DateTime dt_ParamDateTimeTTDFlag,
DateTime dt_ParamDateFirstMissed,
DateTime dt_ParamDateReturnFull,
DateTime dt_ParamDateReturnModified,
int i_ParamIncidentDateStatusID,
string ParamEnvironmentalFactors,
int i_ParamInvestigatingSuperID,
string ParamLocationExact,
string ParamPoliciesProcedures,
string ParamProtectiveEquipment,
bool b_ParamRegularDuties,
string ParamRelatedIncidents,
bool b_ParamTrainingCPI,
bool b_ParamTrainingIntroToCare,
bool b_ParamTrainingMSIP,
string ParamTrainingOther,
bool b_ParamWorkRelated,
string ParamEquipmentNotes
)
{
SqlConnection conn = null;
SqlCommand cmd = null;
SqlCommand cmd_gen = null;
string strErr = "myFields assignment";
try
{
strErr = "database connection";
conn = new SqlConnection("Server=*****;DataBase=******");
cmd = new SqlCommand("SharePointCreateIncident", conn);
cmd.CommandType = CommandType.StoredProcedure;
strErr = "general parameter value assignements";
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentID", i_GenIncidentID));
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentStatusID", i_GenIncidentStatusID));
cmd_gen.Parameters.Add(new SqlParameter("@GenPersonID", i_GenPersonID));
cmd_gen.Parameters.Add(new SqlParameter("@GenPositionTitle", GenPositionTitle));
cmd_gen.Parameters.Add(new SqlParameter("@GenWitnessNames", GenWitnessNames));
cmd_gen.Parameters.Add(new SqlParameter("@GenInvestigationDetails", GenInvestigationDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodySide", c_GenBodySide));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodyPartAdditional", GenBodyPartAdditional));
cmd_gen.Parameters.Add(new SqlParameter("@GenCauseDetails", GenCauseDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionSuggestedDetails", GenCorrectiveActionSuggestedDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionTakenDetails", GenCorrectiveActionTakenDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorOnDutyID", i_GenSupervisorOnDutyID));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorReportingID", i_GenSupervisorReportingID));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerID", i_GenManagerID));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorID", i_GenDirectorID));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorSigDateTime", dt_GenDirectorSigCATDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerSigDateTime", dt_GenManagerSigDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigDateTime", dt_GenDirectorSigDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigCATDateTime", dt_GenDirectorSigCATDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenHRContactID", i_GenHRContactID));
cmd_gen.Parameters.Add(new SqlParameter("@GenROSSPositionLocation", GenROSSPositionLocation));
cmd_gen.Parameters.Add(new SqlParameter("@GenC040ClaimStatusCode", i_GenC040ClaimStatusCode));
strErr = "details parameter value assignements";
cmd_gen.Parameters.Add(new SqlParameter("@ParamID", i_ParamID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDepartmentID", i_ParamDepartmentID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamLocationID", i_ParamLocationID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamBodyPartID", i_ParamBodyPartID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamAccidentTypeID", i_ParamAccidentTypeID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamInjuryTypeID", i_ParamInjuryTypeID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamInjurySourceID", i_ParamInjurySourceID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamIncidentClassID", i_ParamIncidentClassID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamCauseID", i_ParamCauseID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamSuggestedCorrectiveActionID", i_ParamSuggestedCorrectiveActionID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamIncidentDateTime", dt_ParamIncidentDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@ParamReportedDateTime", dt_ParamReportedDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateSickBankExpired", dt_ParamDateSickBankExpired));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTwoYearTermination", dt_ParamDateTwoYearTermination));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedC040", dt_ParamDateTimeHRReceivedC040));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeC040Submitted", dt_ParamDateTimeC040Submitted));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedHR13", dt_ParamDateTimeHRReceivedHR13));
cmd_gen.Parameters.Add(new SqlParameter("@ParamHoursToReported", i_ParamHoursToReported));
cmd_gen.Parameters.Add(new SqlParameter("@ParamEmployeeAge", i_ParamEmployeeAge));
cmd_gen.Parameters.Add(new SqlParameter("@ParamMonthsOfService", i_ParamMonthsOfService));
cmd_gen.Parameters.Add(new SqlParameter("@ParamShiftsLost", i_ParamShiftsLost));
cmd_gen.Parameters.Add(new SqlParameter("@ParamShiftsModified", i_ParamShiftsModified));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDaysCompensated", i_ParamDaysCompensated));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDaysTTD", i_ParamDaysTTD));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeTTDFlag", dt_ParamDateTimeTTDFlag));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateFirstMissed", dt_ParamDateFirstMissed));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateReturnFull", dt_ParamDateReturnFull));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateReturnModified", dt_ParamDateReturnModified));
cmd_gen.Parameters.Add(new SqlParameter("@ParamIncidentDateStatusID", i_ParamIncidentDateStatusID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamEnvironmentalFactors", ParamEnvironmentalFactors));
cmd_gen.Parameters.Add(new SqlParameter("@ParamInvestigatingSuperID", i_ParamInvestigatingSuperID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamLocationExact", ParamLocationExact));
cmd_gen.Parameters.Add(new SqlParameter("@ParamPoliciesProcedures", ParamPoliciesProcedures));
cmd_gen.Parameters.Add(new SqlParameter("@ParamProtectiveEquipment", ParamProtectiveEquipment));
cmd_gen.Parameters.Add(new SqlParameter("@ParamRegularDuties", b_ParamRegularDuties));
cmd_gen.Parameters.Add(new SqlParameter("@ParamRelatedIncidents", ParamRelatedIncidents));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingCPI", b_ParamTrainingCPI));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingIntroToCare", b_ParamTrainingIntroToCare));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingMSIP", b_ParamTrainingMSIP));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingOther", ParamTrainingOther));
cmd_gen.Parameters.Add(new SqlParameter("@ParamWorkRelated", b_ParamWorkRelated));
cmd_gen.Parameters.Add(new SqlParameter("@ParamEquipmentNotes", ParamEquipmentNotes));
strErr = "Execute SharePointCreateIncident stored procedure";
int recs = cmd_gen.ExecuteNonQuery();
}
catch (Exception ex)
{
return strErr + ":" + ex.Message;
}
return string.Empty;
}
[WebMethod]
public string SaveIncident(myFields mF)
{
SqlConnection conn = null;
SqlCommand cmd = null;
SqlCommand cmd_gen = null;
string strErr = "myFields assignment";
try
{
RelatedInjuryInfo rii = mF.RelatedInjuryInfo;
bool? cii = mF.chkInjury;
sectIncidentID sii = mF.sectIncidentID;
sectAccidentType[] gfas = mF.GroupForAccidentSect;
Section1 s1 = mF.Section1;
PassedParam pp = mF.PassedParam;
IncidentIDDisplay iid = mF.IncidentIDDisplay;
strErr = "database connection";
conn = new SqlConnection("Server=****;DataBase=*****");
cmd = new SqlCommand("CreateIncidentDetails", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd_gen = new SqlCommand("CreateIncidentGeneral", conn);
cmd_gen.CommandType = CommandType.StoredProcedure;
strErr = "general parameter value assignements";
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentStatusID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenPersonID", s1.EmpID));
cmd_gen.Parameters.Add(new SqlParameter("@GenPositionTitle", 0));
cmd_gen.Parameters.Add(new SqlParameter("@GenWitnessNames", s1.WitnessNames));
cmd_gen.Parameters.Add(new SqlParameter("@GenInvestigationDetails", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodySide", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodyPartAdditional", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenCauseDetails", pp.DetailParam));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionSuggestedDetails", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionTakenDetails", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorOnDutyID", s1.InvestigatingSuperID));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorReportingID", s1.ReportedToID));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorSigDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerSigDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigCATDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenHRContactID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenROSSPositionLocation", null));
strErr = "Execute general stored procedure";
int recs = cmd_gen.ExecuteNonQuery();
strErr = "details parameter value assignements";
cmd.Parameters.Add(new SqlParameter("@ParamID", null));
cmd.Parameters.Add(new SqlParameter("@ParamDepartmentID", s1.Department));
cmd.Parameters.Add(new SqlParameter("@ParamLocationID", null));
cmd.Parameters.Add(new SqlParameter("@ParamBodyPartID", null));
cmd.Parameters.Add(new SqlParameter("@ParamAccidentTypeID", gfas[0].ddAccidentType));
cmd.Parameters.Add(new SqlParameter("@ParamInjuryTypeID", gfas[0].ddInjuryType));
cmd.Parameters.Add(new SqlParameter("@ParamInjurySourceID", null));
cmd.Parameters.Add(new SqlParameter("@ParamIncidentClassID", null));
cmd.Parameters.Add(new SqlParameter("@ParamCauseID", null));
cmd.Parameters.Add(new SqlParameter("@ParamSuggestedCorrectiveActionID", null));
cmd.Parameters.Add(new SqlParameter("@ParamIncidentDateTime", null));
cmd.Parameters.Add(new SqlParameter("@ParamReportedDateTime", s1.DateReported));
cmd.Parameters.Add(new SqlParameter("@ParamDateSickBankExpired", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTwoYearTermination", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedC040", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeC040Submitted", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedHR13", null));
cmd.Parameters.Add(new SqlParameter("@ParamHoursToReported", null));
cmd.Parameters.Add(new SqlParameter("@ParamEmployeeAge", null));
cmd.Parameters.Add(new SqlParameter("@ParamMonthsOfService", null));
cmd.Parameters.Add(new SqlParameter("@ParamShiftsLost", null));
cmd.Parameters.Add(new SqlParameter("@ParamShiftsModified", null));
cmd.Parameters.Add(new SqlParameter("@ParamDaysCompensated", null));
cmd.Parameters.Add(new SqlParameter("@ParamDaysTTD", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeTTDFlag", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateFirstMissed", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateReturnFull", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateReturnModified", null));
cmd.Parameters.Add(new SqlParameter("@ParamIncidentDateStatusID", null));
strErr = "Execute details stored procedure";
recs = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
return strErr + ":" + ex.Message;
}
return string.Empty;
}
/*
public string SaveIncidentMultiParam(
string RelatedInjuryInfo,
bool b_chkInjury,
string sectIncidentID,
string AccidentType,
string InjuryType,
string Employee,
string Division,
string EmpLastName,
string WitnessNames,
DateTime d_IncidentDate,
DateTime d_DateReported,
string Department,
string ReportedToName,
string ReportedToID,
string InvestigatingSuperID,
string InvestigatingSupervisorName,
string EmpID,
int i_DetailRecCount,
string DetailParam,
int i_dispIncidentID,
string RecordCount,
string IncidentIDDisplay
)
*/
}
}
View the full article
I am not a c# developer but I am trying to debug a web service. I submitting an InfoPath 2010 form to an SQL Server 2008 db using a C# the webservice that was built for me. I have included the error messages and code below.
Here is what I have tried so far:
- Compared the stored procedure data types to the web services data types
- Compared the fomr data types to the web service
- When the data types did not match I Converted / Cast the variables to the appropriate data type in the SQL
I have included the error messages and code below.
Any suggestions would be great.
Thank you,
Trevor
----Error Messages--------
Form submission failed. *******
IncidentID=21345, Form ID: urn:schemas-microsoft-comffice:infopath:HR13-Completed:-myXSD-2013-01-11T03-59-31, Type: DataAdapterException, Exception Message: The remote server returned an error: (500) Internal Server Error. System.Web.Services.Protocols.SoapException: Server was unable to read request. --->
System.InvalidOperationException: There is an error in XML document (1, 466). ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Xml.XmlConvert.ToInt32(String s)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read13_SaveIncidentMultiParam()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer4.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() The remote server returned an error: (500) Internal Server Error.)
-----Code-----using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;
namespace BcsItaWS
{
/// <summary>
/// Summary description for BcsItaWs
/// </summary>
[WebService(Namespace = "h t t p://tempuri DOT org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class BcsItaWs : System.Web.Services.WebService
{
[WebMethod]
public string SaveC040MultiParam(
char c_EmployerInjuryReportLostTimeInd,
char c_ClaimModifiedWorkInd,
string ClaimCISReferenceNumber,
string PersonLastName,
string PersonFirstName,
string PersonMiddleName,
string ClientAddressLineOne,
string ClientAddressLineTwo,
string ClientAddressCity,
string ProvinceStateTerritoryTypeCode,
string ClientAddressPostalCode,
string CountryCode,
int i_ClientPhoneAreaCode,
int i_ClientPhoneNumber,
DateTime dt_PersonBirthDate,
string PersonGenderTypeCode,
int i_SocialInsuranceNumber,
char c_PersonalHealthAlbertaInd,
int i_PersonalHealthNumber,
string InjuryReportJobTitleDesc,
string AccidentEmploymentDetailDesc,
DateTime dt_AccidentEmploymentDetailHiredDt,
char c_AccidentEmploymentDetailApprenticeInd,
DateTime dt_AccidentEmploymentDetailJourneymanDate,
int i_EmployerAccountNumber,
int i_EmployerIndustryCode,
int i_ClientPhoneExtension,
string ClientEmailAddress,
char c_EmployerInjuryReportPersonalCovInd,
char c_EmployerInjuryReportPartnerDirInd,
string AccidentEmploymentContactName,
string AccidentEmploymentContactTitle,
string AccidentEmploymentContactOtherTitleDesc,
int AccidentEmploymentContactAreaCd,
int AccidentEmploymentContactPhoneNumber,
DateTime dt_AccidentDate,
DateTime dt_AccidentTime,
string AccidentTimeAMPMInd,
DateTime dt_AccidentDtStartTime,
string AccidentDtStartTimeAMPMInd,
DateTime AccidentDtEndTime,
string AccidentDtEndTimeAMPMInd,
string ClaimProgressiveRepetitiveInjuryInd,
string ClaimProgressiveRepetitiveInjurtInvestigDesc,
string ClaimProgressiveRepetitiveInjuryDesc,
DateTime dt_AccidentReportedToEmployerDt,
string AccidentReportDelayDesc,
string AccidentToWhomReportedName,
string AccidentToWhomReportTitle,
int i_AccidentToWhomReportedAreaCd,
int i_AccidentToWhomReportedTel,
string AccidentActionsPurposeBusinessInd,
string AccidentActionsUsualWorkInd,
string AccidentInjuryAdditionalPOBDesc,
string AccidentOccurredEmployerPremisesInd,
string AccidentLocationStreet,
string AccidentLocationCity,
string AccidentLocationProvinceStateCode,
string AccidentLocationCountryCode,
string AccidentLocationPostalCode,
string AccidentInjuryDetailedDesc,
DateTime dt_ClaimLayoffDt,
DateTime dt_ClaimLayoffTime,
string ClaimLayoffTimeAMPMInd,
char c_EmployerInjuryReportReturnedToWorkInd,
DateTime dt_ClaimLayoffEndDt,
DateTime dt_ClaimLayoffEndOfLayoffTime,
string ClaimLayoffEndOfLayoffTimeAMPMInd,
string ClaimLayoffReturnToWorkTypeCd,
char c_EmployerInjuryReportContPayWorkerInd,
decimal d_EmployerInjuryReportContPayWorkerAmt,
char c_EmployerInjuryReportFullHoursInd,
decimal d_EmployerInjuryReportHoursWorked,
char c_EmployerInjuryReportFullPayInd,
char c_InjRptEmplmntEarnsModWorkOfferedInd,
string InjRptEmplmntEarnsModWorkOfferedDesc,
string ClaimantEmploymentTypeCode,
DateTime dt_InjRptEmplmntEarnsSeasnStrtDt,
DateTime dt_InjRptEmplmntEarnsSeasnEndDt,
DateTime dt_InjRptEmplmntEarnsEmplmntTermDt,
string InjRptEmplmntEarnsEmplmntTermEstInd,
string PartOfBodyCode,
string SideOfBodyCode,
string NatureOfInjuryCode,
int i_InjRptEmplmntEarnsEmplmntDuration,
string InjRptEmplmntEarnsEmplmntDurationCd,
string AccidentEmplymntDtlOthEmplmntTypDesc,
string ClaimEmploymentIncomeSupervisorName,
int i_ClaimEmploymentIncomeSupervisorAreaCd,
int i_ClaimEmploymentIncomeSupervisorPhone,
decimal d_InjRptEmplmntEarnsYearlyGross,
DateTime dt_InjRptEmplmntEarnsYearlyGrossStrtDt,
DateTime dt_InjEmplmntEarnsYearlyGrossEndDt,
char c_InjRptEmplmntEarnsMissedPayInd,
string InjRptEmplmntEarnsMissedPayDesc,
decimal d_InjuryReportClaimEmploymentWagesAmt,
char c_InjuryReportClaimEmplmntWagesVacPayTimeInd,
char c_InjuryReportClaimEmplmntWagesVacPayPaidInd,
decimal d_InjuryReportClaimEmplmntWagesAmt,
DateTime dt_InjuryReportClaimEmplmntPeriodStart,
DateTime dt_InjuryReportClaimEmplmntPeriodEnd,
string ClaimEmploymentShiftCycleTypeInd,
string ClaimEmploymentShiftCycleType,
DateTime dt_InjRptEmplmntEarnsStdShiftCyclStrtDt,
int i_InjRptEmplmntEarnsShiftCyclDays,
DateTime dt_InjRptEmplmntEarnsCstmShiftCyclStrtDt,
string EmployerInjuryReportAdditionalCommentsDesc,
decimal d_ClmEmplmntShiftCycleSunHrs,
decimal d_ClmEmplmntShiftCycleMonHrs,
decimal d_ClmEmplmntShiftCycleTueHrs,
decimal d_ClmEmplmntShiftCycleWedHrs,
decimal d_ClmEmplmntShiftCycleThuHrs,
decimal d_ClmEmplmntShiftCycleFriHrs,
decimal d_ClmEmplmntShiftCycleSatHrs,
string AccidentEmploymentContactCountryCode
)
{
SqlConnection conn = null;
SqlCommand cmd = null;
string strErr = "myFields assignment";
try
{
strErr = "database connection";
conn = new SqlConnection("Server=****;DataBase=*****");
cmd = new SqlCommand("SharePointUpdateC040", conn);
cmd.CommandType = CommandType.StoredProcedure;
strErr = "c040 parameter value assignements";
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportLostTimeInd", c_EmployerInjuryReportLostTimeInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimModifiedWorkInd", c_ClaimModifiedWorkInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimCISReferenceNumber", ClaimCISReferenceNumber));
cmd.Parameters.Add(new SqlParameter("@C040PersonLastName", PersonLastName));
cmd.Parameters.Add(new SqlParameter("@C040PersonFirstName", PersonFirstName));
cmd.Parameters.Add(new SqlParameter("@C040PersonMiddleName", PersonMiddleName));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressLineOne", ClientAddressLineOne));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressLineTwo", ClientAddressLineTwo));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressCity", ClientAddressCity));
cmd.Parameters.Add(new SqlParameter("@C040ProvinceStateTerritoryTypeCode", ProvinceStateTerritoryTypeCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientAddressPostalCode", ClientAddressPostalCode));
cmd.Parameters.Add(new SqlParameter("@C040CountryCode", CountryCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientPhoneAreaCode", i_ClientPhoneAreaCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientPhoneNumber", i_ClientPhoneNumber));
cmd.Parameters.Add(new SqlParameter("@C040PersonBirthDate", dt_PersonBirthDate));
cmd.Parameters.Add(new SqlParameter("@C040PersonGenderTypeCode", PersonGenderTypeCode));
cmd.Parameters.Add(new SqlParameter("@C040SocialInsuranceNumber", i_SocialInsuranceNumber));
cmd.Parameters.Add(new SqlParameter("@C040PersonalHealthAlbertaInd", c_PersonalHealthAlbertaInd));
cmd.Parameters.Add(new SqlParameter("@C040PersonalHealthNumber", i_PersonalHealthNumber));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportJobTitleDesc", InjuryReportJobTitleDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailDesc", AccidentEmploymentDetailDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailHiredDt", dt_AccidentEmploymentDetailHiredDt));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailApprenticeInd", c_AccidentEmploymentDetailApprenticeInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentDetailJourneymanDate", dt_AccidentEmploymentDetailJourneymanDate));
cmd.Parameters.Add(new SqlParameter("@C040EmployerAccountNumber", i_EmployerAccountNumber));
cmd.Parameters.Add(new SqlParameter("@C040EmployerIndustryCode", i_EmployerIndustryCode));
cmd.Parameters.Add(new SqlParameter("@C040ClientPhoneExtension", i_ClientPhoneExtension));
cmd.Parameters.Add(new SqlParameter("@C040ClientEmailAddress", ClientEmailAddress));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportPersonalCovInd", c_EmployerInjuryReportPersonalCovInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportPartnerDirInd", c_EmployerInjuryReportPartnerDirInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactName", AccidentEmploymentContactName));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactTitle", AccidentEmploymentContactTitle));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactOtherTitleDesc", AccidentEmploymentContactOtherTitleDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactAreaCd", AccidentEmploymentContactAreaCd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactPhoneNumber", AccidentEmploymentContactPhoneNumber));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDate", dt_AccidentDate));
cmd.Parameters.Add(new SqlParameter("@C040AccidentTime", dt_AccidentTime));
cmd.Parameters.Add(new SqlParameter("@C040AccidentTimeAMPMInd", AccidentTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtStartTime", dt_AccidentDtStartTime));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtStartTimeAMPMInd", AccidentDtStartTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtEndTime", AccidentDtEndTime));
cmd.Parameters.Add(new SqlParameter("@C040AccidentDtEndTimeAMPMInd", AccidentDtEndTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimProgressiveRepetitiveInjuryInd", ClaimProgressiveRepetitiveInjuryInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimProgressiveRepetitiveInjurtInvestigDesc", ClaimProgressiveRepetitiveInjurtInvestigDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimProgressiveRepetitiveInjuryDesc", ClaimProgressiveRepetitiveInjuryDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentReportedToEmployerDt", dt_AccidentReportedToEmployerDt));
cmd.Parameters.Add(new SqlParameter("@C040AccidentReportDelayDesc", AccidentReportDelayDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportedName", AccidentToWhomReportedName));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportTitle", AccidentToWhomReportTitle));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportedAreaCd", i_AccidentToWhomReportedAreaCd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentToWhomReportedTel", i_AccidentToWhomReportedTel));
cmd.Parameters.Add(new SqlParameter("@C040AccidentActionsPurposeBusinessInd", AccidentActionsPurposeBusinessInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentActionsUsualWorkInd", AccidentActionsUsualWorkInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentInjuryAdditionalPOBDesc", AccidentInjuryAdditionalPOBDesc));
cmd.Parameters.Add(new SqlParameter("@C040AccidentOccurredEmployerPremisesInd", AccidentOccurredEmployerPremisesInd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationStreet", AccidentLocationStreet));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationCity", AccidentLocationCity));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationProvinceStateCode", AccidentLocationProvinceStateCode));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationCountryCode", AccidentLocationCountryCode));
cmd.Parameters.Add(new SqlParameter("@C040AccidentLocationPostalCode", AccidentLocationPostalCode));
cmd.Parameters.Add(new SqlParameter("@C040AccidentInjuryDetailedDesc", AccidentInjuryDetailedDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffDt", dt_ClaimLayoffDt));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffTime", dt_ClaimLayoffTime));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffTimeAMPMInd", ClaimLayoffTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportReturnedToWorkInd", c_EmployerInjuryReportReturnedToWorkInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffEndDt", dt_ClaimLayoffEndDt));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffEndOfLayoffTime", dt_ClaimLayoffEndOfLayoffTime));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffEndOfLayoffTimeAMPMInd", ClaimLayoffEndOfLayoffTimeAMPMInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimLayoffReturnToWorkTypeCd", ClaimLayoffReturnToWorkTypeCd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportContPayWorkerInd", c_EmployerInjuryReportContPayWorkerInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportContPayWorkerAmt", d_EmployerInjuryReportContPayWorkerAmt));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportFullHoursInd", c_EmployerInjuryReportFullHoursInd));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportHoursWorked", d_EmployerInjuryReportHoursWorked));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportFullPayInd", c_EmployerInjuryReportFullPayInd));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsModWorkOfferedInd", c_InjRptEmplmntEarnsModWorkOfferedInd));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsModWorkOfferedDesc", InjRptEmplmntEarnsModWorkOfferedDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimantEmploymentTypeCode", ClaimantEmploymentTypeCode));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsSeasnStrtDt", dt_InjRptEmplmntEarnsSeasnStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsSeasnEndDt", dt_InjRptEmplmntEarnsSeasnEndDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntTermDt", dt_InjRptEmplmntEarnsEmplmntTermDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntTermEstInd", InjRptEmplmntEarnsEmplmntTermEstInd));
cmd.Parameters.Add(new SqlParameter("@C040PartOfBodyCode", PartOfBodyCode));
cmd.Parameters.Add(new SqlParameter("@C040SideOfBodyCode", SideOfBodyCode));
cmd.Parameters.Add(new SqlParameter("@C040NatureOfInjuryCode", NatureOfInjuryCode));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntDuration", i_InjRptEmplmntEarnsEmplmntDuration));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsEmplmntDurationCd", InjRptEmplmntEarnsEmplmntDurationCd));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmplymntDtlOthEmplmntTypDesc", AccidentEmplymntDtlOthEmplmntTypDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentIncomeSupervisorName", ClaimEmploymentIncomeSupervisorName));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentIncomeSupervisorAreaCd", i_ClaimEmploymentIncomeSupervisorAreaCd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentIncomeSupervisorPhone", i_ClaimEmploymentIncomeSupervisorPhone));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsYearlyGross", d_InjRptEmplmntEarnsYearlyGross));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsYearlyGrossStrtDt", dt_InjRptEmplmntEarnsYearlyGrossStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040InjEmplmntEarnsYearlyGrossEndDt", dt_InjEmplmntEarnsYearlyGrossEndDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsMissedPayInd", c_InjRptEmplmntEarnsMissedPayInd));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsMissedPayDesc", InjRptEmplmntEarnsMissedPayDesc));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmploymentWagesAmt", d_InjuryReportClaimEmploymentWagesAmt));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntWagesVacPayTimeInd", c_InjuryReportClaimEmplmntWagesVacPayTimeInd));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntWagesVacPayPaidInd", c_InjuryReportClaimEmplmntWagesVacPayPaidInd));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntWagesAmt", d_InjuryReportClaimEmplmntWagesAmt));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntPeriodStart", dt_InjuryReportClaimEmplmntPeriodStart));
cmd.Parameters.Add(new SqlParameter("@C040InjuryReportClaimEmplmntPeriodEnd", dt_InjuryReportClaimEmplmntPeriodEnd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentShiftCycleTypeInd", ClaimEmploymentShiftCycleTypeInd));
cmd.Parameters.Add(new SqlParameter("@C040ClaimEmploymentShiftCycleType", ClaimEmploymentShiftCycleType));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsStdShiftCyclStrtDt", dt_InjRptEmplmntEarnsStdShiftCyclStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsShiftCyclDays", i_InjRptEmplmntEarnsShiftCyclDays));
cmd.Parameters.Add(new SqlParameter("@C040InjRptEmplmntEarnsCstmShiftCyclStrtDt", dt_InjRptEmplmntEarnsCstmShiftCyclStrtDt));
cmd.Parameters.Add(new SqlParameter("@C040EmployerInjuryReportAdditionalCommentsDesc", EmployerInjuryReportAdditionalCommentsDesc));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleSunHrs", d_ClmEmplmntShiftCycleSunHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleMonHrs", d_ClmEmplmntShiftCycleMonHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleTueHrs", d_ClmEmplmntShiftCycleTueHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleWedHrs", d_ClmEmplmntShiftCycleWedHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleThuHrs", d_ClmEmplmntShiftCycleThuHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleFriHrs", d_ClmEmplmntShiftCycleFriHrs));
cmd.Parameters.Add(new SqlParameter("@C040ClmEmplmntShiftCycleSatHrs", d_ClmEmplmntShiftCycleSatHrs));
cmd.Parameters.Add(new SqlParameter("@C040AccidentEmploymentContactCountryCode", AccidentEmploymentContactCountryCode));
strErr = "Execute SharePointUpdateC040 stored procedure";
int recs = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
return strErr + ":" + ex.Message;
}
return string.Empty;
}
[WebMethod]
public string SaveIncidentMultiParam(
int i_GenIncidentID,
int i_GenIncidentStatusID,
int i_GenPersonID,
string GenPositionTitle,
string GenWitnessNames,
string GenInvestigationDetails,
char c_GenBodySide,
string GenBodyPartAdditional,
string GenCauseDetails,
string GenCorrectiveActionSuggestedDetails,
string GenCorrectiveActionTakenDetails,
int i_GenSupervisorOnDutyID,
int i_GenSupervisorReportingID,
int i_GenManagerID,
int i_GenDirectorID,
DateTime dt_GenSupervisorSigDateTime,
DateTime dt_GenManagerSigDateTime,
DateTime dt_GenDirectorSigDateTime,
DateTime dt_GenDirectorSigCATDateTime,
int i_GenHRContactID,
string GenROSSPositionLocation,
string i_GenC040ClaimStatusCode,
int i_ParamID,
int i_ParamDepartmentID,
int i_ParamLocationID,
int i_ParamBodyPartID,
int i_ParamAccidentTypeID,
int i_ParamInjuryTypeID,
int i_ParamInjurySourceID,
int i_ParamIncidentClassID,
int i_ParamCauseID,
int i_ParamSuggestedCorrectiveActionID,
DateTime dt_ParamIncidentDateTime,
DateTime dt_ParamReportedDateTime,
DateTime dt_ParamDateSickBankExpired,
DateTime dt_ParamDateTwoYearTermination,
DateTime dt_ParamDateTimeHRReceivedC040,
DateTime dt_ParamDateTimeC040Submitted,
DateTime dt_ParamDateTimeHRReceivedHR13,
int i_ParamHoursToReported,
int i_ParamEmployeeAge,
int i_ParamMonthsOfService,
int i_ParamShiftsLost,
int i_ParamShiftsModified,
int i_ParamDaysCompensated,
int i_ParamDaysTTD,
DateTime dt_ParamDateTimeTTDFlag,
DateTime dt_ParamDateFirstMissed,
DateTime dt_ParamDateReturnFull,
DateTime dt_ParamDateReturnModified,
int i_ParamIncidentDateStatusID,
string ParamEnvironmentalFactors,
int i_ParamInvestigatingSuperID,
string ParamLocationExact,
string ParamPoliciesProcedures,
string ParamProtectiveEquipment,
bool b_ParamRegularDuties,
string ParamRelatedIncidents,
bool b_ParamTrainingCPI,
bool b_ParamTrainingIntroToCare,
bool b_ParamTrainingMSIP,
string ParamTrainingOther,
bool b_ParamWorkRelated,
string ParamEquipmentNotes
)
{
SqlConnection conn = null;
SqlCommand cmd = null;
SqlCommand cmd_gen = null;
string strErr = "myFields assignment";
try
{
strErr = "database connection";
conn = new SqlConnection("Server=*****;DataBase=******");
cmd = new SqlCommand("SharePointCreateIncident", conn);
cmd.CommandType = CommandType.StoredProcedure;
strErr = "general parameter value assignements";
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentID", i_GenIncidentID));
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentStatusID", i_GenIncidentStatusID));
cmd_gen.Parameters.Add(new SqlParameter("@GenPersonID", i_GenPersonID));
cmd_gen.Parameters.Add(new SqlParameter("@GenPositionTitle", GenPositionTitle));
cmd_gen.Parameters.Add(new SqlParameter("@GenWitnessNames", GenWitnessNames));
cmd_gen.Parameters.Add(new SqlParameter("@GenInvestigationDetails", GenInvestigationDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodySide", c_GenBodySide));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodyPartAdditional", GenBodyPartAdditional));
cmd_gen.Parameters.Add(new SqlParameter("@GenCauseDetails", GenCauseDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionSuggestedDetails", GenCorrectiveActionSuggestedDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionTakenDetails", GenCorrectiveActionTakenDetails));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorOnDutyID", i_GenSupervisorOnDutyID));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorReportingID", i_GenSupervisorReportingID));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerID", i_GenManagerID));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorID", i_GenDirectorID));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorSigDateTime", dt_GenDirectorSigCATDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerSigDateTime", dt_GenManagerSigDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigDateTime", dt_GenDirectorSigDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigCATDateTime", dt_GenDirectorSigCATDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@GenHRContactID", i_GenHRContactID));
cmd_gen.Parameters.Add(new SqlParameter("@GenROSSPositionLocation", GenROSSPositionLocation));
cmd_gen.Parameters.Add(new SqlParameter("@GenC040ClaimStatusCode", i_GenC040ClaimStatusCode));
strErr = "details parameter value assignements";
cmd_gen.Parameters.Add(new SqlParameter("@ParamID", i_ParamID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDepartmentID", i_ParamDepartmentID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamLocationID", i_ParamLocationID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamBodyPartID", i_ParamBodyPartID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamAccidentTypeID", i_ParamAccidentTypeID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamInjuryTypeID", i_ParamInjuryTypeID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamInjurySourceID", i_ParamInjurySourceID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamIncidentClassID", i_ParamIncidentClassID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamCauseID", i_ParamCauseID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamSuggestedCorrectiveActionID", i_ParamSuggestedCorrectiveActionID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamIncidentDateTime", dt_ParamIncidentDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@ParamReportedDateTime", dt_ParamReportedDateTime));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateSickBankExpired", dt_ParamDateSickBankExpired));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTwoYearTermination", dt_ParamDateTwoYearTermination));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedC040", dt_ParamDateTimeHRReceivedC040));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeC040Submitted", dt_ParamDateTimeC040Submitted));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedHR13", dt_ParamDateTimeHRReceivedHR13));
cmd_gen.Parameters.Add(new SqlParameter("@ParamHoursToReported", i_ParamHoursToReported));
cmd_gen.Parameters.Add(new SqlParameter("@ParamEmployeeAge", i_ParamEmployeeAge));
cmd_gen.Parameters.Add(new SqlParameter("@ParamMonthsOfService", i_ParamMonthsOfService));
cmd_gen.Parameters.Add(new SqlParameter("@ParamShiftsLost", i_ParamShiftsLost));
cmd_gen.Parameters.Add(new SqlParameter("@ParamShiftsModified", i_ParamShiftsModified));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDaysCompensated", i_ParamDaysCompensated));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDaysTTD", i_ParamDaysTTD));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateTimeTTDFlag", dt_ParamDateTimeTTDFlag));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateFirstMissed", dt_ParamDateFirstMissed));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateReturnFull", dt_ParamDateReturnFull));
cmd_gen.Parameters.Add(new SqlParameter("@ParamDateReturnModified", dt_ParamDateReturnModified));
cmd_gen.Parameters.Add(new SqlParameter("@ParamIncidentDateStatusID", i_ParamIncidentDateStatusID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamEnvironmentalFactors", ParamEnvironmentalFactors));
cmd_gen.Parameters.Add(new SqlParameter("@ParamInvestigatingSuperID", i_ParamInvestigatingSuperID));
cmd_gen.Parameters.Add(new SqlParameter("@ParamLocationExact", ParamLocationExact));
cmd_gen.Parameters.Add(new SqlParameter("@ParamPoliciesProcedures", ParamPoliciesProcedures));
cmd_gen.Parameters.Add(new SqlParameter("@ParamProtectiveEquipment", ParamProtectiveEquipment));
cmd_gen.Parameters.Add(new SqlParameter("@ParamRegularDuties", b_ParamRegularDuties));
cmd_gen.Parameters.Add(new SqlParameter("@ParamRelatedIncidents", ParamRelatedIncidents));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingCPI", b_ParamTrainingCPI));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingIntroToCare", b_ParamTrainingIntroToCare));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingMSIP", b_ParamTrainingMSIP));
cmd_gen.Parameters.Add(new SqlParameter("@ParamTrainingOther", ParamTrainingOther));
cmd_gen.Parameters.Add(new SqlParameter("@ParamWorkRelated", b_ParamWorkRelated));
cmd_gen.Parameters.Add(new SqlParameter("@ParamEquipmentNotes", ParamEquipmentNotes));
strErr = "Execute SharePointCreateIncident stored procedure";
int recs = cmd_gen.ExecuteNonQuery();
}
catch (Exception ex)
{
return strErr + ":" + ex.Message;
}
return string.Empty;
}
[WebMethod]
public string SaveIncident(myFields mF)
{
SqlConnection conn = null;
SqlCommand cmd = null;
SqlCommand cmd_gen = null;
string strErr = "myFields assignment";
try
{
RelatedInjuryInfo rii = mF.RelatedInjuryInfo;
bool? cii = mF.chkInjury;
sectIncidentID sii = mF.sectIncidentID;
sectAccidentType[] gfas = mF.GroupForAccidentSect;
Section1 s1 = mF.Section1;
PassedParam pp = mF.PassedParam;
IncidentIDDisplay iid = mF.IncidentIDDisplay;
strErr = "database connection";
conn = new SqlConnection("Server=****;DataBase=*****");
cmd = new SqlCommand("CreateIncidentDetails", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd_gen = new SqlCommand("CreateIncidentGeneral", conn);
cmd_gen.CommandType = CommandType.StoredProcedure;
strErr = "general parameter value assignements";
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenIncidentStatusID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenPersonID", s1.EmpID));
cmd_gen.Parameters.Add(new SqlParameter("@GenPositionTitle", 0));
cmd_gen.Parameters.Add(new SqlParameter("@GenWitnessNames", s1.WitnessNames));
cmd_gen.Parameters.Add(new SqlParameter("@GenInvestigationDetails", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodySide", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenBodyPartAdditional", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenCauseDetails", pp.DetailParam));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionSuggestedDetails", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenCorrectiveActionTakenDetails", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorOnDutyID", s1.InvestigatingSuperID));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorReportingID", s1.ReportedToID));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenSupervisorSigDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenManagerSigDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenDirectorSigCATDateTime", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenHRContactID", null));
cmd_gen.Parameters.Add(new SqlParameter("@GenROSSPositionLocation", null));
strErr = "Execute general stored procedure";
int recs = cmd_gen.ExecuteNonQuery();
strErr = "details parameter value assignements";
cmd.Parameters.Add(new SqlParameter("@ParamID", null));
cmd.Parameters.Add(new SqlParameter("@ParamDepartmentID", s1.Department));
cmd.Parameters.Add(new SqlParameter("@ParamLocationID", null));
cmd.Parameters.Add(new SqlParameter("@ParamBodyPartID", null));
cmd.Parameters.Add(new SqlParameter("@ParamAccidentTypeID", gfas[0].ddAccidentType));
cmd.Parameters.Add(new SqlParameter("@ParamInjuryTypeID", gfas[0].ddInjuryType));
cmd.Parameters.Add(new SqlParameter("@ParamInjurySourceID", null));
cmd.Parameters.Add(new SqlParameter("@ParamIncidentClassID", null));
cmd.Parameters.Add(new SqlParameter("@ParamCauseID", null));
cmd.Parameters.Add(new SqlParameter("@ParamSuggestedCorrectiveActionID", null));
cmd.Parameters.Add(new SqlParameter("@ParamIncidentDateTime", null));
cmd.Parameters.Add(new SqlParameter("@ParamReportedDateTime", s1.DateReported));
cmd.Parameters.Add(new SqlParameter("@ParamDateSickBankExpired", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTwoYearTermination", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedC040", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeC040Submitted", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeHRReceivedHR13", null));
cmd.Parameters.Add(new SqlParameter("@ParamHoursToReported", null));
cmd.Parameters.Add(new SqlParameter("@ParamEmployeeAge", null));
cmd.Parameters.Add(new SqlParameter("@ParamMonthsOfService", null));
cmd.Parameters.Add(new SqlParameter("@ParamShiftsLost", null));
cmd.Parameters.Add(new SqlParameter("@ParamShiftsModified", null));
cmd.Parameters.Add(new SqlParameter("@ParamDaysCompensated", null));
cmd.Parameters.Add(new SqlParameter("@ParamDaysTTD", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateTimeTTDFlag", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateFirstMissed", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateReturnFull", null));
cmd.Parameters.Add(new SqlParameter("@ParamDateReturnModified", null));
cmd.Parameters.Add(new SqlParameter("@ParamIncidentDateStatusID", null));
strErr = "Execute details stored procedure";
recs = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
return strErr + ":" + ex.Message;
}
return string.Empty;
}
/*
public string SaveIncidentMultiParam(
string RelatedInjuryInfo,
bool b_chkInjury,
string sectIncidentID,
string AccidentType,
string InjuryType,
string Employee,
string Division,
string EmpLastName,
string WitnessNames,
DateTime d_IncidentDate,
DateTime d_DateReported,
string Department,
string ReportedToName,
string ReportedToID,
string InvestigatingSuperID,
string InvestigatingSupervisorName,
string EmpID,
int i_DetailRecCount,
string DetailParam,
int i_dispIncidentID,
string RecordCount,
string IncidentIDDisplay
)
*/
}
}
View the full article