Robson Amaral

Robson Amaral

  • NA
  • 132
  • 15.7k

Compilation does not pass the message log line to the user

Apr 12 2018 10:05 AM
I have the following problem, my Date cell in the excel sheet is a required field, however, leaving unfilled would have to return a message with the log to the user, however, it did not return any log message stating that cell S line 1 should be filled with a date, but it does not appear. Could someone please help me?
 
Follow my code below:
  1. private void setProcInter(Process process, Interested interested , DataRow line)  
  2.         {  
  3.             int i = 0;  
  4. try  
  5.                 {  
  6.                     DateTime DateSep = DateTime.Parse(line.ItemArray[18].ToString());  
  7.                     processInterested.DateSep = DateSep;  
  8.                 }  
  9.                 catch  
  10.                 {  
  11.                     i = i + 1;  
  12.                     logErro.Append("The S cell" + (i) + " must be completed with a date. <br>");  
  13.                     fileInvalidated= true;  
  14.                 }  
  15.   
  16. }  
  17.   
  18.   
  19.  private void PreliminaryVerification(IEnumerable<DataRow> data)  
  20.         {  
  21.             int i = 0;  
  22.   
  23.             bool imported= false;  
  24.             foreach(var line in data)  
  25.             {  
  26.                 i = i + 1;  
  27.                 //Verifies that no worksheets with the numSEP entered have not   
  28.                //already been imported                  
  29.                 if (!line.ItemArray[17].ToString().Equals(""))  
  30.                 {  
  31.                     if (aplProcessinterested.listProcInterPorCodSep(decimal.Parse(line.ItemArray[17].ToString())).Count != 0)  
  32.                     {  
  33.                         imported= true;  
  34.                         break;  
  35.                     }  
  36.                 }  
  37.                 else  
  38.                 {  
  39.                     log.Append("The S cell for the line " + (i) + " must be completed. <br>");  
  40.                     fileInvalidated= true;  
  41.                 }  
  42. }  
 
I have this method where I close all the processes related to the interested one, and I load the information of the worksheet, just the date, that if it is blank it should appear the log informing the user to fill, but it does not appear, the same thing is in the others validations below, but does not pass the line when compiling. Can you help me?