示例#1
0
        /// <summary>
        /// 阅读短信
        /// </summary>
        /// <param name="id">短信ID</param>
        /// <returns>数据集</returns>
        public DataTable Read(string id)
        {
            // 阅读处理
            DataTable dataTable = this.GetDataTableById(id);
            BaseContactDetailsEntity contactDetailsEntity = new BaseContactDetailsEntity(dataTable);

            this.OnRead(contactDetailsEntity);
            // 返回结果
            BaseContactManager contactManager = new BaseContactManager(DbHelper, UserInfo);

            return(contactManager.GetDataTableById(contactDetailsEntity.ContactId));
        }
示例#2
0
        /// <summary>
        /// 定期执行,把置顶的新闻自动下架
        /// 2016-01-04 吉日嘎拉
        /// </summary>
        /// <returns>影响行数</returns>
        public static int Task()
        {
            int result = 0;

            BaseContactManager contactManager = new BaseContactManager();
            string             commandText    = " UPDATE " + BaseContactEntity.TableName
                                                + "  SET " + BaseContactEntity.FieldPriority + " = 4 "
                                                + "  , " + BaseContactEntity.FieldCancelTopDay + " = 0 "
                                                + "WHERE " + BaseContactEntity.FieldEnabled + " = 1 "
                                                + "      AND " + BaseContactEntity.FieldDeletionStateCode + " = 0 "
                                                //    + "      AND " + BaseContactEntity.FieldCancelTopDay + " > 0 "
                                                + "      AND " + BaseContactEntity.FieldPriority + " < 4 "
                                                + "      AND " + BaseContactEntity.FieldCreateOn + " > SYSDATE - 30 "
                                                + "      AND " + BaseContactEntity.FieldCreateOn + " < SYSDATE - " + BaseContactEntity.FieldCancelTopDay;

            result = contactManager.DbHelper.ExecuteNonQuery(commandText);

            return(result);
        }
示例#3
0
        /// <summary>
        /// 邮件有评论时要进行的操作
        /// </summary>
        /// <param name="detailsID">邮件主键</param>
        /// <returns>影响行数</returns>
        public int OnCommnet(string detailsId)
        {
            int returnValue = 0;
            BaseContactDetailsEntity contactDetailsEntity = this.GetEntity(detailsId);
            // 更新子表的其他人的通知,首先是有效的邮件,其次不是新邮件,其次不是自己的邮件
            string sqlQuery = " UPDATE BaseContactDetails "
                              + "    SET NewComment = 1 "
                              + "  WHERE (Enabled = 1) "
                              + "        AND (IsNew = 0) "
                              + "        AND (ContactId = '" + contactDetailsEntity.ContactId + "') "
                              + "        AND (ID <> '" + detailsId + "')";

            returnValue += DbHelper.ExecuteNonQuery(sqlQuery);
            BaseContactManager contactManager = new BaseContactManager(DbHelper, UserInfo);
            BaseContactEntity  contactEntity  = contactManager.GetEntity(contactDetailsEntity.ContactId);

            // 更新主表状态,评论人、评论时间发布上去
            contactEntity.CommentDate         = DateTime.Now;
            contactEntity.CommentUserId       = UserInfo.Id;
            contactEntity.CommentUserRealName = UserInfo.RealName;
            returnValue += contactManager.Update(contactEntity);
            return(returnValue);
        }