当前位置: 首页>>代码示例>>C#>>正文


C# List.OrderByDescending方法代码示例

本文整理汇总了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;
        }
开发者ID:kazeemkz,项目名称:silverdale,代码行数:89,代码来源:SchoolFeesPrinting.cs


注:本文中的iTextSharp.text.List.OrderByDescending方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。