Robson Amaral

Robson Amaral

  • NA
  • 132
  • 16.8k

Sort line index to display in log

May 25 2018 9:47 PM
I'm having the following problem, while showing the log to the user, the same shows the line disorganized way, I would like to bring the numbers in order. How could she be doing this?
  1. protected void import_Click (object sender, EventArgs and)    
  2.         {    
  3.     
  4. DataTable Data = new DataTable ();    
  5. // Here I use to get the index of the row by Data Table    
  6. Data.Columns.Add ("index"typeof (int));    
  7.     
  8.                         int i = 1;    
  9.                         foreach (DataRow row in Data.Rows)    
  10.                         {    
  11.                             line ["index"] = i;    
  12.                             i ++;    
  13.                         }    
  14.     
  15. private System.Threading.Tasks.Task Processing table (IEnumerable <DataRow> dataparam, int i, UserLibrary user)    
  16.         {    
  17.             // userLogin = appLogin.LoginPorLogin (GetUserAuthenticated ().));    
  18.             i = 4;    
  19.             i ++;    
  20.             Action <object> processing = (data) =>    
  21.             {    
  22.                 / * if (NHibernate.Context.ThreadStaticSessionContext.HasBind (NhibernateHelper.SessionFactory.)) * /    
  23.                 NHibernate.Context.ThreadStaticSessionContext.Bind (NhibernateHelper.HelpThreading (). OpenSession ());    
  24.     
  25.                 foreach (var line in (IEnumerable <DataRow>) data)    
  26.                 {    
  27.     
  28.                     
  29. if (process! = null)    
  30.                     {    
  31.                         // if the process is not null I search all procinter related to it    
  32.                         List <ProcessInterest> listprocinter = ProcessInterested.consultProcessor (process.Code);    
  33.                         if (listprocinter .Exists (o => o.interest == interested))    
  34.                               
  35.                           // Here I pass the correct index, but it does not come in order.    
  36.                             log.Append ("The person informed on the line" + (line ["index"]) + "was added back to the process" + process.NumProcesso + "<br>");    
  37.                         //log.Append("The interested "+ process.Interested.Name +" was added back to the process "+ process.NumProcesso +" <br> ");    
  38.                         // log.Append ("The invested" + process.Interated.Name + "was added back to process" + process.NumProcesso + "<br>");    
  39.                         setProcInter (process, interested, line, i);    
  40.                     }    
  41.     
  42.                     else    
  43.                     {    
  44.                         // New Process - 6.3    
  45.                         process = new Process ();    
  46.                   }    
  47.        }    
  48.      }    
  49.   }    
The line of my log is coming disorganized this way:
 
Import Log:
 
The person informed on line 88 was added again to the process 000310097.2016.8.08.0035 The person informed on line 70 was added back to process 000164345.2017.8.08.0051
 
The person informed on line 25 was added back to process 000269518.2012.8.08.0030
 
The party informed on line 148 was added again to the case 000181878.2016.8.08.0017
 
The interested party informed on line 145 was added again to process 000023721.2017.8.08.0008
 
The person informed on line 326 was added to the file 0001800-66.2009.8.08.0061
 
The person informed on line 194 was added again to process 0002763-90.2015.8.08.0020
 
The interested party informed on line 376 was added again to the process 0000646-51.2015.8.08.0045
 
The interested party informed on line 447 was added again to the process 0003289-74.2017.8.08.0024
 
The person informed on line 351 was added again to process 0001003-79.2014.8.08.0008
 
The interested party informed on line 432 was added again to the process 0000037-54.2017.8.08.0027
 
The interested party informed on line 567 was added again to process 0001608-22.2016.8.08.0051
 
The interested party entered on line 375 was added back to process 0000403-21.2016.8.08.0030
 
The subject informed on line 501 was added again to process 0000696-93.2013.8.08.0030 The
person informed on line 493 was added again to process 0001556-71.2016.8.08.0036 The subject informed on line 523 was added again to process 0000141-13.2017.8.08.0038
 
I would like the log to show the rows in an orderly fashion.
 
Could someone help me out?