public static void Main()
XElement CJAdminIEPDHeader = x.GetCJAdminIEPDHeader(String.Join("_", "DAILY", "Insert", DateTime.Now.ToString("yyyy-MM-dd")));
XElement CJAdminIEPDRequestPayload = x.GetCJAdminIEPDRequestPayloadDaily();
XDocument doc = x.GetCJAdminIEDPRequest(CJAdminIEPDHeader,CJAdminIEPDRequestPayload);
XNamespace cjadmin = "http://www.fdle.state.fl.us/fdle/cjadmin/1.0";
XNamespace cjadmincodes = "http://www.fdle.state.fl.us/fdle/cjadmin-codes/1.0";
XNamespace fdlecodes = "http://www.fdle.state.fl.us/fdle/fdle-codes/1.2";
XNamespace fdle = "http://www.fdle.state.fl.us/fdle/1.2";
XNamespace header = "http://www.fdle.state.fl.us/fdle/CJAdminIEPDHeader/1.0";
XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
XNamespace nc = "http://release.niem.gov/niem/niem-core/4.0/";
XNamespace j = "http://release.niem.gov/niem/domains/jxdm/6.2/";
XNamespace niemxs = "http://release.niem.gov/niem/proxy/xsd/4.0/";
XNamespace req = "http://www.fdle.state.fl.us/fdle/CJAdminIEPDRequest/1.0";
XNamespace structures = "http://release.niem.gov/niem/structures/4.0/";
XNamespace cbrn = "http://release.niem.gov/niem/domains/cbrn/4.2/";
XAttribute fbicjis = new(XNamespace.Xmlns + "fbi-cjis", "http://fbi.gov/cjis/2.0");
const string cjadminSchemaLocation = "http://www.fdle.state.fl.us/fdle/cjadmin/1.0 ../base-xsd/cjadmin/1.0/cjadmin.xsd";
const string reqSchemaLocation = "http://www.fdle.state.fl.us/fdle/CJAdminIEPDRequest/1.0 CJAdminIEPDRequest.xsd ";
public XDocument GetCJAdminIEDPRequest(XElement requestHeader, XElement requestPayload)
XElement CJAdminIEPDRequest = new(req + "CJAdminIEPDRequest",
new XAttribute(XNamespace.Xmlns + "cjadmin", cjadmin),
new XAttribute(XNamespace.Xmlns + "cjadmincodes", cjadmincodes),
new XAttribute(XNamespace.Xmlns + "fdlecodes", fdlecodes),
new XAttribute(XNamespace.Xmlns + "header", header),
new XAttribute(XNamespace.Xmlns + "j", j),
new XAttribute(XNamespace.Xmlns + "nc", nc),
new XAttribute(XNamespace.Xmlns + "niem-xs", niemxs),
new XAttribute(XNamespace.Xmlns + "req", req),
new XAttribute(XNamespace.Xmlns + "structures", structures),
new XAttribute(XNamespace.Xmlns + "xsi", xsi),
new XAttribute(xsi + "schemaLocation", reqSchemaLocation)
Console.WriteLine($"CJAdminIEPDRequest{Environment.NewLine}{CJAdminIEPDRequest}");
XDocument document = new(CJAdminIEPDRequest);
public XElement GetCJAdminIEPDHeader(string messageId)
string sourceSystemName = "Pinellas County Jail";
XElement CJAdminIEPDHeader = new(header + "CJAdminIEPDHeader", new XElement(header + "MessageID", messageId), new XElement(header + "SubmittingORI", new XElement(GetOrganizationORIIdentificationElement())), new XElement(header + "OwnerORI", new XElement(GetOrganizationORIIdentificationElement())), new XElement(header + "MessageCreationDateTime", DateTime.Now.ToString()), new XElement(header + "SourceSystemName", sourceSystemName), new XElement(header + "IEPDVersion", "1.2"));
return CJAdminIEPDHeader;
private XElement GetOrganizationORIIdentificationElement()
string identificationId = GetAgencyOriNumber();
XElement organizationORIIdentification = new(j + "OrganizationORIIdentification", new XElement(nc + "IdentificationID", identificationId));
return organizationORIIdentification;
private string GetAgencyOriNumber() => "FL0000000012";
public XElement GetCJAdminIEPDRequestPayloadDaily()
int employeeAuxilliaryQuantity = 1;
int employeeFullTimeQuantity = 10;
int employeePartTimeQuantity = 5;
int inmatesTotalQuantity = 10;
int inmatesAwaitingCaseDispoQuantity = 10;
int inmatesSentencedToFacilityQuantity = 10;
int inmatesSentencedToDOCQuantity = 10;
int inmatesAwaitingDispoInFederalCourtQuantity = 10;
XElement countyCorrectionsDailyReport = new(cjadmin + "CountyCorrectionsDailyReport", new XElement(cjadmin + "ReportingEndDate", GetReportEndDate()), new XElement(GetOrganizationORIIdentificationElement()), new XElement(cjadmin + "ReportActionCode", "Insert"), new XElement(cjadmin + "EmployeeAuxiliaryQuantity", employeeAuxilliaryQuantity), new XElement(cjadmin + "EmployeeFullTimeQuantity", employeeFullTimeQuantity), new XElement(cjadmin + "EmployeePartTimeQuantity", employeePartTimeQuantity), new XElement(cjadmin + "InmatesTotalQuantity", inmatesTotalQuantity), new XElement(cjadmin + "InmatesAwaitingCaseDispositionQuantity", inmatesAwaitingCaseDispoQuantity), new XElement(cjadmin + "InmatesSentencedToFacilityQuantity", inmatesSentencedToFacilityQuantity), new XElement(cjadmin + "InmatesSentencedToDeptOfCorrectionsQuantity", inmatesSentencedToDOCQuantity), new XElement(cjadmin + "InmatesAwaitingDispositionInFederalCourtQuantity", inmatesAwaitingDispoInFederalCourtQuantity));
return countyCorrectionsDailyReport;
private static string GetReportEndDate() => DateTime.Now.AddDays(-1).ToString("yyyy-MM-DD");