protected virtual ArchiveRestrictionInfo[] GetArchiveRestrictionInfos(int mainId)
        {
            var archiveRest = new ArchiveRestrictionInfo[1];

            archiveRest[0] = new ArchiveRestrictionInfo
            {
                Name     = Keyid,
                Operator = "=",
                Values   = new string[] { mainId.ToString() },
                IsActive = true
            };
            return(archiveRest);
        }
Пример #2
0
        /// <summary>
        /// Create the SuperOffice restriction
        /// </summary>
        /// <param name="fullColumnName">Column name including table (dot syntax)</param>
        /// <param name="op">Operator to compare value</param>
        /// <param name="interRestrictionOperator">And / Or</param>
        /// <param name="level">Level of the restriction (for parenthesis). This corrosponds directly with the InterParenthesis value of a SuperOffice ArchiveRestrictionInfo</param>
        /// <param name="values">Value(s) for column comparison in restriction</param>
        /// <returns>Newly created archive restriction info</returns>
        protected ArchiveRestrictionInfo CreateRestriction(string fullColumnName, EOperator op, InterRestrictionOperator interRestrictionOperator, int level, params object[] values)
        {
            ArchiveRestrictionInfo r = new ArchiveRestrictionInfo();

            r.Name             = fullColumnName;
            r.Operator         = op.ToString().ToLower();
            r.Values           = ConvertValues(values);
            r.InterParenthesis = level;
            r.IsActive         = true;

            SetPrevInterRestrictionOperator(interRestrictionOperator);

            return(r);
        }
        /// <summary>
        /// Should only show not done appointments from today (actually, current day)
        /// </summary>
        /// <param name="mainId"></param>
        /// <returns></returns>
        protected override ArchiveRestrictionInfo[] GetArchiveRestrictionInfos(int mainId)
        {
            var archiveRest = new ArchiveRestrictionInfo[]
            {
                new ArchiveRestrictionInfo
                {
                    Name     = Keyid,
                    Operator = "=",
                    Values   = new string[]
                    {
                        CultureDataFormatter.EncodeInt(mainId)
                    },
                    IsActive      = true,
                    InterOperator = InterRestrictionOperator.And
                },
                new ArchiveRestrictionInfo
                {
                    Name     = "date",
                    Operator = "today",
                    Values   = new string[] { "" },
                    //Values = new string[]
                    //{
                    //	CultureDataFormatter.EncodeDateTime( DateTime.Today ),
                    //	CultureDataFormatter.EncodeDateTime( DateTime.Today.AddDays( 2 )/*.AddDays( 1 ).AddSeconds( -1 )*/ ),
                    //},
                    IsActive      = true,
                    InterOperator = InterRestrictionOperator.And
                },
                new ArchiveRestrictionInfo
                {
                    Name     = "completed",
                    Operator = "=",
                    Values   = new string[] { CultureDataFormatter.EncodeInt(0) },
                    IsActive = true
                }
            };

            return(archiveRest);
        }
Пример #4
0
 protected void AddRestriction(ArchiveRestrictionInfo restriction)
 {
     _restrictions.Add(restriction);
     _last = restriction;
 }