Beispiel #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            #region//Testing Code
            //Testing MyTests = new Testing();
            //MyTests.runPDFCreatorTest();
            #endregion

            //First check if this is the user's first time to log in
            if(DBCommunication.IsInitialLogIn())
            {
                InitialSetupForm ISF = new InitialSetupForm();
                ISF.Show();
            }
            DBCommunication.LoadSettings();

            Globals.GlobalInvestments = DBCommunication.GetInvestments();
            Globals.GlobalInvestors = DBCommunication.GetInvestors();
            Globals.GlobalYouth = DBCommunication.GetYouth();

            Globals.InitializeCertificateNumbers();
            Globals.GlobalCertificateNumbersToDelete = new List<string>();



            InvestorsListBox.DisplayMember = "LabelName";
            InvestorsListBox.ValueMember = "InvestorID";
            investorsBD.DataSource = Globals.GlobalInvestors;
            InvestorsListBox.DataSource = investorsBD;

            youthBD.DataSource = Globals.GlobalYouth;
            YouthListBox.DisplayMember = "FullName";
            YouthListBox.ValueMember = "YouthID";
            YouthListBox.DataSource = youthBD;

            //Setup the IndividualYouthComboBox used for the Youth Reports
            IndividualYouthComboBox.DataSource = youthBD;
            IndividualYouthComboBox.DisplayMember = "FullName";
            IndividualYouthComboBox.ValueMember = "FullName";


            StartDateDateTimePicker.Value = Globals.ProgramStartDate;
            EndDateDateTimePicker.Value = DateTime.Now;

            //Load the values for the user settings
            AdminEmailTextBox.Text = Globals.AdminEmail;
            AdminPasswordTextBox.Text = Globals.AdminPassword;
            ProgramStartDateTimePicker.Value = Globals.ProgramStartDate;
            ProgramEndDateTimePicker.Value = Globals.ProgramEndDate;
            DefaultAmountComboBox.SelectedItem = Globals.DefaultInvestmentAmount.ToString();
            DefaultCreditToComboBox.SelectedItem = Globals.DefaultCreditToType;
            DefaultPaymentTypeComboBox.SelectedItem = Globals.DefaultPaymentType;
            DefaultFilePathTextBox.Text = Globals.SaveFilePath;

            //These are used to track changes made to investors/investments/settings
            //to tell the form whether or not to rebind when the form becomes active again
            Globals.rebindOnMainForm = false;
            Globals.rebindYouthOnMainForm = false;
        }
Beispiel #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            relocateDataBaseFiles();

            //First check if this is the user's first time to log in
            if (DBCommunication.IsInitialLogIn())
            {
                InitialSetupForm ISF = new InitialSetupForm();
                ISF.ShowDialog();
            }
            if (!Globals.IsFirstLogin)
            {
                Application.Run(new MainForm());
            }
        }