private void Bind() { //查询条件 GetSearchItem(); int totalRecords = 0; ActivitySubject bll = new ActivitySubject(); 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>"); }
private void Bind() { if (!Id.Equals(Guid.Empty)) { Page.Title = "编辑活动"; ActivitySubject bll = new ActivitySubject(); 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(); type.Value = dt.Rows[0]["ActivityType"].ToString(); startDate.Value = Convert.ToDateTime(dt.Rows[0]["StartDate"]).ToString("yyyy-MM-dd HH:mm"); endDate.Value = Convert.ToDateTime(dt.Rows[0]["EndDate"]).ToString("yyyy-MM-dd HH:mm"); 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(); txtSort.Value = dt.Rows[0]["Sort"].ToString(); txtMaxVoteCount.Value = dt.Rows[0]["MaxVoteCount"].ToString(); txtVoteMultiple.Value = dt.Rows[0]["VoteMultiple"].ToString(); txtMaxSignUpCount.Value = dt.Rows[0]["MaxSignUpCount"].ToString(); txtActualSignUpCount.Value = dt.Rows[0]["ActualSignUpCount"].ToString(); txtUpdateSignUpCount.Value = dt.Rows[0]["UpdateSignUpCount"].ToString(); hId.Value = Id.ToString(); if (Convert.ToBoolean(dt.Rows[0]["IsDisable"])) { rdFalse.Checked = false; rdTrue.Checked = true; } else { rdFalse.Checked = true; rdTrue.Checked = false; } } } }