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


C# List.FindAll方法代码示例

本文整理汇总了C#中iTextSharp.text.List.FindAll方法的典型用法代码示例。如果您正苦于以下问题:C# List.FindAll方法的具体用法?C# List.FindAll怎么用?C# List.FindAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.List的用法示例。


在下文中一共展示了List.FindAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReportBuilder

        public static void ReportBuilder(List<ListGrowerTareItem> hdrList, int cropYear, bool isPosted, bool isPreview, bool isHardCopy, bool isEmail,
			bool isFax, FileStream fs, string filePath)
        {
            const string METHOD_NAME = "ReportBuilder";
            const int RESET_FLAG = 0;

            Document document = null;
            PdfWriter writer = null;
            DailyGrowerTareDetailEvent pgEvent = null;
            List<ListGrowerTareItem> emailFaxList = null;
            List<ListGrowerTareItem> hardCopyList = null;

            int lastContractID = 0, lastStationID = 0;
            int index = 0;
            string firstDeliveryDate = "", busName = "", address1 = "", address2 = "", CSZ = "", emailAddress = "", faxNumber = "";

            string rptTitle = "Western Sugar Cooperative\nDaily Grower Tare Detail Report";

            try {

                if (!isPreview) {
                    emailFaxList = hdrList.FindAll(item => item.RptType == "E" || item.RptType == "F");
                    hardCopyList = hdrList.FindAll(item => item.RptType == "M");
                }
                else {
                    // In preview mode we're going to lump these all together and print them.
                    hardCopyList = hdrList;
                }

                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {

                    if (emailFaxList != null && emailFaxList.Count > 0) {
                        GrowerTareReportEmailFax(conn, filePath, ref emailFaxList, rptTitle, cropYear);
                    }

                    for (index = 0; index < hardCopyList.Count; index++) {

                        ListGrowerTareItem hdrItem = hardCopyList[index];

                        //----------------------------------------------------------------
                        // Changed contract or station, start a new print out.
                        //----------------------------------------------------------------
                        if (hdrItem.ContractID != lastContractID || hdrItem.Delivery_Station_ID != lastStationID) {

                            if (document == null) {

                                GetAddressInfo(conn, hdrItem.ContractID, out busName, out address1, out address2, out CSZ,
                                               out emailAddress, out faxNumber);

                                // IF YOU CHANGE MARGINS, CHANGE YOUR TABLE LAYOUTS !!!
                                //  ***  US LETTER: 612 X 792  ***
                                document = new Document(PortraitPageSize.PgPageSize, PortraitPageSize.PgLeftMargin,
                                                        PortraitPageSize.PgRightMargin, PortraitPageSize.PgTopMargin,
                                                        PortraitPageSize.PgBottomMargin);

                                // we create a writer that listens to the document
                                // and directs a PDF-stream to a file
                                writer = PdfWriter.GetInstance(document, fs);

                                // Attach my override event handler(s)
                                pgEvent = new DailyGrowerTareDetailEvent();
                                pgEvent.FillEvent(hdrItem.Contract_No, busName, hdrItem.Delivery_Factory_No, address1, address2, CSZ,
                                                  RESET_FLAG, rptTitle + (!isPreview ? "" : " - " + hdrItem.RptType));
                                writer.PageEvent = pgEvent;

                                // Open the document
                                document.Open();
                            }

                            if (lastContractID != 0) {

                                //--------------------------------------------------------------------------
                                // Display Truck information for the first delivery day.
                                //--------------------------------------------------------------------------
                                int loadCount = 0;
                                //if (nextDeliveryDate == firstDeliveryDate) {

                                try {
                                    // Get the truck data.
                                    SqlParameter[] spParams = null;
                                    using (
                                        SqlDataReader drTrucks = WSCReportsExec.GrowerDetailReportASH(conn,
                                        lastContractID, lastStationID, firstDeliveryDate, ref spParams)) {

                                        rptDailyGrowerTareDetail.AddTruckDetail(ref document, drTrucks, pgEvent);
                                        drTrucks.Close();

                                        loadCount = Convert.ToInt32(spParams[3].Value);

                                        if (loadCount > 0) {

                                            rptDailyGrowerTareDetail.AddTruckTotals(ref document, loadCount.ToString(),
                                                Convert.ToInt32(spParams[4].Value).ToString("#,##0"),
                                                Convert.ToInt32(spParams[5].Value).ToString("#,##0"), pgEvent);
                                        }
                                    }
                                }
                                catch {
                                    hardCopyList[index-1].Success += "Fail: Truck Detail ";
                                }
//.........这里部分代码省略.........
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:101,代码来源:rptDailyGrowerTareDetailMaster.cs

示例2: PrintSummary

        private static void PrintSummary(Document document, ref PdfPTable table, List<ListGrowerTareItem> hdrList, bool isPreview)
        {
            table = PdfReports.CreateTable(_processSummaryLayout, 1);
            Paragraph p;
            Phrase ph;

            if (isPreview) {
                p = new Paragraph("Note: Preview mode was active, so all documents were printed and none were emailed or faxed.\n\n", _normalFont);
                PdfReports.AddText2Table(table, p);
            }

            //-------------------
            // Printed
            //-------------------
            string prefixSep = "";
            Font font = _normalFont;
            p = new Paragraph("\nPrinted:\n", _labelFont);

            var mailList = hdrList.FindAll(item => item.RptType == "M");
            foreach (ListGrowerTareItem item in mailList) {

                if (String.IsNullOrEmpty(item.Success)) {
                    ph = new Phrase(prefixSep + item.Contract_No + " (" +
                        item.Delivery_Station_No + ": " + DateTime.Parse(item.Delivery_Date).ToString("MM/dd") + ")", _normalFont);
                } else {
                    ph = new Phrase(prefixSep + item.Contract_No + " (" +
                        item.Delivery_Station_No + ": " +
                        DateTime.Parse(item.Delivery_Date).ToString("MM/dd") + " : " + item.Success + ")", _failFont);
                }

                p.Add(ph);

                if (prefixSep.Length == 0) {
                    prefixSep = ", ";
                }
            }
            PdfReports.AddText2Table(table, p);

            //-------------------
            // Email
            //-------------------
            prefixSep = "";
            p = new Paragraph("\nEmail:\n", _labelFont);

            var emailList = hdrList.FindAll(item => item.RptType == "E");
            foreach (ListGrowerTareItem item in emailList) {

                if (String.IsNullOrEmpty(item.Success)) {
                    ph = new Phrase(prefixSep + item.Contract_No + " (" + item.Delivery_Station_No + ": " +
                    DateTime.Parse(item.Delivery_Date).ToString("MM/dd") + ")", _normalFont);
                } else {
                    ph = new Phrase(prefixSep + item.Contract_No + " (" +
                        item.Delivery_Station_No + ": " +
                        DateTime.Parse(item.Delivery_Date).ToString("MM/dd") + " : " + item.Success + ")", _failFont);
                }

                p.Add(ph);

                if (prefixSep.Length == 0) {
                    prefixSep = ", ";
                }
            }
            PdfReports.AddText2Table(table, p);

            //-------------------
            // Fax
            //-------------------
            prefixSep = "";
            p = new Paragraph("\nFax:\n", _labelFont);

            var faxList = hdrList.FindAll(item => item.RptType == "F");
            foreach (ListGrowerTareItem item in faxList) {

                if (String.IsNullOrEmpty(item.Success)) {
                    ph = new Phrase(prefixSep + item.Contract_No + " (" +
                        item.Delivery_Station_No + ": " + DateTime.Parse(item.Delivery_Date).ToString("MM/dd") + ")", _normalFont);
                } else {
                    ph = new Phrase(prefixSep + item.Contract_No + " (" +
                        item.Delivery_Station_No + ": " +
                        DateTime.Parse(item.Delivery_Date).ToString("MM/dd") + " : " + item.Success + ")", _failFont);
                }

                p.Add(ph);

                if (prefixSep.Length == 0) {
                    prefixSep = ", ";
                }
            }
            PdfReports.AddText2Table(table, p);

            //-------------------
            // Web View by Member
            //-------------------
            prefixSep = "";
            p = new Paragraph("\nMember Web View (WSCI):\n", _labelFont);

            var webList = hdrList.FindAll(item => item.RptType == "W");
            foreach (ListGrowerTareItem item in webList) {

                if (String.IsNullOrEmpty(item.Success)) {
//.........这里部分代码省略.........
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:101,代码来源:rptDailyGrowerTareDetailMaster.cs


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