Ejemplo n.º 1
0
 public ProcessingFacadeBase(ProcessingVO processing)
 {
     this.processing = processing;
     extraction      = null;
     transformation  = null;
     load            = null;
 }
 public ExtractionFromDataBaseToFileProcessingFacade(ProcessingVO processing)
     : base(processing)
 {
     this.extraction     = new ExtractionFromDataBase(processing);
     this.transformation = new NoTransformation(processing);
     this.load           = new LoadToFile(processing);
 }
        //static ProcessingTypeFactory()
        //{

        //}

        public static void Initialize(ProcessingVO processing)
        {
            processingTypes.Add(ProcessingTypes.FileCopy, new FileCopyProcessingFacade(processing));
            processingTypes.Add(ProcessingTypes.FileTransfer, new FileTransferProcessingFacade(processing));
            processingTypes.Add(ProcessingTypes.ExtractionFromDataBaseToFile, new ExtractionFromDataBaseToFileProcessingFacade(processing));
            //processingTypes.Add(ProcessingTypes.ExtractionFromDataBase, new ExtractionFromFileProcessingFacade());
        }
 public static ProcessingFacadeBase GetProcessing(ProcessingVO processingVO)
 {
     if (processingTypes.TryGetValue((ProcessingTypeFactory.ProcessingTypes)processingVO.JobOperationMode, out ProcessingFacadeBase processing))
     {
         return(processing);
     }
     return(null);
 }
Ejemplo n.º 5
0
 private static IProcessable LoadFromDatabase(int jobId)
 {
     using (IDbConnection connection = ConnectionFactory.CreateConnection())
     {
         processingDAO         = new ProcessingDao();
         processingDefinitions = processingDAO.Get(jobId);
     }
     return(ProcessingTypeFactory.CreateProcessing(processingDefinitions));
 }
Ejemplo n.º 6
0
        //static ProcessingTypeFactory()
        //{

        //}

        public static void LoadProcessingTypes(ProcessingVO processing)
        {
            processingTypes = new Dictionary <ProcessingTypes, IProcessable>
            {
                { ProcessingTypes.FileCopy, new FileCopyProcessingFacade(processing) },
                { ProcessingTypes.FileTransfer, new FileTransferProcessingFacade(processing) },
                { ProcessingTypes.ExtractionFromDataBaseToFile, new ExtractionFromDataBaseToFileProcessingFacade(processing) }
            };
            //processingTypes.Add(ProcessingTypes.ExtractionFromDataBase, new ExtractionFromFileProcessingFacade());
        }
