Exemplo n.º 1
0
        public UIMainScreen()
        {
            //Create the logger
            InitializeComponent();
            Logger = new ODL.Common.LogHandler();
#if DEBUG
            Logger.DebugMode = true;
#endif
            Logger.LogTableUpdated += RefreshLogGrid;
            Logger.LogInformation("Welcome to OpenDataLoader.");
            if (Logger.DebugMode)
            {
                Logger.LogDebug("Created Logger");
            }

            //Populate dropdown for dbtype
            if (Logger.DebugMode)
            {
                Logger.LogTrace("Creating Dropdown Selections");
            }
            List <KeyValuePair <String, String> > lstDBTypes = new List <KeyValuePair <String, String> >();
            Array DBtypes = Enum.GetValues(typeof(ODL.Common.SupportedDatabases));
            foreach (ODL.Common.SupportedDatabases _entry in DBtypes)
            {
                lstDBTypes.Add(new KeyValuePair <String, String>(_entry.ToString(), ((int)_entry).ToString()));
            }
            cmbDatabaseType.DisplayMember = "Key";
            cmbDatabaseType.ValueMember   = "Value";
            cmbDatabaseType.DataSource    = lstDBTypes;

            //Populate the dropdowns for the File Source and File Type
            cmbFileSource.DisplayMember = "Key";
            cmbFileSource.ValueMember   = "Value";
            cmbFileSource.DataSource    = ConvolutedWayToMakeNestedDropdowns();

            if (Logger.DebugMode)
            {
                Logger.LogTrace("Loading DBConfig from json (if available)");
            }
            //Load config from json
            ConnectionDetails = ODL.Common.DatabaseUtils.Load(Logger);

            txtDBUsername.Text   = ConnectionDetails.DBUsername;
            txtDBPassword.Text   = ConnectionDetails.DBPassword;
            txtDBServer.Text     = ConnectionDetails.DBServer;
            txtDBCatalog.Text    = ConnectionDetails.DBCatalog;
            txtDBPort.Text       = ConnectionDetails.DBPort.ToString();
            cmbDatabaseType.Text = ConnectionDetails.DBType.ToString();
        }
Exemplo n.º 2
0
 public TeacherEvaluations(LogHandler LogObject, ODL.Common.DBConnectionDetails DbConnectionInfo, String FileName) : base(LogObject, DbConnectionInfo, FileName)
 {
 }