We can find this formatted data in mvc5
Field Type Description Example
Sales Territory 2A SOAP sales territory for that order .See SOAP-2207 SA
Invoice/Credit- Value is either I or C 1A I for invoice and C for credit card payment I
Hard Coded "XX" 2A XX
Hard Coded Underscore 1A _
Invoice Number 8A A2R invoice number, received in Payment Status Update 467087HI
Hard Coded Underscore 1A _
Hard Coded "X" 1A X
Hard Coded Underscore 1A _
Date YYMMDD 6A Date sent to A2R 230327
Hard Coded Underscore 1A _
Time HHMM 4A Time sent to A2R 1442
Example: SAIXX_123456KI_X_231130_1153.PDF
Filename like this-SAIXX_123456KI_X_231130_1153.PDF


Saravanan GanesanPosted Aug 16, 2023, 5:28 PM
In MVC5, you can work with the provided formatted data by defining a model to represent the various fields. Create a class that reflects the structure and content of the data:
public class InvoiceData
{
public string SalesTerritory { get; set; }
public string InvoiceCreditType { get; set; }
public string HardCodedXX { get; set; }
public string HardCodedUnderscore1 { get; set; }
public string InvoiceNumber { get; set; }
public string HardCodedUnderscore2 { get; set; }
public string HardCodedX { get; set; }
public string HardCodedUnderscore3 { get; set; }
public string DateYYMMDD { get; set; }
public string HardCodedUnderscore4 { get; set; }
public string TimeHHMM { get; set; }
}
When you receive a filename like "SAIXX_123456KI_X_231130_1153.PDF," you can split it into parts and populate the
InvoiceDataobject:string filename = "SAIXX_123456KI_X_231130_1153.PDF";
string[] parts = filename.Split('_');
InvoiceData invoiceData = new InvoiceData
{
SalesTerritory = parts[0],
InvoiceCreditType = parts[1],
HardCodedXX = parts[2],
HardCodedUnderscore1 = parts[3],
InvoiceNumber = parts[4],
HardCodedUnderscore2 = parts[5],
HardCodedX = parts[6],
HardCodedUnderscore3 = parts[7],
DateYYMMDD = parts[8],
HardCodedUnderscore4 = parts[9],
TimeHHMM = parts[10]
};
Now, you can use the
invoiceDataobject to access the individual fields and display them as needed within your MVC5 application.