Пример #1
0
        protected void BindProClamationList()
        {
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            ///////绑定查询条件

            EyouSoft.Model.PersonalCenterStructure.NoticeNews sModel = new EyouSoft.Model.PersonalCenterStructure.NoticeNews();
            Titles      = EyouSoft.Common.Utils.GetQueryStringValue("Titles");
            OperateName = EyouSoft.Common.Utils.GetQueryStringValue("OperateName");
            if (EyouSoft.Common.Utils.GetQueryStringValue("IssueTime") == "")
            {
                sModel.IssueTime = null;
            }
            else
            {
                sModel.IssueTime = EyouSoft.Common.Utils.GetDateTime(EyouSoft.Common.Utils.GetQueryStringValue("IssueTime"));
                IssueTime        = sModel.IssueTime.Value.ToString("yyyy-MM-dd");
            }

            sModel.Title       = Titles;
            sModel.OperateName = OperateName;
            nBll               = new EyouSoft.BLL.CompanyStructure.News();
            newslist           = nBll.GetZuTuanAcceptNews(pageSize, pageIndex, ref recordCount, SiteUserInfo.CompanyID, sModel);
            len                = newslist.Count();
            rptList.DataSource = newslist;
            rptList.DataBind();
            newslist = null;
            BindPage();
        }
Пример #2
0
        /// <summary>
        /// 获取某个用户接收到的消息列表
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <param name="companydId">公司编号</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> GetAcceptNews(int PageSize, int PageIndex, ref int RecordCount, int userId, int companydId)
        {
            int deptId = 0;
            IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> lsNews = new List <EyouSoft.Model.PersonalCenterStructure.NoticeNews>();

            DbCommand cmd = this._db.GetSqlStringCommand(SQL_SELECT_DeptId);

            this._db.AddInParameter(cmd, "Id", DbType.Int32, userId);
            this._db.AddInParameter(cmd, "CompanyId", DbType.Int32, companydId);
            using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(cmd, this._db))
            {
                if (rdr.Read())
                {
                    deptId = rdr.IsDBNull(rdr.GetOrdinal("DepartId")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("DepartId"));
                }
            }

            string tableName     = "View_AceptNews";
            string primaryKey    = "ID";
            string orderByString = "IisuerTime DESC";
            string fields        = " ID, Title,Views,Iisuer,IisuerTime";

            StringBuilder cmdQuery = new StringBuilder(" IsDelete='0'");

            cmdQuery.AppendFormat(" and CompanyId = {1} and (AcceptId = {0} or AcceptType = 0)", deptId, companydId);

            using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(this._db, PageSize, PageIndex, ref RecordCount, tableName, primaryKey, fields, cmdQuery.ToString(), orderByString))
            {
                while (rdr.Read())
                {
                    EyouSoft.Model.PersonalCenterStructure.NoticeNews newInfo = new EyouSoft.Model.PersonalCenterStructure.NoticeNews();
                    newInfo.Id          = rdr.GetInt32(rdr.GetOrdinal("ID"));
                    newInfo.Title       = rdr.IsDBNull(rdr.GetOrdinal("Title")) ? "" : rdr.GetString(rdr.GetOrdinal("Title"));
                    newInfo.ClickNum    = rdr.IsDBNull(rdr.GetOrdinal("Views")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("Views"));
                    newInfo.OperateName = rdr.IsDBNull(rdr.GetOrdinal("Iisuer")) ? "" : rdr.GetString(rdr.GetOrdinal("Iisuer"));
                    newInfo.IssueTime   = rdr.GetDateTime(rdr.GetOrdinal("IisuerTime"));

                    lsNews.Add(newInfo);
                }
            }

            return(lsNews);
        }