Ejemplo n.º 7
0
        public override ProcessingVO Get(int IdJob)
        {
            String sqlCommandText = "SELECT * FROM [dbo].[ProcessingJobs] WHERE IdJob = @IdJob";

            using (IDbConnection connection = ConnectionFactory.CreateConnection())
                using (IDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = sqlCommandText;
                    IDbDataParameter paramId = command.CreateParameter();
                    paramId.ParameterName = "IdJob";
                    paramId.Value         = IdJob;
                    command.Parameters.Add(paramId);
                    IDataReader  dataReader = command.ExecuteReader();
                    ProcessingVO processing = new ProcessingVO();
                    while (dataReader.Read())
                    {
                        processing.IdJob             = Convert.ToInt32(dataReader["IdJob"]);
                        processing.JobName           = Convert.ToString(dataReader["JobName"]);
                        processing.JobDescription    = Convert.ToString(dataReader["JobDescription"]);
                        processing.IsJobActiveFlag   = Convert.ToBoolean(dataReader["IsJobActiveFlag"]);
                        processing.JobOperationMode  = Convert.ToInt16(dataReader["JobOperationMode"]);
                        processing.JobProcessingType = Convert.ToInt16(dataReader["JobProcessingType"]);

                        processing.ProcedureName    = Convert.ToString(dataReader["ProcedureName"]);
                        processing.BackupFolderpath = Convert.ToString(dataReader["BackupFolderPath"]);

                        processing.InputFileFolderPath    = Convert.ToString(dataReader["InputFileFolderPath"]);
                        processing.InputFileName          = Convert.ToString(dataReader["InputFileName"]);
                        processing.InputFileExtension     = Convert.ToString(dataReader["InputFileExtension"]);
                        processing.InputFileSeparatorChar = Convert.ToString(dataReader["InputFileSeparatorChar"]);
                        processing.InputFileLayout        = Convert.ToString(dataReader["InputFileLayout"]);

                        processing.OutputFileFolderPath    = Convert.ToString(dataReader["OutputFileFolderPath"]);
                        processing.OutputFileName          = Convert.ToString(dataReader["OutputFileName"]);
                        processing.OutputFileExtension     = Convert.ToString(dataReader["OutputFileExtension"]);
                        processing.OutputFileSeparatorChar = Convert.ToString(dataReader["OutputFileSeparatorChar"]);
                        processing.OutputFileLayout        = Convert.ToString(dataReader["OutputFileLayout"]);

                        processing.FileReferenceDateTimeFlag  = Convert.ToBoolean(dataReader["FileReferenceDateTimeFlag"]);
                        processing.FileProcessingDateTimeFlag = Convert.ToBoolean(dataReader["FileProcessingDateTimeFlag"]);

                        // INFO: other ways to get the conversions
                        //processing.IdJob = dataReader.GetInt32(dataReader.GetOrdinal("IdJob"));
                        //processing.IsJobActiveFlag = dataReader.GetBoolean(dataReader.GetOrdinal("IsJobActiveFlag"));
                        //processing.JobOperationMode = (short) dataReader.GetInt32(dataReader.GetOrdinal("JobOperationMode"));
                        //processing.JobName = dataReader.GetString(dataReader.GetOrdinal("JobName"));
                        //processing.JobDescription = dataReader.IsDBNull(dataReader.GetOrdinal("JobDescription")) ? String.Empty : dataReader.GetString(dataReader.GetOrdinal("JobDescription"));
                    }
                    dataReader.Close();
                    return(processing);
                }
        }
Ejemplo n.º 8
0
        //public static IProcessable GetProcessing(ProcessingTypes processingType)
        //{
        //    if (processingTypes.TryGetValue(processingType, out IProcessable processing))
        //    {
        //        return processing;
        //    }
        //    return null;
        //}

        public static IProcessable CreateProcessing(ProcessingVO processingVO)
        {
            if (processingTypes == null)
            {
                LoadProcessingTypes(processingVO);
            }

            if (processingTypes.TryGetValue((ProcessingTypeFactory.ProcessingTypes)processingVO.JobProcessingType, out IProcessable processing))
            {
                return(processing);
            }
            return(null);
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            using (IDbConnection connection = ConnectionFactory.CreateConnection())
            {
                if (args.Length == 0)
                {
                    Console.WriteLine("ERROR: an argument must be given.");
                    return;
                }
                int          jobId        = Convert.ToInt32(args[0]);
                ProcessingVO processingVO = processingDAO.Get(jobId);

                processingBO = CreateProcessing(processingVO);
                processingBO?.Process();
            }
        }
Ejemplo n.º 10
0
        public override IList <ProcessingVO> List()
        {
            String sqlCommandText = "SELECT * FROM [dbo].[ProcessingJobs]";

            using (IDbConnection connection = ConnectionFactory.CreateConnection())
                using (IDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = sqlCommandText;
                    IDataReader         dataReader  = command.ExecuteReader();
                    List <ProcessingVO> processings = new List <ProcessingVO>();
                    while (dataReader.Read())
                    {
                        ProcessingVO processing = new ProcessingVO();
                        processing.IdJob             = Convert.ToInt32(dataReader["IdJob"]);
                        processing.JobName           = Convert.ToString(dataReader["JobName"]);
                        processing.JobDescription    = Convert.ToString(dataReader["JobDescription"]);
                        processing.IsJobActiveFlag   = Convert.ToBoolean(dataReader["IsJobActiveFlag"]);
                        processing.JobOperationMode  = Convert.ToInt16(dataReader["JobOperationMode"]);
                        processing.JobProcessingType = Convert.ToInt16(dataReader["JobProcessingType"]);

                        processing.ProcedureName    = Convert.ToString(dataReader["ProcedureName"]);
                        processing.BackupFolderpath = Convert.ToString(dataReader["BackupFolderPath"]);

                        processing.InputFileFolderPath    = Convert.ToString(dataReader["InputFileFolderPath"]);
                        processing.InputFileName          = Convert.ToString(dataReader["InputFileName"]);
                        processing.InputFileExtension     = Convert.ToString(dataReader["InputFileExtension"]);
                        processing.InputFileSeparatorChar = Convert.ToString(dataReader["InputFileSeparatorChar"]);
                        processing.InputFileLayout        = Convert.ToString(dataReader["InputFileLayout"]);

                        processing.OutputFileFolderPath    = Convert.ToString(dataReader["OutputFileFolderPath"]);
                        processing.OutputFileName          = Convert.ToString(dataReader["OutputFileName"]);
                        processing.OutputFileExtension     = Convert.ToString(dataReader["OutputFileExtension"]);
                        processing.OutputFileSeparatorChar = Convert.ToString(dataReader["OutputFileSeparatorChar"]);
                        processing.OutputFileLayout        = Convert.ToString(dataReader["OutputFileLayout"]);

                        processing.FileReferenceDateTimeFlag  = Convert.ToBoolean(dataReader["FileReferenceDateTimeFlag"]);
                        processing.FileProcessingDateTimeFlag = Convert.ToBoolean(dataReader["FileProcessingDateTimeFlag"]);
                        processings.Add(processing);
                    }
                    dataReader.Close();
                    return(processings);
                }
        }
Ejemplo n.º 11
0
 public LoadToFile(ProcessingVO processing) : base(processing)
 {
 }
Ejemplo n.º 12
0
 public NoTransformation(ProcessingVO processing) : base(processing)
 {
 }
Ejemplo n.º 13
0
 private void LoadComponents(ProcessingVO processing)
 {
 }
Ejemplo n.º 14
0
 private static IProcessable LoadFromXmlFile(int jobId)
 {
     processingDAO         = new ProcessingXmlDao();
     processingDefinitions = processingDAO.Get(jobId);
     return(ProcessingTypeFactory.CreateProcessing(processingDefinitions));
 }
Ejemplo n.º 15
0
 public FileTransferTransformation(ProcessingVO processing) : base(processing)
 {
 }
Ejemplo n.º 16
0
 public TransformationBase(ProcessingVO processing)
 {
     this.processing      = processing;
     this.transformedData = new DataSet();
 }
Ejemplo n.º 17
0
 public ExtractionFromDataBase(ProcessingVO processing) : base(processing)
 {
 }
Ejemplo n.º 18
0
 public void LoadComponents(ProcessingVO prcessing)
 {
 }
Ejemplo n.º 19
0
 public LoadToDataBase(ProcessingVO processing) : base(processing)
 {
 }
Ejemplo n.º 20
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ProcessingVO processing = processingDao.Get(FIRST_PROCESSING);

            LoadComponents(processing);
        }
Ejemplo n.º 21
0
 public FileCopyTransformation(ProcessingVO processing) : base(processing)
 {
 }
 public FileCopyProcessingFacade(ProcessingVO processing)
     : base(processing)
 {
     this.transformation = new FileCopyTransformation(processing);
 }
Ejemplo n.º 23
0
 public ExtractionBase(ProcessingVO processing)
 {
     this.processing    = processing;
     this.extracDataDAO = new ExtractDataDAO();
     this.extractedData = new DataSet();
 }
Ejemplo n.º 24
0
 public void Save(ProcessingVO processing)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 25
0
 private static IProcessable CreateProcessing(ProcessingVO processingVO)
 {
     ProcessingTypeFactory.Initialize(processingVO);
     return(ProcessingTypeFactory.GetProcessing(processingVO));
 }
Ejemplo n.º 26
0
 public ExtractionFromFile(ProcessingVO processing) : base(processing)
 {
 }
Ejemplo n.º 27
0
 public LoadBase(ProcessingVO processing)
 {
     this.processing = processing;
 }