示例#1
0
 public void ToString(StringBuilder builder)
 {
     builder.Append(ReceiptRecordTypes.FileControlRecord);
     builder.Append(TotalCashLetters.ToString("D6"));
     builder.Append(TotalRecordCount.ToString("D8"));
     builder.Append(TotalItemCount.ToString("D8"));
     builder.Append(FileTotalAmount.ToString("D16"));
     builder.Append(Reserved.PadRight(40));
     builder.AppendLine();
 }
示例#2
0
        /// <summary>
        /// 设置选择记录范围下拉框
        /// </summary>
        private void InitDropDownListPageIndex()
        {
            this.dropDownListPageIndex.Items.Clear();

            if (TotalRecordCount == 0)
            {
                this.SetDropDownListPageIndexDefaultValue();
                return;
            }


            for (int i = 0; i < PageCount; i++)
            {
                int beginRecorde = PageSize * i + 1;

                int endrecorde = PageSize * (i + 1);

                if (endrecorde > TotalRecordCount)
                {
                    endrecorde = TotalRecordCount;
                }

                string recordeRange = beginRecorde.ToString() + "---" + endrecorde.ToString() + " of " + TotalRecordCount.ToString();

                dropDownListPageIndex.Items.Add(new ListItem(recordeRange, Convert.ToString(i + 1)));
            }

            //根据当前第几页定位分页下拉框
            if (this.PageNumber <= this.dropDownListPageIndex.Items.Count)
            {
                this.dropDownListPageIndex.SelectedIndex =
                    this.dropDownListPageIndex.Items.IndexOf(
                        this.dropDownListPageIndex.Items.FindByValue(this.PageNumber.ToString()));
            }
        }
示例#3
0
        /// <summary>
        /// Checks each entry inside the package and throws an error if any record is damaged.
        /// </summary>
        /// <param name="errorsAsWarnings">True to continue in case of errors, otherwise false</param>
        public virtual void ScanPackage(bool errorsAsWarnings)
        {
            Log.WriteLine("Pre-Scanning package for RIR %@ with %@ entries...", LogLevel.Message, RirName, EntryCount.ToString("N0"));

            Func <string, RirFileReaderException, bool> onErrorFunc = (input, ex) =>
            {
                if (errorsAsWarnings)
                {
                    Log.WriteLine("An error occurred while processing line %@. %@. Ignoring...", LogLevel.Warning, ex.LineNumber.ToString("N0"), ex.Message);
                    return(true); // Handled
                }
                else
                {
                    Log.WriteLine("An error occurred while processing line %@. %@. Aborting!", LogLevel.Error, ex.LineNumber.ToString("N0"), ex.Message);
                    return(false); // Not handled
                }
            };

            foreach (RirPackageEntry entry in Entries)
            {
                if (entry.IsScanned)
                {
                    Log.WriteLine("Entry %@ for RIR package %@ is already scanned. %@ records. Skipping...", LogLevel.Debug, entry.Identifier, RirName, entry.RecordCount.ToString("N0"));
                    continue;
                }

                Log.WriteLine("Pre-Scanning entry %@ for RIR Package %@...", LogLevel.Debug, entry.Identifier, RirName);
                entry.Scan(onErrorFunc);
                Log.WriteLine("Pre-Scanning found %@ records for entry %@ inside RIR Package %@...", LogLevel.Debug, entry.RecordCount.ToString("N0"), entry.Identifier, RirName);
            }

            Log.WriteLine("Pre-Scanning completed for RIR Package %@. %@ total records.", LogLevel.Debug, RirName, TotalRecordCount.ToString("N0"));
        }