Ejemplo n.º 1
0
        //Please write your properties and functions here. This part will not be replaced.

        public override void CheckRules(object entitySet, RuleFunctionSEnum fnName, BusinessRuleErrorList errors)
        {
            TimeSeriesStrip obj = (TimeSeriesStrip)entitySet;

            if (fnName == RuleFunctionSEnum.Insert)
            {
                obj.EndDateOffset = obj.StartDateOffset;

                CheckUtils.CheckNotEqual(obj.TimeSeriesStripID, Guid.Empty,
                                         vTimeSeriesStrip.ColumnNames.TimeSeriesStripID, errors);

                CheckUtils.CheckNotEqual(obj.TimeSeriesTypeID, 0,
                                         vTimeSeriesStrip.ColumnNames.TimeSeriesTypeID, errors);
            }
        }
Ejemplo n.º 2
0
        //Please write your properties and functions here. This part will not be replaced.

        public override void CheckRules(object entitySet, RuleFunctionSEnum fnName, BusinessRuleErrorList errors)
        {
            TimeSeries_SmallInt_Seconds obj = (TimeSeries_SmallInt_Seconds)entitySet;

            if (fnName == RuleFunctionSEnum.Insert)
            {
                //TODO: Check related TimeSeriesStrip exists
                //TODO: Check date is greater than startdate in strip
                //TODO: Check strip is the lastest strip in database

                CheckUtils.CheckNotEqual(obj.TimeSeriesStripID, Guid.Empty,
                                         TimeSeries_SmallInt_Seconds.ColumnNames.TimeSeriesStripID, errors);

                // typeid should be provided
                CheckUtils.CheckNotEqual(obj.TimeSeriesTypeID, 0,
                                         TimeSeries_SmallInt_Seconds.ColumnNames.TimeSeriesTypeID, errors);

                // time should be in unix range
                int maxUtcEpoch = DateTimeEpoch.GetUtcNowEpoch();
                CheckUtils.CheckIntBetweenMinMax(TimeSeries_SmallInt_Seconds.ColumnNames.TSDateOffset, obj.TSDateOffset, errors,
                                                 DateTimeEpoch.UnixMinDateSecondsEpoch, maxUtcEpoch);
            }
        }