Robson Amaral

Robson Amaral

  • NA
  • 132
  • 17.5k

Message log error for user

Apr 12 2018 12:45 PM
When compiling my web application, it returns me the following message log:
 

The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.

The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.

The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.

The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.
 

However, it is not loading the message sequentially, the correct one was to show the following message:
 
The CPF / CNPJ reported in cell H referring to row 1 is in an incorrect format. Please correct the spreadsheet.

The CPF / CNPJ reported in cell H referring to row 2 is in an incorrect format. Please correct the spreadsheet.

The CPF / CNPJ reported in cell H referring to row 3 is in an incorrect format. Please correct the spreadsheet.
 
 How can I remedy this situation?
Here's my code:
 
  1. private Interested setInterested o(DataRow line)  
  2.         {  
  3.             if (!line.ItemArray[12].ToString().Equals(""))  
  4.                 interested .Cep = line.ItemArray[12].ToString();  
  5.             if (!line.ItemArray[7].ToString().Equals(""))  
  6.                 if (line.ItemArray[7].ToString().Length == 14)  
  7.                 {  
  8.                     interested .CPF_CNPJ = HelpCPF_CNPJ.DeformationCPF(line.ItemArray[7].ToString());  
  9.                     interested.Tipo = 1;  
  10.                 }  
  11.                 else if (line.ItemArray[7].ToString().Length == 18)  
  12.                 {  
  13.                     interested.CPF_CNPJ = HelpCPF_CNPJ.DeformationCNPJ(line.ItemArray[7].ToString());  
  14.                     interested.Tipo = 2;  
  15.                 }  
  16.                 else  
  17.                 {  
  18.                     int i = 0;   
  19.                     i = i + 1; //use to receive the next line  
  20.                     log.Append("The CPF / CNPJ informed in cell H referring to the line " + (i) + "is in an incorrect format. Please correct the spreadsheet. <br>");  
  21.                     fileInvalidated = true;  
  22.                 }  
  23.               
  24.             return interested;  
  25.         }  
  26. }