コード例 #1
0
        static void Main()
        {
            try {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);



                InitialDatabaseSetupController idb;//= new InitialDatabaseSetupController();

                var fm = new Form_Main_PH_Application();
                //fm.objectInitialization();
                idb = fm.idsc;

                idb.InitialProcessingForDatabaseAndApp();

                //Show the language select dialog
                MultiLang.SelectLanguage frmLang = new MultiLang.SelectLanguage();
                frmLang.LoadSettingsAndShow();
                frmLang.Dispose();
                frmLang = null;
                //Application.Run(new Form1());
                // BuildingOperation b = fm.bo;//new BuildingOperation();

                Application.Run(fm);// new Form_Main_PH_Application()
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: jm-goldacker/MyGarage
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     //Sprachauswahl-Formular anzeigen
     System.Windows.ShutdownMode sm = this.ShutdownMode;
     this.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
     MultiLang.SelectLanguage sl = new MultiLang.SelectLanguage();
     sl.LoadSettingsAndShow();
     this.ShutdownMode = sm;
 }
コード例 #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Show the language select dialog
            MultiLang.SelectLanguage frmLang = new MultiLang.SelectLanguage();
            //MessageBox.Show("frm lang" + frmLang);
            frmLang.LoadSettingsAndShow();
            frmLang.Dispose();
            frmLang = null;

            Application.Run(new Form1_main());
        }
コード例 #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Show the language select dialog
            MultiLang.SelectLanguage frmLang = new MultiLang.SelectLanguage();
            //MessageBox.Show("frm lang" + frmLang);
            frmLang.LoadSettingsAndShow();
            frmLang.Dispose();
            frmLang = null;

            Application.Run(new Form1_main());
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: Tecur/rocket_engine_calc
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Sprachauswahl-Formular anzeigen
            MultiLang.SelectLanguage frmLang = new MultiLang.SelectLanguage();
            frmLang.LoadSettingsAndShow();
            frmLang.Dispose();
            frmLang = null;


            Form start_form = new Form();

            Application.Run(start_form);
        }
コード例 #6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);



            //==Before any thign lets run this code because we need language values which is set by this =================//
            Form1_main f1 = new Form1_main();

            f1.FindPathOfBuildingDBNewVersion();
            string selectedBuildingFromT3000 = f1.BuildingSelected[0].Building_Name;//This stores the building name selected in alex part

            string            databasePath1 = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string            databaseFile1 = databasePath1 + @"\db_psychrometric_project.s3db";
            DatabaseOperation db_op         = new DatabaseOperation();

            if (File.Exists(databaseFile1))
            {
                //file exist so dont create the database


                //MessageBox.Show("File exist section");

                db_op.sqlite_database_creation_For_UpdateCondition(selectedBuildingFromT3000);
                //MessageBox.Show("finish of sqlite_database_creation_For_UpdateCondition ");

                //--This one is for checking if the data is present or not if not presnet then create
                db_op.ReadDataForBuildingSelectedFromPsychrometric(); //--We find selected building in Psychro metric database

                BuildingIdentificationClass bic = new BuildingIdentificationClass();
                if (db_op.listBuildingSelectedInfo[0].BuildingName != "")
                {
                    bic.CheckingAndUpdatingBuildingDataFromT3000ToPsychro(selectedBuildingFromT3000, db_op.listBuildingSelectedInfo[0].BuildingName);
                }
                else
                {
                    //The previous building selected in Psy is empty
                    MessageBox.Show("Internal Error no building is selected. Program will run default building settings");
                    db_op.UpdateIDOneSelectBuildingInPsychro();
                    db_op.SelectBuildingInPsychro("Default_Building");//Selecting the default building
                }
            }
            else
            {
                //MessageBox.Show("Internal database not found. Creating fresh database");
                //this.Close();
                if (selectedBuildingFromT3000 != "")
                {
                    //--sqlite new databse creation

                    if (f1.BuildingSelected[0].Building_Name != "" && f1.BuildingSelected[0].country != "" && f1.BuildingSelected[0].city != "")
                    {
                        f1.sqlite_database_creation(selectedBuildingFromT3000);
                    }
                    else
                    {
                        if (MessageBox.Show("Please enter the building location information first in T300 and then restart the application.\n Do you want to continue with the default settings", "Chose an option", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            string buildingName = "Default_Building";
                            //--Seprate code is required because first time when application starts no
                            //--Building info provided so we have to go with default settings
                            f1.sqlite_database_creationWithDefaultSettingsOnly(buildingName);//Passing BuildingName
                            //Previous code doesnot selecte default building so to select default building do this on
                            db_op.SelectBuildingInPsychro(buildingName);
                        }
                        else
                        {
                            string databasePath133 = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                            string databaseFile    = databasePath133 + @"\db_psychrometric_project.s3db";

                            if (File.Exists(databaseFile))
                            {
                                File.Delete(databaseFile);
                            }
                            Environment.Exit(0);
                            Application.Exit();
                        }//Close of else
                    }
                }
                else
                {
                    //End the application
                    MessageBox.Show("Could not create new databse.Closing!");
                    Application.Exit();//Close the application
                }
            }
            //===================End of this section=======================//

            //Show the language select dialog
            MultiLang.SelectLanguage frmLang = new MultiLang.SelectLanguage();
            //MessageBox.Show("frm lang" + frmLang);
            frmLang.LoadSettingsAndShow();
            frmLang.Dispose();
            frmLang = null;

            Application.Run(new Form1_main());
        }