Beispiel #1
0
 public static void CopyMissedValues(WebPivotGridField source, WebPivotGridField dest)
 {
     dest.AddMissedValues   = source.AddMissedValues;
     dest.DiapasonStartDate = source.DiapasonStartDate;
     dest.DiapasonEndDate   = source.DiapasonEndDate;
     dest.UpdateImageIndex();
 }
Beispiel #2
0
 public static void ClearMissedValues(WebPivotGridField webField)
 {
     webField.AddMissedValues   = false;
     webField.DiapasonStartDate = null;
     webField.DiapasonEndDate   = null;
     webField.UpdateImageIndex();
 }
Beispiel #3
0
        public void SaveChanges(WebPivotGridField webField, LayoutDetailDataSet ds)
        {
            if (!Equals(BasicCountFunctionId, webField.BasicCountFunctionId))
            {
                webField.BasicCountFunctionId = BasicCountFunctionId;
                webField.HasChanges           = true;
            }
            if (!Equals(AggregateFunctionId, webField.AggregateFunctionId))
            {
                webField.AggregateFunctionId = AggregateFunctionId;
                webField.HasChanges          = true;
            }
            if (!Equals(Precision, webField.Precision))
            {
                webField.Precision  = Precision;
                webField.HasChanges = true;
            }
            if (!Equals(UnitLayoutSearchFieldId, webField.UnitLayoutSearchFieldId))
            {
                webField.UnitLayoutSearchFieldId = UnitLayoutSearchFieldId;
                if (UnitLayoutSearchFieldId != -1)
                {
                    var unitRow = ds.LayoutSearchField.Rows.Find(UnitLayoutSearchFieldId) as LayoutDetailDataSet.LayoutSearchFieldRow;

                    webField.UnitSearchFieldAlias = unitRow == null
                        ? string.Empty
                        : unitRow.strSearchFieldAlias;
                }
                webField.HasChanges = true;
            }
            if (!Equals(DateLayoutSearchFieldId, webField.DateLayoutSearchFieldId))
            {
                webField.DateLayoutSearchFieldId = DateLayoutSearchFieldId;
                webField.HasChanges = true;
            }
            PivotGroupInterval?interval = null;

            if (PrivateGroupInterval.HasValue)
            {
                interval = GroupIntervalHelper.GetGroupInterval(PrivateGroupInterval.Value);
            }
            if (!Equals(interval, webField.PrivateGroupInterval))
            {
                webField.PrivateGroupInterval = interval;
                webField.HasChanges           = true;
            }

            if (!Equals(DiapasonStartDate, webField.DiapasonStartDate))
            {
                webField.DiapasonStartDate = DiapasonStartDate;
                webField.HasChanges        = true;
            }
            if (!Equals(DiapasonEndDate, webField.DiapasonEndDate))
            {
                webField.DiapasonEndDate = DiapasonEndDate;
                webField.HasChanges      = true;
            }
            if (!Equals(AddMissedValues, webField.AddMissedValues))
            {
                webField.AddMissedValues = AddMissedValues;
                webField.UpdateImageIndex();
                webField.HasChanges = true;
            }
            LayoutDetailDataSet.LayoutSearchFieldRow row = GetLayoutSearchFieldRowByField(ds, webField);
            webField.Caption = (ModelUserContext.CurrentLanguage == Localizer.lngEn) ? CaptionEn : Caption;
            if (
                !Equals(string.IsNullOrEmpty(row.strNewFieldENCaption) ? row.strOriginalFieldENCaption : row.strNewFieldENCaption, CaptionEn))
            {
                row.strNewFieldENCaption = CaptionEn;
                webField.HasChanges      = true;
            }
            if (ModelUserContext.CurrentLanguage != Localizer.lngEn)
            {
                if (!Equals(string.IsNullOrEmpty(row.strNewFieldCaption) ? row.strOriginalFieldCaption : row.strNewFieldCaption, Caption))
                {
                    row.strNewFieldCaption = Caption;
                    webField.HasChanges    = true;
                }
            }
        }