private void ImportServiceTemplates(string[] fields)
        {
            var serviceTemplate = new ServiceTemplateModel();

            serviceTemplate.Id = int.Parse(fields[1]);
            serviceTemplate.ServiceTemplateName         = fields[2];
            serviceTemplate.ServiceTemplateAbbreviation = fields[3];
            serviceTemplate.ServiceTemplateDescription  = fields[4];
            serviceTemplate.ServiceType = fields[5];
            int oldServiceDirectionId = int.Parse(fields[6]);

            serviceTemplate.ServiceDirectionId = ServiceDirectionKeys.GetValueOrDefault(oldServiceDirectionId, 0);
            serviceTemplate.CalculatedDuration = int.Parse(fields[7]);
            serviceTemplate.RouteId            = newRouteId;
            var newServiceTemplateId = ServiceTemplateDataAccess.InsertServiceTemplate(serviceTemplate);

            ServiceTemplateKeys.Add(serviceTemplate.Id, newServiceTemplateId);
        }
Ejemplo n.º 2
0
        public string ExportServiceTemplateTable()
        {
            List <ServiceTemplateModel> serviceTemplateList = ServiceTemplateDataAccess.GetServiceTemplatesPerRoute(RouteId);

            return(WriteServiceTemplateHeader() + WriteServiceTemplateData(serviceTemplateList));
        }