コード例 #1
0
        private static bool ConfirmNotification(ObjectTypes objectType, DateTypes dateType, int?objectId, Guid?objectUid)
        {
            bool notify = false;

            bool hasRecurrence = false;

            if (objectId.HasValue)
            {
                using (IDataReader reader = DBCommon.GetRecurrence((int)objectType, objectId.Value))
                {
                    hasRecurrence = reader.Read();
                }
            }

            switch (objectType)
            {
            case ObjectTypes.CalendarEntry:
                notify = CalendarEntry.ConfirmReminder(dateType, objectId.Value, hasRecurrence);
                break;

            case ObjectTypes.Project:
                notify = Project.ConfirmReminder(dateType, objectId.Value, hasRecurrence);
                break;

            case ObjectTypes.Task:
                notify = Task.ConfirmReminder(dateType, objectId.Value, hasRecurrence);
                break;

            case ObjectTypes.ToDo:
                notify = ToDo.ConfirmReminder(dateType, objectId.Value, hasRecurrence);
                break;

            case ObjectTypes.Assignment:
                AssignmentEntity entity = (AssignmentEntity)BusinessManager.Load(AssignmentEntity.ClassName, (PrimaryKeyId)objectUid.Value);
                if (entity != null && entity.State == (int)AssignmentState.Active)
                {
                    notify = true;
                }
                break;
            }

            return(notify);
        }