/// <summary> /// Updates the fact table contents for the records aggregated in the Cube cell with /// a specified address /// </summary> public override void Writeback(ICubeAddress Address, object NewValue, WritebackMethod Method) { ((MOlapCube)FCube).EnsureConnected(); var sb = new StringBuilder("UPDATE CUBE ["); sb.Append(((MOlapCube)FCube).CubeName); sb.Append("] SET ("); sb.Append(Address.Measure.UniqueName); for (var i = 0; i < Address.LevelsCount; i++) { sb.Append(","); sb.Append(Address.Members(i).UniqueName); } sb.Append(") = "); var nv = Convert.ToDouble(NewValue); sb.Append(nv.ToString(CultureInfo.InvariantCulture.NumberFormat)); sb.Append(" "); switch (Method) { case WritebackMethod.wmEqualAllocation: sb.Append(" USE_EQUAL_ALLOCATION"); break; case WritebackMethod.wmEqualIncrement: sb.Append(" USE_EQUAL_INCREMENT"); break; case WritebackMethod.wmWeightedAllocation: sb.Append(" USE_WEIGHTED_ALLOCATION"); break; case WritebackMethod.wmWeightedIncrement: sb.Append(" USE_WEIGHTED_INCREMENT"); break; } ((MOlapCube)FCube).ExecuteMDXCommand(sb.ToString()); Clear(); RebuildGridMembers(); }
/// <summary> /// Updates the fact table contents for the records aggregated in the Cube cell with /// the specified address. /// </summary> /// <remarks> /// <para> /// For the Grid with the MOlapCube component as the data source, the MDX /// "Writeback" command with the appropriate parameters is fulfilled. /// </para> /// <para> /// For the grid with the TOLAPCube component as the data source, the OnWriteback /// event is called. /// </para> /// </remarks> /// <param name="Address">The <see cref="ICubeAddress">address</see> of cube cell</param> /// <param name="NewValue">The new value for the cell</param> /// <param name="Method">The <see cref="TWritebackMethod">type of writeback distribution</see></param> public abstract void Writeback(ICubeAddress Address, object NewValue, WritebackMethod Method);
public void Writeback(object NewValue, WritebackMethod Method) { CellSet.Grid.Engine.Writeback(Address, NewValue, Method); }