public void PivotPresenterConvertGroupIntervalTypeTest() { Assert.AreEqual(DBGroupInterval.gitDateMonth, GroupIntervalHelper.GetDBGroupInterval(PivotGroupInterval.DateMonth)); Assert.AreEqual(DBGroupInterval.gitDate, GroupIntervalHelper.GetDBGroupInterval(PivotGroupInterval.Date)); Assert.AreEqual(DBGroupInterval.gitDateYear, GroupIntervalHelper.GetDBGroupInterval(PivotGroupInterval.DateYear)); Assert.AreEqual(DBGroupInterval.gitDateDayOfWeek, GroupIntervalHelper.GetDBGroupInterval(PivotGroupInterval.DateDayOfWeek)); }
private void Init(WebPivotGridField webField, LayoutDetailDataSet ds) { if (webField == null || ds == null) { IsEmpty = true; return; } BasicCountFunctionId = webField.BasicCountFunctionId; AggregateFunctionId = webField.AggregateFunctionId; Precision = webField.Precision; UnitLayoutSearchFieldId = webField.UnitLayoutSearchFieldId; DateLayoutSearchFieldId = webField.DateLayoutSearchFieldId; if (webField.PrivateGroupInterval.HasValue) { PrivateGroupInterval = (long)GroupIntervalHelper.GetDBGroupInterval(webField.PrivateGroupInterval.Value); } else { PrivateGroupInterval = null; } DiapasonStartDate = webField.DiapasonStartDate; DiapasonEndDate = webField.DiapasonEndDate; AddMissedValues = webField.AddMissedValues; LayoutDetailDataSet.LayoutSearchFieldRow row = GetLayoutSearchFieldRowByField(ds, webField); CaptionEn = string.IsNullOrEmpty(row.strNewFieldENCaption) ? row.strOriginalFieldENCaption : row.strNewFieldENCaption; OriginalCaptionEn = row.strOriginalFieldENCaption; Caption = string.IsNullOrEmpty(row.strNewFieldCaption) ? row.strOriginalFieldCaption : row.strNewFieldCaption; OriginalCaption = row.strOriginalFieldCaption; IsEmpty = false; IsDataArea = webField.Area == PivotArea.DataArea; }
private static void SetInterval(MVCxPivotGrid pivotGrid, PivotGroupInterval interval) { AvrPivotGridModel model = GetModelFromSession(pivotGrid.Request); foreach (PivotGridField field in pivotGrid.Fields) { WebPivotGridField webField = GetWebPivotGridFieldByFieldName(model.PivotSettings.Fields, field.FieldName); if (webField != null) { webField.DefaultGroupInterval = interval; field.GroupInterval = webField.GroupInterval; model.PivotSettings.DefaultGroupInterval = (long)GroupIntervalHelper.GetDBGroupInterval(interval); } else { field.GroupInterval = interval; } } }