示例#1
0
        /// <summary>
        ///  Katrina: Refreshes/loads package combobox for on-load, adds, and updates
        /// </summary>
        private void RefreshPkgComboBox(bool lastIndex = false)
        {
            int selectIndex = 0;

            packageIds = PackageDB.GetPackageIds();

            if (packageIds.Count > 0) // if there are packages -Katrina
            {
                PkgIdComboBox.DataSource = packageIds;

                if (lastIndex == true)
                {
                    selectIndex = PkgIdComboBox.Items.Count - 1;
                }

                PkgIdComboBox.SelectedIndex = selectIndex; // triggers selectedindexchanged -Katrina
            }
            else // no packages -Katrina
            {
                MessageBox.Show("There are no packages. Add a package in the database and restart the application ", "Empty Load");
                Application.Exit();
            }
        }