private void GetLcOforCourse()
        {
            if (IsQueryStringMissingParameter(X_ID))
            {
                RedirectToPortalSelectionScreen();
            }
            else
            {
                _courseId = GetDecryptedEntityId(X_ID);
                if (!RecordExistsInCache(Key))
                {
                    _lco = LCO.GetCourseObjectByCourseID(_courseId);
                }
                else
                {
                    _lco = (LCO)Base.Classes.Cache.Get(Key);
                }

                lcoName.Text = _lco.Grade + " " + _lco.CourseNumber + " " + _lco.Course;
            }
        }
Esempio n. 2
0
        } // LoadFormData

        //-----------------------------------------------------------------------------------
        // Show number of records meeting the criteria
        //-----------------------------------------------------------------------------------
        private void RunQueryForLCO(int lco)
        {
            string          queryString = "";
            OleDbCommand    command;
            OleDbDataReader reader;
            OleDbConnection connection = new OleDbConnection(_connectionstring);

            if (connection != null)
            {
                connection.Open();
                try
                {
                    // Build the query to search with
                    string LCOstr = "";
                    if (lco > 5) // Do any with LCO
                    {
                        LCOstr = "> 0";
                    }
                    else
                    {
                        LCOstr = "= " + LCO.ToString();
                    }
                    queryString =
                        "SELECT [Dbf Line Section].[Zone ID], [Dbf Consequence].LCO, [Dbf Line Section].[Begin Point], [Dbf Line Section].[End Point], " +
                        "[Dbf Line Section].[Line Section], [Dbf Line Section].MapFeatureID " +
                        "FROM [Dbf Consequence] INNER JOIN [Dbf Line Section] ON [Dbf Consequence].LineID = [Dbf Line Section].LineID " +
                        "WHERE ((([Dbf Consequence].LCO) " + LCOstr + ") AND (([Dbf Line Section].[Begin Point])>=[Dbf Consequence].[Begin Point]) AND (([Dbf Line Section].[End Point])<=[Dbf Consequence].[End Point]))";
                    command = new OleDbCommand(queryString, connection);
                    int count = (Int32)command.ExecuteScalar();
                }
                catch (Exception ex)
                {
                    connection.Close();
                }
            }
        }