Esempio n. 1
0
        public static qPtl_UserAnnouncement_View GetUserAnnouncementByContentTypeID(int content_type_id, int user_id)
        {
            var message = new qPtl_UserAnnouncement_View();

            message.container.Select(
                new DbQuery
            {
                Where = string.Format("Available = 'Yes' AND MarkAsDelete = 0 AND UserViewed Is null AND (RemindAfter Is null OR RemindAfter < GetDate()) AND ContentTypeID = {0} AND UserID = {1}", content_type_id, user_id)
            });

            return(message);
        }
Esempio n. 2
0
        public static qPtl_UserAnnouncement_View GetUserAnnouncementByContentTypeReferenceID(int content_type_id, int reference_id, int user_id)
        {
            var    message   = new qPtl_UserAnnouncement_View();
            string sql_where = string.Empty;

            sql_where = "Available = 'Yes' AND MarkAsDelete = 0 AND UserViewed Is null AND (RemindAfter Is null OR RemindAfter < GetDate())";

            if (content_type_id == 0)
            {
                sql_where += " AND (ContentTypeID = " + content_type_id + " OR ContentTypeID Is null)";
            }
            else
            {
                sql_where += " AND ContentTypeID = " + content_type_id;
            }

            if (reference_id == 0)
            {
                sql_where += " AND (ReferenceID = " + reference_id + " OR ReferenceID Is null)";
            }
            else
            {
                sql_where += " AND ReferenceID = " + reference_id;
            }

            sql_where += " AND UserID = " + user_id;


            message.container.Select(
                new DbQuery
            {
                Where = sql_where
            });

            return(message);
        }
        public static qPtl_UserAnnouncement_View GetUserAnnouncementByContentTypeReferenceID(int content_type_id, int reference_id, int user_id)
        {
            var message = new qPtl_UserAnnouncement_View();
            string sql_where = string.Empty;

            sql_where = "Available = 'Yes' AND MarkAsDelete = 0 AND UserViewed Is null AND (RemindAfter Is null OR RemindAfter < GetDate())";

            if (content_type_id == 0)
                sql_where += " AND (ContentTypeID = " + content_type_id + " OR ContentTypeID Is null)";
            else
                sql_where += " AND ContentTypeID = " + content_type_id;

            if (reference_id == 0)
                sql_where += " AND (ReferenceID = " + reference_id + " OR ReferenceID Is null)";
            else
                sql_where += " AND ReferenceID = " + reference_id;

            sql_where += " AND UserID = " + user_id;

            message.container.Select(
                new DbQuery
                {
                    Where = sql_where
                });

            return message;
        }
        public static qPtl_UserAnnouncement_View GetUserAnnouncementByContentTypeID(int content_type_id, int user_id)
        {
            var message = new qPtl_UserAnnouncement_View();

            message.container.Select(
                new DbQuery
                {
                    Where = string.Format("Available = 'Yes' AND MarkAsDelete = 0 AND UserViewed Is null AND (RemindAfter Is null OR RemindAfter < GetDate()) AND ContentTypeID = {0} AND UserID = {1}", content_type_id, user_id)
                });

            return message;
        }