예제 #1
0
        ///Добавить все изображения из папки.
        private void DirAdd()
        {
            const string initialPath = @"C:\";
            string       dirName     = "";

            if (!FBAFile.DirChoose(initialPath, out dirName))
            {
                return;
            }
            const bool subDirectories = false; //Вложенные подпапки не проверяем.

            string[]     files       = FBAFile.FileFind(dirName, "*.*", subDirectories);
            const string imageFormat = ";.BMP;.JPG;.GIF;.PNG;";
            var          progress1   = new FormProgress("Загрузка", "Загрузка изображений в базу данных", files.Count());

            progress1.Show();
            for (int i = 0; i < files.Count(); i++)
            {
                string fileNameFull = files[i];
                string format       = Path.GetExtension(fileNameFull).ToUpper();
                if (imageFormat.IndexOf(format, StringComparison.OrdinalIgnoreCase) < 0)
                {
                    continue;
                }
                if (!ImageAdd(fileNameFull))
                {
                    return;
                }
                progress1.Inc();
                //Thread.Sleep(1000);
            }
            progress1.Dispose();
            ImageRefresh();
            sys.SM("Bсе изображения успешно загружены в базу данных!", MessageType.Information);
        }
예제 #2
0
        ///Событие. Главное меню.
        private void MainMenu_N1_1Click(object sender, EventArgs e)
        {
            if (sender == MainMenu_N1_1)
            {
                Environment.Exit(0);
            }
            if (sender == MainMenu_N2_3)
            {
                System.Diagnostics.Process.Start(FBAPath.PathAdditional + @"ColorTable.html");
            }
            if (sender == MainMenu_N2_4)
            {
                new FormReg().Show();
            }
            if (sender == MainMenu_N2_5)
            {
                System.Diagnostics.Process.Start(FBAPath.PathAdditional + @"ASCII.html");
            }
            if (sender == MainMenu_N2_6)
            {
                System.Diagnostics.Process.Start(FBAPath.PathAdditional + @"DataTimeFormat.html");
            }

            if (sender == MainMenu_N2_8)
            {
                FBAFile.FileRunEXESimple(FBAPath.PathMain + @"Updater.exe");
            }
            if (sender == MainMenu_N2_9)
            {
                FBAFile.FileRunEXESimple(FBAPath.PathMain + @"ServerApp.exe");
            }
            if (sender == MainMenu_N2_10)
            {
                FBAFile.FileRunEXESimple(FBAPath.PathMain + @"ClientApp.exe");
            }

            if (sender == MainMenu_N4_2)
            {
                new FormAbout().Show();
            }
            if (sender == MainMenu_N2_13)
            {
                new FormGrant().Show();
            }
            if (sender == MainMenu_N2_15)
            {
                new FormDDL().Show();
            }
            if (sender == MainMenu_N2_16)
            {
                new FormModel().Show();
            }
            if (sender == MainMenu_N2_17)
            {
                new FormSQL().Show();
            }
            if (sender == MainMenu_N2_18)
            {
                new FormUpdate().Show();
            }
            if (sender == MainMenu_N2_19)
            {
                new FormImage().Show();
            }
            if (sender == MainMenu_N2_20)
            {
                new FormText().Show();
            }
            if (sender == MainMenu_N2_21)
            {
                new FormParam().Show();
            }
            if (sender == MainMenu_N2_22)
            {
                new FormStatus().Show();
            }
            if (sender == MainMenu_N3_1)
            {
                new FormConList().Show();
            }
            if (sender == MainMenu_N2_23)
            {
                new ProjectService("").Show();
            }

            //Выбор шрифт всех форм.
            if (sender == MainMenu_N3_2)
            {
                if (fontDialog1.ShowDialog() == DialogResult.OK)
                {
                    Var.font1 = fontDialog1.Font;
                }
            }
            if (sender == MainMenu_N3_3)
            {
                string Path = "";
                if (!FBAFile.DirChoose(Application.StartupPath, out Path))
                {
                    return;
                }
                sys.ShowSolutionStringCodeCount(Path);
            }

            //Сущности.
            if (sender == MainMenu_N2_24)
            {
                sys.ShowDirectorySimple("Entity", "", "", "", null, "SELECT * FROM fbaEntity", "");
            }

            //Атрибуты.
            if (sender == MainMenu_N2_25)
            {
                sys.ShowDirectorySimple("Attribute", "", "", "", null, "SELECT * FROM fbaAttribute", "");
            }

            //Таблицы.
            if (sender == MainMenu_N2_26)
            {
                sys.ShowDirectorySimple("Table", "", "", "", null, "SELECT * FROM fbaTable", "");
            }

            //Шаблоны отчетов.
            if (sender == MainMenu_N2_27)
            {
                new FormReport().Show();
            }

            if (sender == MainMenu_N2_7)
            {
                System.Diagnostics.Process.Start(@"https://docs.microsoft.com/ru-ru/dotnet/api/system.windows.media.brushes?view=netcore-3.0");
            }

            //Ошибки пользователей.
            if (sender == MainMenu_N2_28)
            {
                new FormError().Show();
            }

            //Справка
            if (sender == MainMenu_N4_1)
            {
                sys.ShowHelp();
            }
            //Help.ShowHelp(this, sys.PathHelp);

            //Форма для добавления методов сущностей.
            if (sender == MainMenu_N2_29)
            {
                new FormMethod().Show();
            }
        }