Пример #3
0
        /// <summary>
        /// 获取组团端消息
        /// </summary>
        /// <returns></returns>
        public IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> GetZuTuanAcceptNews(int PageSize, int PageIndex, ref int RecordCount, int CompanyId, EyouSoft.Model.PersonalCenterStructure.NoticeNews SearchModel)
        {
            IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> lsNews = new List <EyouSoft.Model.PersonalCenterStructure.NoticeNews>();

            EyouSoft.Model.PersonalCenterStructure.NoticeNews model = null;
            string        tableName     = "View_AceptNews";
            string        primaryKey    = "ID";
            string        orderByString = "IisuerTime DESC";
            string        fields        = " ID, Title,Views,Iisuer,IisuerTime";
            StringBuilder cmdQuery      = new StringBuilder();

            cmdQuery.AppendFormat(" AcceptType = 2 and IsDelete = '0' and CompanyId={0}", CompanyId);
            if (SearchModel != null)
            {
                if (!String.IsNullOrEmpty(SearchModel.Title))
                {
                    cmdQuery.AppendFormat(" AND Title like '%{0}%' ", SearchModel.Title);
                }
                if (!String.IsNullOrEmpty(SearchModel.OperateName))
                {
                    cmdQuery.AppendFormat(" AND Iisuer='{0}' ", SearchModel.OperateName.Trim());
                }
                if (SearchModel.IssueTime.HasValue && SearchModel.IssueTime != DateTime.MinValue)
                {
                    cmdQuery.AppendFormat(" AND  DATEDIFF(DAY,'{0}',IisuerTime)=0", SearchModel.IssueTime);
                }
            }
            using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(this._db, PageSize, PageIndex, ref RecordCount, tableName, primaryKey, fields, cmdQuery.ToString(), orderByString))
            {
                while (rdr.Read())
                {
                    model             = new EyouSoft.Model.PersonalCenterStructure.NoticeNews();
                    model.Id          = rdr.GetInt32(rdr.GetOrdinal("ID"));
                    model.Title       = rdr.IsDBNull(rdr.GetOrdinal("Title")) ? "" : rdr.GetString(rdr.GetOrdinal("Title"));
                    model.OperateName = rdr.IsDBNull(rdr.GetOrdinal("Iisuer")) ? "" : rdr.GetString(rdr.GetOrdinal("Iisuer"));
                    model.IssueTime   = rdr.GetDateTime(rdr.GetOrdinal("IisuerTime"));
                    lsNews.Add(model);
                }
            }

            return(lsNews);
        }
Пример #4
0
        /// <summary>
        /// 获取组团端消息
        /// </summary>
        /// <returns></returns>
        public IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> GetZuTuanAcceptNews(int CompanyId)
        {
            IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> lsNews = new List <EyouSoft.Model.PersonalCenterStructure.NoticeNews>();

            EyouSoft.Model.PersonalCenterStructure.NoticeNews model = null;

            DbCommand cmd = this._db.GetSqlStringCommand(String.Format(SQL_SELECR_ZuTuanNews, CompanyId));

            using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(cmd, this._db))
            {
                while (rdr.Read())
                {
                    model             = new EyouSoft.Model.PersonalCenterStructure.NoticeNews();
                    model.Id          = rdr.GetInt32(rdr.GetOrdinal("ID"));
                    model.Title       = rdr.IsDBNull(rdr.GetOrdinal("Title")) ? "" : rdr.GetString(rdr.GetOrdinal("Title"));
                    model.ClickNum    = rdr.IsDBNull(rdr.GetOrdinal("Views")) ? 0 : rdr.GetInt32(rdr.GetOrdinal("Views"));
                    model.OperateName = rdr.IsDBNull(rdr.GetOrdinal("Iisuer")) ? "" : rdr.GetString(rdr.GetOrdinal("Iisuer"));
                    model.IssueTime   = rdr.GetDateTime(rdr.GetOrdinal("IisuerTime"));
                    lsNews.Add(model);
                }
            }

            return(lsNews);
        }
Пример #5
0
 /// <summary>
 /// 获取组团端消息
 /// </summary>
 /// <returns></returns>
 public IList <EyouSoft.Model.PersonalCenterStructure.NoticeNews> GetZuTuanAcceptNews(int PageSize, int PageIndex, ref int RecordCount, int CompanyId, EyouSoft.Model.PersonalCenterStructure.NoticeNews SearchModel)
 {
     return(Dal.GetZuTuanAcceptNews(PageSize, PageIndex, ref RecordCount, CompanyId, SearchModel));
 }