private void Bind()
        {
            if (!Id.Equals(Guid.Empty))
            {
                Page.Title = "编辑话题";

                TopicSubject bll = new TopicSubject();
                DataSet      ds  = bll.GetModelOW(Id);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    txtTitle.Value            = dt.Rows[0]["Title"].ToString();
                    txtContent.Value          = dt.Rows[0]["ContentText"].ToString();
                    imgSinglePicture.Src      = dt.Rows[0]["PictureId"] is DBNull ? "../../Images/nopic.gif" : string.Format("{0}{1}/PC/{1}_1{2}", dt.Rows[0]["FileDirectory"], dt.Rows[0]["RandomFolder"], dt.Rows[0]["FileExtension"]);
                    hImgSinglePictureId.Value = dt.Rows[0]["PictureId"].ToString();
                    //UserId.Value = dt.Rows[0]["UserId"].ToString();
                    hId.Value   = Id.ToString();
                    isTop.Value = Request["isTop"];
                    if (Convert.ToBoolean(dt.Rows[0]["IsDisable"]))
                    {
                        rdFalse.Checked = false;
                        rdTrue.Checked  = true;
                    }
                    else
                    {
                        rdFalse.Checked = true;
                        rdTrue.Checked  = false;
                    }
                }
            }
        }
示例#2
0
        private void Bind()
        {
            //查询条件
            GetSearchItem();

            int          totalRecords = 0;
            TopicSubject bll          = new TopicSubject();

            rpData.DataSource = bll.GetListOW(pageIndex, pageSize, out totalRecords, sqlWhere, parms == null ? null : parms.ToArray());
            rpData.DataBind();

            myDataAppend.Append("<div id=\"myDataForPage\" style=\"display:none;\">[{\"PageIndex\":\"" + pageIndex + "\",\"PageSize\":\"" + pageSize + "\",\"TotalRecord\":\"" + totalRecords + "\",\"QueryStr\":\"" + queryStr + "\"}]</div>");
        }