Пример #1
0
        private async Task <List <InspectionLabelDto> > GetInspectionLabels(int inspectionId)
        {
            var sqlRMeterage  = new MeterageRepository(_logger);
            var labelsFromSql = await sqlRMeterage.GetLabels(inspectionId);

            var labels = labelsFromSql.Select(x =>
                                              new InspectionLabelDto
            {
                CarriageName  = CreateCarriageName(x.Label.Carriage.Train.Name, x.Label.Carriage.Number),
                EquipmentName = x.Label.EquipmentModel.Equipment.Name,
                Label         = x.Label.Rfid,
                Date          = x.Date.ToString("g")
            }).ToList();

            return(labels);
        }
Пример #2
0
        private static async Task getInspectionLabels(MeterageRepository mR, Inspection fromSqlsInspection, JournalInspection journalInspection)
        {
            var labels        = new List <JournalInspectionLabel>();
            var labelsFromSql = await mR.GetLabels(fromSqlsInspection.Id);

            foreach (var labelFromSql in labelsFromSql)
            {
                labels.Add(new JournalInspectionLabel
                {
                    CarriageName  = CreateCarriageName(labelFromSql.Label.Carriage.Train.Name, labelFromSql.Label.Carriage.Number),
                    EquipmentName = labelFromSql.Label.EquipmentModel.Equipment.Name,
                    LabelSerial   = labelFromSql.Label.Rfid,
                    TimeStamp     = labelFromSql.Date
                });
            }
            journalInspection.Tabs.Labels = labels.ToArray();
        }