Esempio n. 1
0
 private List <ReportDetails> Spliter(string ReportString)
 {
     try
     {
         List <ReportDetails> ReturnList = new List <ReportDetails>();
         string[]             str        = ReportString.Split(';');
         for (int i = 0; i < str.Length - 8; i += 8)
         {
             ReportDetails rep = new ReportDetails
             {
                 RowNumber    = (i / 8 + 1).ToString(),
                 Amount       = str[i + 2].ToString(),
                 Date         = str[i + 3].ToString(),
                 Time         = str[i + 4].ToString(),
                 RemainAmount = str[i + 5].ToString(),
                 Comment      = str[i + 6].ToString(),
                 BranchName   = str[i + 7].ToString()
             };
             ReturnList.Add(rep);
         }
         return(ReturnList);
     }
     catch (Exception)
     {
         return(new List <ReportDetails>());
     }
 }
Esempio n. 2
0
 private string AddRow(ReportDetails RepDet)
 {
     try
     {
         string Color = "#FFFFFF";
         if (int.Parse(RepDet.RowNumber) % 2 == 0)
         {
             Color = "#99CCFF";
         }
         string rowstring = " <tr> " +
                            "<td class=\"style15\" dir=\"rtl\" style=\" text-align:center; background-color: " + Color + "\"> " + RepDet.RowNumber + "</td> " +
                            "<td class=\"style5\"  dir=\"rtl\" style=\" text-align:center; background-color: " + Color + "\"> " + RepDet.BranchName + "</td>" +
                            "<td class=\"style6\"  dir=\"ltr\" style=\" text-align:center; background-color: " + Color + "\"> " + RepDet.Date + "</td>" +
                            "<td class=\"style19\" dir=\"rtl\" style=\" text-align:center; background-color: " + Color + "\">" + RepDet.Time + "</td>" +
                            "<td class=\"style2\"  dir=\"rtl\" style=\" text-align:center; background-color: " + Color + "\"> " + RepDet.Comment + "</td>" +
                            "<td class=\"style17\" dir=\"rtl\" style=\"background-color: " + Color + "\">" + RepDet.Amount + "</td>" +
                            "<td dir=\"rtl\" style=\"background-color: " + Color + "\"> " + RepDet.RemainAmount + "</td>" +
                            "</tr>";
         return(rowstring);
     }
     catch (Exception ex)
     {
         return(" ");
     }
 }