本文整理汇总了C#中iTextSharp.text.List.OrderByDescending方法的典型用法代码示例。如果您正苦于以下问题:C# List.OrderByDescending方法的具体用法?C# List.OrderByDescending怎么用?C# List.OrderByDescending使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.List
的用法示例。
在下文中一共展示了List.OrderByDescending方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FeesPrinting
public Document FeesPrinting(List<TermRegistration> registration, ref StringWriter sw, ref Document itextDoc)
{
PdfPTable table3 = new PdfPTable(2);
table3.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
iTextSharp.text.Image imgPDF = iTextSharp.text.Image.GetInstance(HttpRuntime.AppDomainAppPath + "\\Images\\wexford.jpg");
imgPDF.ScaleToFit(128, 100);
// imgPDF.ScaleToFit(200, 200);
PdfPCell theImage = new PdfPCell(imgPDF);
theImage.Border = iTextSharp.text.Rectangle.NO_BORDER;
table3.AddCell(theImage);
iTextSharp.text.Font font_heading_1 = FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12, iTextSharp.text.Font.BOLD);
iTextSharp.text.Font font_heading_2 = FontFactory.GetFont(FontFactory.TIMES_ROMAN, 11, iTextSharp.text.Font.BOLD);
// iTextSharp.text.Font font_heading_3 = FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.BOLD);
PdfPTable theSchoolNameTable = new PdfPTable(1);
PdfPCell theWexFord = new PdfPCell(new Paragraph("WEXFORD COLLEGE", font_heading_1));
theWexFord.Border = iTextSharp.text.Rectangle.NO_BORDER;
// theWexFord.w
PdfPCell theWexFordFirstGate = new PdfPCell(new Paragraph(new Paragraph("FIRST GATE OBA ILE HOUSING ESTATE, AKURE, AKURE NORTH L.G.A, ", font_heading_1)));
theWexFordFirstGate.Border = iTextSharp.text.Rectangle.NO_BORDER;
PdfPCell theWexFordMoto = new PdfPCell(new Paragraph("MOTTO: INTELLIGENCE, INTEGRITY & INDUSTRY", font_heading_1));
theWexFordMoto.Border = iTextSharp.text.Rectangle.NO_BORDER;
theSchoolNameTable.AddCell(theWexFord);
theSchoolNameTable.AddCell(theWexFordFirstGate);
theSchoolNameTable.AddCell(theWexFordMoto);
table3.AddCell(theSchoolNameTable);
itextDoc.Add(table3);
itextDoc.Add(new Paragraph(" "));
itextDoc.Add(new Paragraph(" "));
iTextSharp.text.Font font_heading_3 = FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10, iTextSharp.text.Font.BOLD);
PdfPTable table4 = new PdfPTable(8);
table4.AddCell((new Paragraph("S/N", font_heading_3)));
table4.AddCell((new Paragraph("Name", font_heading_3)));
table4.AddCell((new Paragraph("Sex", font_heading_3)));
table4.AddCell((new Paragraph("Class", font_heading_3)));
table4.AddCell((new Paragraph("Session", font_heading_3)));
table4.AddCell((new Paragraph("School Fees Category", font_heading_3)));
table4.AddCell((new Paragraph("School Fees (NGN)", font_heading_3)));
table4.AddCell((new Paragraph("Owing (NGN)", font_heading_3)));
int counter = 1;
foreach (var s in registration)
{
// s.
//PdfPTable table = new PdfPTable(2);
List<SchoolFeePayment> theStudentPayments = new List<SchoolFeePayment>();
theStudentPayments = work.SchoolFeePaymentRepository.Get(a => a.StudentID == s.StudentID).ToList() ;
SchoolFeePayment theStudentPayment = new SchoolFeePayment();
// theStudentPayment.Owing = 0;
if (theStudentPayments.Count > 0)
{
theStudentPayment = theStudentPayments.OrderByDescending(a => a.DatePaid).First();
// theStudentPayment.Owing = 0;
}
table4.DefaultCell.Border = iTextSharp.text.Rectangle.BOX;
decimal toTalDeduction = 0;
/// toTalDeduction = Convert.ToDecimal(s.TotalLatenessDeduction) + toTalDeduction;
// toTalDeduction = Convert.ToDecimal(s.TotalLoan) + toTalDeduction;
// toTalDeduction = Convert.ToDecimal(s.TotalAbscentDeduction) + toTalDeduction;
table4.AddCell(new Paragraph(Convert.ToString(counter), font_heading_3));
table4.AddCell(new Paragraph(s.LastName + " " + s.FirstName, font_heading_3));
table4.AddCell(new Paragraph(s.Sex, font_heading_2));
table4.AddCell(new Paragraph(s.Level, font_heading_2));
table4.AddCell(new Paragraph(s.Session, font_heading_2));
table4.AddCell(new Paragraph(s.SchoolFeesKind, font_heading_2));
table4.AddCell(new Paragraph(Convert.ToString(s.Cost), font_heading_2));
table4.AddCell(new Paragraph(Convert.ToString(theStudentPayment.Owing), font_heading_2));
counter = counter + 1;
}
itextDoc.Add(table4);
return itextDoc;
}