예제 #1
0
        public void UpdateLastRecord(OfficerProcessingRecord record)
        {
            if (recordList != null && recordList.Count > 0)
            {
                var lastIndex  = recordList.Count - 1;
                var lastRecord = recordList[lastIndex];

                if (record.RecordNum != 0)
                {
                    lastRecord.RecordNum = record.RecordNum;
                }

                if (!string.IsNullOrWhiteSpace(record.FileName))
                {
                    lastRecord.FileName = record.FileName;
                }

                if (!string.IsNullOrWhiteSpace(record.FileNameCaller) && lastRecord.FileNameCaller != record.FileNameCaller)
                {
                    lastRecord.FileNameCaller = record.FileNameCaller;
                }

                if (!string.IsNullOrWhiteSpace(record.FileNameRecordingTime) && lastRecord.FileNameRecordingTime != record.FileNameRecordingTime)
                {
                    lastRecord.FileNameRecordingTime = record.FileNameRecordingTime;
                }

                if (!string.IsNullOrWhiteSpace(record.Parser))
                {
                    lastRecord.Parser = record.Parser;
                }

                if (!string.IsNullOrWhiteSpace(record.ParserCaller) && lastRecord.ParserCaller != record.ParserCaller)
                {
                    lastRecord.ParserCaller = record.ParserCaller;
                }

                if (!string.IsNullOrWhiteSpace(record.ParserRecordingTime) && lastRecord.ParserRecordingTime != record.ParserRecordingTime)
                {
                    lastRecord.ParserRecordingTime = record.ParserRecordingTime;
                }

                if (!string.IsNullOrWhiteSpace(record.ViewModelFormat))
                {
                    lastRecord.ViewModelFormat = record.ViewModelFormat;
                }

                if (!string.IsNullOrWhiteSpace(record.OutputFormatter))
                {
                    lastRecord.OutputFormatter = record.OutputFormatter;
                }

                if (!string.IsNullOrWhiteSpace(record.ReportGenCaller) && lastRecord.ReportGenCaller != record.ReportGenCaller)
                {
                    lastRecord.ReportGenCaller = record.ReportGenCaller;
                }

                if (!string.IsNullOrWhiteSpace(record.ReportGenRecordingTime) && lastRecord.ReportGenRecordingTime != record.ReportGenRecordingTime)
                {
                    lastRecord.ReportGenRecordingTime = record.ReportGenRecordingTime;
                }
            }
            else
            {
                AddRecord(record);
            }
        }
예제 #2
0
 public void AddRecord(OfficerProcessingRecord record)
 {
     recordList.Add(record);
 }