public PrimitiveApplicationInfo(Core core, Primitive owner, long applicationId)
            : base(core)
        {
            this.owner = owner;
            ItemLoad += new ItemLoadHandler(PrimitiveApplicationInfo_ItemLoad);

            SelectQuery query = new SelectQuery(PrimitiveApplicationInfo.GetTable(typeof(PrimitiveApplicationInfo)));
            query.AddFields(PrimitiveApplicationInfo.GetFieldsPrefixed(core, typeof(PrimitiveApplicationInfo)));
            query.AddCondition("application_id", applicationId);
            query.AddCondition("item_id", owner.Id);
            query.AddCondition("item_type_id", owner.TypeId);

            DataTable appDataTable = db.Query(query);

            if (appDataTable.Rows.Count == 1)
            {
                DataRow appRow = appDataTable.Rows[0];
                try
                {
                    loadItemInfo(appRow);
                }
                catch (InvalidItemException)
                {
                    throw new InvalidPrimitiveAppInfoException();
                }
            }
            else
            {
                throw new InvalidPrimitiveAppInfoException();
            }
        }
Пример #2
0
        public EventEmailInvite(Core core, DataRow eventInviteDataRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(EventEmailInvite_ItemLoad);

            loadItemInfo(eventInviteDataRow);
        }
Пример #3
0
        public InviteKey(Core core, DataRow inviteRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(InviteKey_ItemLoad);

            loadItemInfo(inviteRow);
        }
Пример #4
0
        public RateLimit(Core core, System.Data.Common.DbDataReader rateLimitRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(RateLimit_ItemLoad);

            loadItemInfo(rateLimitRow);
        }
Пример #5
0
        internal GroupOperator(Core core, DataRow operatorRow)
            : base(core, operatorRow)
        {
            ItemLoad += new ItemLoadHandler(GroupOperator_ItemLoad);

            loadItemInfo(operatorRow);
        }
Пример #6
0
        public EventEmailInvite(Core core, System.Data.Common.DbDataReader eventInviteDataRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(EventEmailInvite_ItemLoad);

            loadItemInfo(eventInviteDataRow);
        }
Пример #7
0
        public ActionItem(Core core, long actionId, long itemId, long itemTypeId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ActionItem_ItemLoad);

            SelectQuery query = ActionItem.GetSelectQueryStub(core, typeof(ActionItem));
            query.AddCondition("action_id", actionId);
            query.AddCondition("item_id", itemId);
            query.AddCondition("item_type_id", itemTypeId);

            System.Data.Common.DbDataReader actionReader = db.ReaderQuery(query);

            if (actionReader.HasRows)
            {
                actionReader.Read();

                loadItemInfo(actionReader);

                actionReader.Close();
                actionReader.Dispose();
            }
            else
            {
                actionReader.Close();
                actionReader.Dispose();

                throw new InvalidActionItemException();
            }
        }
Пример #8
0
        public Calendar(Core core, Primitive owner)
            : base(core)
        {
            if (core == null)
            {
                throw new NullCoreException();
            }

            if (owner == null)
            {
                throw new InvalidUserException();
            }

            this.owner = owner;
            ItemLoad += new ItemLoadHandler(Calendar_ItemLoad);

            try
            {
                LoadItem("calendar_item_id", "calendar_item_type_id", owner);
            }
            catch (InvalidItemException)
            {
                throw new InvalidCalendarException();
            }
        }
Пример #9
0
        public GuestBookCommentCount(Core core, DataRow countRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(GuestBookCommentCount_ItemLoad);

            loadItemInfo(countRow);
        }
Пример #10
0
        public ApplicationError(Core core, System.Data.Common.DbDataReader errorRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ApplicationError_ItemLoad);

            loadItemInfo(errorRow);
        }
Пример #11
0
        public Category(Core core, DataRow categoryRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Category_ItemLoad);

            loadItemInfo(categoryRow);
        }
Пример #12
0
        public SpamReport(Core core, DataRow reportRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(SpamReport_ItemLoad);

            loadItemInfo(reportRow);
        }
Пример #13
0
        public HelpTopic(Core core, DataRow helpRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(HelpTopic_ItemLoad);

            loadItemInfo(helpRow);
        }
