Example #1
0
        private void MyBind()
        {
            M_User_Plat upMod = upBll.SelByNameAndPwd(uname, upwd, true);

            if (upMod == null)
            {
                function.WriteErrMsg("您没有权限下载该用户的时间线记录!");
            }
            GroupDT = groupBll.SelByCompID(upMod.CompID);
            int       pageCount = 0;
            DataTable dt        = msgBll.SelByPid(50000, 1, out pageCount, 0, upMod, upMod.Gid, 0, Filter, MsgType, Skey, upMod.UserID.ToString(), DateStr, Mid);

            //-------------------针对时间线进行处理
            if (CPage > 1)
            {
                Page.FindControl("ttitle_div").Visible = false;
            }
            DateTime TimeLine = DateTime.MinValue;

            dt.Columns.Add("timeline", typeof(string));
            foreach (DataRow dr in dt.Rows)
            {
                if (TimeLine == DateTime.MinValue || DateHelper.IsMoreThanOne(TimeLine, Convert.ToDateTime(dr["cdate"])))
                {
                    TimeLine       = Convert.ToDateTime(dr["cdate"]);
                    dr["timeline"] = "date";
                }
                else
                {
                    dr["timeline"] = "time";
                }
            }
            MsgRepeater.DataSource = dt;
            MsgRepeater.DataBind();
        }