Advertisement
f0rkB0mb

Chowdhury Hasan's Code

Aug 14th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.92 KB | None | 0 0
  1. private string PrintBody(Das.Order currentOrder, int filterTest, string memoName,Das.Counter curCounter, string EmpName, List<string> RoomNo)
  2. {
  3.     StringBuilder str = new StringBuilder();
  4.     int lineCount = 0;
  5.     string strSpace;
  6.     decimal price;
  7.     string currency;
  8.  
  9.     foreach (Das.OrderLine oLine in currentOrder.TBOrderLines.OrderBy(a=>a.TestId))
  10.     {
  11.         if (filterTest == 1 || (filterTest == 2 && oLine.Test.Category.DepId == 40) || (filterTest == 3 && (oLine.Test.Category.DepId == 50 || oLine.Test.Category.DepId == 31)))
  12.         {
  13.             lineCount++;
  14.             strSpace = new string(' ', 68);
  15.             //strSpace = new string(' ', 35);
  16.             //strSpace = "\n";
  17.             //str.Replace(strSpace, Environment.NewLine);
  18.             strSpace = strSpace.Insert(5, oLine.TestId.ToString());
  19.             string fullTestName = (oLine.Test.TestEditable == true ? oLine.EditedTestName : oLine.Test.TestName);
  20.             //string firstTestName = (oLine.Test.TestEditable == true ? oLine.EditedTestName : oLine.Test.TestName);
  21.             //lineCount = lineCount + 1;
  22.             //string lastTestName = (oLine.Test.TestEditable == true ? oLine.EditedTestName : oLine.Test.TestName);
  23.             fullTestName = fullTestName ?? string.Empty;
  24.             //string fullTestName = (firstTestName+lastTestName) ?? string.Empty;
  25.             strSpace = strSpace.Insert(12, fullTestName);
  26.  
  27.             if (filterTest == 1)
  28.             {
  29.                 price = oLine.TestPrice;
  30.                 currency = this.GetPriceInTaka(price);//String.Format("{0:C}", price);
  31.                 strSpace = strSpace.Insert(54, VbFunctionHelper.RAlign(currency, 12));
  32.             }
  33.  
  34.             //====
  35.             strSpace = strSpace.TrimEnd();
  36.             //=========
  37.  
  38.             str.Append(strSpace + VbFunctionHelper.vbCrLf);
  39.  
  40.             if (lineCount > MAXLINE)
  41.             {
  42.                 str.Append(" ----Cont. on Next Page----" + VbFunctionHelper.vbCrLf);
  43.                 str.Append(Convert.ToChar(27) + VbFunctionHelper.vbCr + Convert.ToChar(12));
  44.                 str.Append(VbFunctionHelper.vbCrLf);
  45.                 str.Append(this.PrintHeader(currentOrder, memoName, true, filterTest));
  46.                 lineCount = 0;
  47.             }
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement