Exemple #1
0
        private void InitMembers()
        {
            appli     = null;
            reference = null;

            this.DisposeAllCSVFile();

            sectionCSVManage   = null;
            blockCSVManage     = null;
            articleCSVManage   = null;
            translateCSVManage = null;

            sceneInfo              = null;
            catalogFilePath        = String.Empty;
            catalogFileName        = String.Empty;
            catalogFileDir         = String.Empty;
            this.Status_TSPB.Value = 0;
            this.Status_TSSL.Text  = KD.StringTools.Const.Zero + KD.StringTools.Const.WhiteSpace + KD.StringTools.Const.Percent;

            spaceIniFile = new KD.Config.IniFile(spaceIniPath);
            kdsdkIniFile = new KD.Config.IniFile(kdsdkIniPath);

            exportDir = spaceIniFile.ReadValue(MainForm.SectionExport, KD.CatalogProperties.Const.KeyDir);
            this.SaveFilesDirectory_TBX.Text = exportDir;
        }
Exemple #2
0
        private void WriteBlockInformations()
        {
            this.catalogStatus = "Blocs";
            this.progessBarMax = reference.BlockLinesNb - 1;
            this.Status_BGW.ReportProgress(0);
            int lineIndex = 0;

            for (int sectionRank = 0; sectionRank <= reference.SectionLinesNb - 1; sectionRank++)//
            {
                reference = new Reference(appli, sectionRank, 0, 0);
                int blockNb = reference.Section_BlockNb;

                for (int blockRank = 0; blockRank <= blockNb - 1; blockRank++)//
                {
                    reference      = new Reference(appli, sectionRank, blockRank, 0);
                    sceneInfo      = new SceneInfo(reference);
                    blockCSVManage = new CsvManage(blockCSVFile, reference, sceneInfo);

                    if (blockCSVManage.IsSectionValid(reference.Section_Code, reference.Section_Name))
                    {
                        blockCSVManage.SetBlockRow();
                        blockCSVFile.Flush();
                    }
                    this.Status_BGW.ReportProgress(lineIndex);
                    lineIndex++;
                }
            }
            this.DisposeCSVFile(blockCSVFile);
        }
Exemple #3
0
        private void WriteErrorHeader(CsvFileWriter file)
        {
            CsvManage hearderCSVManage = new CsvManage(file);

            hearderCSVManage.SetErrorHeader();
            file.Flush();
        }
Exemple #4
0
        private void WriteTranslateHeader(CsvFileWriter file)
        {
            CsvManage hearderCSVManage = new CsvManage(file);

            hearderCSVManage.SetTranslateHeader();
            file.Flush();
        }
Exemple #5
0
        private void WriteArticleInformations()
        {
            this.catalogStatus = "Articles";

            if (GenerateTranslate_CHB.Checked)
            {
                this.catalogStatus += " et Traductions";
            }

            this.progessBarMax = reference.ReferenceLinesNb - 1;
            this.Status_BGW.ReportProgress(0);
            int lineIndex = 0;

            for (int sectionRank = 0; sectionRank <= reference.SectionLinesNb - 1; sectionRank++)//
            {
                reference = new Reference(appli, sectionRank, 0, 0);
                int blockNb = reference.Section_BlockNb;

                for (int blockRank = 0; blockRank <= blockNb - 1; blockRank++)
                {
                    reference = new Reference(appli, sectionRank, blockRank, 0);
                    int articleNb = reference.Block_ArticleNb;

                    for (int articleRank = 0; articleRank <= articleNb - 1; articleRank++)
                    {
                        int blockLineIndex = appli.Catalog.TableGetFirstLineRankFromClusterRank(CatalogEnum.TableId.BLOCKS, sectionRank);
                        reference          = new Reference(appli, sectionRank, blockRank + blockLineIndex, articleRank);
                        sceneInfo          = new SceneInfo(reference);
                        articleCSVManage   = new CsvManage(articleCSVFile, reference, sceneInfo);
                        translateCSVManage = new CsvManage(translateCSVFile, reference, sceneInfo);
                        //errorCSVManage = new CsvManage(errorCSVFile);

                        if (articleCSVManage.IsSectionValid(reference.Section_Code, reference.Section_Name))
                        {
                            articleCSVManage.SetArticlePlacedRow(errorCSVFile);
                            articleCSVFile.Flush();

                            if (GenerateTranslate_CHB.Checked)
                            {
                                translateCSVManage.SetTranslatePlacedRow(errorCSVFile);
                                translateCSVFile.Flush();
                            }
                        }
                        this.Status_BGW.ReportProgress(lineIndex);
                        lineIndex++;
                    }
                }
            }

            this.DisposeCSVFile(articleCSVFile);
            this.DisposeCSVFile(translateCSVFile);
            this.DisposeCSVFile(errorCSVFile);
        }
Exemple #6
0
        private void WriteSectionInformations()
        {
            this.catalogStatus = "Chapitres";
            this.progessBarMax = reference.SectionLinesNb - 1;
            this.Status_BGW.ReportProgress(0);

            for (int sectionRank = 0; sectionRank <= reference.SectionLinesNb - 1; sectionRank++)//
            {
                reference        = new Reference(appli, sectionRank, 0, 0);
                sceneInfo        = new SceneInfo(reference);
                sectionCSVManage = new CsvManage(sectionCSVFile, reference, sceneInfo);

                if (sectionCSVManage.IsSectionValid(reference.Section_Code, reference.Section_Name))
                {
                    sectionCSVManage.SetSectionRow();
                    sectionCSVFile.Flush();
                }
                this.Status_BGW.ReportProgress(sectionRank);
            }
            this.DisposeCSVFile(sectionCSVFile);
        }