/// <summary>
        ///     A helper method which returns the partial view of the recently created column data
        /// </summary>
        /// <param name="measureID">The ID of the measure to be used</param>
        /// <param name="measureBreakdownID">The ID of the measure Breakdown to be used</param>
        /// <param name="dimValueID">The ID of the Dim Combination to be used</param>
        /// <param name="newColumnName">The name of the new column to be added</param>
        /// <returns>The Partial View that can will be added to the main view</returns>
        public PartialViewResult AddColumnRow(int measureID, int measureBreakdownID, int dimValueID, String newColumnName)
        {
            DataViewDataAccess dataAccess = new DataViewDataAccess();

            ViewColumnModel model = dataAccess.getColumnModel(measureID, measureBreakdownID, dimValueID, newColumnName);

            return(PartialView("ViewColumnControl", model));
        }
예제 #2
0
        protected override ViewColumnModel MapViewColumn(DataRow row)
        {
            var viewColumn = new ViewColumnModel();

            viewColumn.ViewCatalog            = row.GetString("VIEW_SCHEMA");
            viewColumn.ViewSchema             = null;
            viewColumn.ViewName               = row.GetString("VIEW_NAME");
            viewColumn.ColumnName             = row.GetString("COLUMN_NAME");
            viewColumn.OrdinalPosition        = row.GetInt("ORDINAL_POSITION");
            viewColumn.IsNullable             = row.GetValue("IS_NULLABLE", CommonConverter.ConvertStringToBool);
            viewColumn.DataType               = row.GetString("DATA_TYPE");
            viewColumn.CharacterMaximumLength = row.GetNullableLong("CHARACTER_MAXIMUM_LENGTH");

            return(viewColumn);
        }
        /// <summary>
        /// Contains the data passed back from the view which can then be added into the model dynamically
        /// </summary>
        /// <param name="measureID"> The ID of the measure used</param>
        /// <param name="measureBreakdownID"> The ID of the measure breakdown used</param>
        /// <param name="dimValueID"> The ID of the Dim combinations to use</param>
        /// <param name="newColumnName"> The name of the new column</param>
        /// <returns>A model to be added into the View</returns>
        public ViewColumnModel getColumnModel(int measureID, int measureBreakdownID, int dimValueID, String newColumnName)
        {
            ViewColumnModel model = new ViewColumnModel();

            Geographical_NeedsEntities context = new Geographical_NeedsEntities();

            model.ColumnName = newColumnName;

            model.SelectedMeasureID = measureID;
            model.SelectedMeasure   = context.Measures.Single(x => x.MeasureID.Equals(measureID)).MeasureName;

            model.SelectedMeasureBreakdownID = measureBreakdownID;
            model.SelectedMeasureBreakdown   = context.MeasureBreakdowns.Single(x => x.MeasureBreakdownID.Equals(measureBreakdownID)).MeasureBreakdownName;

            model.SelectedDimensionValueID = dimValueID;
            model.SelectedDimensionValue   = context.DimensionSetCombinations.Single(x => x.DimensionSetCombinationID.Equals(dimValueID)).DimensionSetCombinationName;

            return(model);
        }