Пример #14
0
        public ReferralKey(Core core, DataRow referralRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ReferralKey_ItemLoad);

            loadItemInfo(referralRow);
        }
Пример #15
0
        public ItemViewCountByHour(Core core, DataRow viewRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ItemViewCountByHour_ItemLoad);

            loadItemInfo(viewRow);
        }
Пример #16
0
        public ItemHashtag(Core core, DataRow itemHashtagRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ItemHashtag_ItemLoad);

            loadItemInfo(itemHashtagRow);
        }
Пример #17
0
        public ListType(Core core, DataRow typeRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ListType_ItemLoad);

            loadItemInfo(typeRow);
        }
Пример #18
0
        public ApplicationError(Core core, DataRow errorRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ApplicationError_ItemLoad);

            loadItemInfo(errorRow);
        }
Пример #19
0
        public ListItem(Core core, DataRow listItemRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(ListItem_ItemLoad);

            loadItemInfo(listItemRow);
            lit = new ListItemText(core, listItemRow);
        }
Пример #20
0
        public FriendGroup(Core core, User owner, DataRow friendGroupRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(FriendGroup_ItemLoad);
            this.owner = owner;

            loadItemInfo(friendGroupRow);
        }
Пример #21
0
        internal GroupOfficer(Core core, System.Data.Common.DbDataReader officerRow)
            : base(core, officerRow)
        {
            ItemLoad += new ItemLoadHandler(GroupOfficer_ItemLoad);

            loadItemInfo(officerRow);
            loadGroupMember(officerRow);
            loadUser(officerRow);
        }
Пример #22
0
        internal GroupOfficer(Core core, DataRow officerRow)
            : base(core, officerRow)
        {
            ItemLoad += new ItemLoadHandler(GroupOfficer_ItemLoad);

            loadItemInfo(officerRow);
            loadGroupMember(officerRow);
            loadUser(officerRow);
        }
Пример #23
0
        public Currency(Core core, long currencyId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Currency_ItemLoad);

            this.currencyId = currencyId;

            GetCurrencyInfo(currencyId, ref currencyCode, ref title, ref fraction, ref symbol);
        }
Пример #24
0
        public HelpTopic(Core core, long topicId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(HelpTopic_ItemLoad);

            try
            {
                LoadItem(topicId);
            }
            catch (InvalidItemException)
            {
                throw new InvalidHelpTopicException();
            }
        }
Пример #25
0
        public Comment(Core core, long commentId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Comment_ItemLoad);

            try
            {
                LoadItem(commentId);
            }
            catch (InvalidItemException)
            {
                throw new InvalidCommentException();
            }
        }
Пример #26
0
        public TopicReadStatus(Core core, DataRow dr)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(TopicReadStatus_ItemLoad);

            try
            {
                loadItemInfo(dr);
            }
            catch (InvalidItemException)
            {
                throw new InvalidTopicReadStatusException();
            }
        }
Пример #27
0
        public DocumentRevision(Core core, long documentId, string revision)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(DocumentRevision_ItemLoad);

            try
            {
                LoadItem(new FieldValuePair("document_id", documentId), new FieldValuePair("document_revision", revision));
            }
            catch (InvalidItemException)
            {
                throw new InvalidDocumentRevisionException();
            }
        }
Пример #28
0
        public Gig(Core core, long gigId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Gig_ItemLoad);

            try
            {
                LoadItem(gigId);
            }
            catch (InvalidItemException)
            {
                throw new InvalidGigException();
            }
        }
Пример #29
0
        public MailFolder(Core core, long folderId)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(MailFolder_ItemLoad);

            try
            {
                LoadItem(folderId);
            }
            catch (InvalidItemException)
            {
                throw new InvalidMailFolderException();
            }
        }
Пример #30
0
        public Country(Core core, DataRow countryRow)
            : base(core)
        {
            ItemLoad += new ItemLoadHandler(Country_ItemLoad);

            try
            {
                loadItemInfo(countryRow);
            }
            catch (InvalidItemException)
            {
                throw new InvalidCountryException();
            }
        }