protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); try { //获取URL传递参数 string strMode = this.Request.QueryString["mode"] == null ? "" : this.Request.QueryString["mode"].ToString(); string strID = this.Request.QueryString["id"] == null ? "" : this.Request.QueryString["id"].ToString(); //设置控件状态 setControlStatus(strMode); // 获取页面数据信息 if (!strMode.Equals("") && !strMode.Equals("add") && !strID.Equals("")) { MasterDataBLL bll = new MasterDataBLL(); ERS.BulletinDataTable dt = bll.GetBulletinById(Convert.ToInt32(strID)); if (dt != null && dt.Count > 0) { ERS.BulletinRow dr = dt[0]; txtTitle.Text = dr.BulletinTitle.ToString(); lblCreator.Text = dr.Creator.ToString(); lblCreateTime.Text = dr.CreateTime.ToString(); txtContent.Text = dr.BulletinContent.ToString(); } } } catch (Exception ex) { PageUtility.DealWithException(this, ex); } }
protected void BulletinGridView_RowDataBound(object sender, GridViewRowEventArgs e) { // 对数据列进行赋值 if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit) { DataRowView drvDetail = (DataRowView)e.Row.DataItem; ERS.BulletinRow row = (ERS.BulletinRow)drvDetail.Row; HyperLink TitleLink = (HyperLink)e.Row.Cells[0].FindControl("TitleLink"); TitleLink.NavigateUrl = "javascript:window.showModalDialog('" + System.Configuration.ConfigurationManager.AppSettings["WebSiteUrl"] + "/BulletinDetail.aspx?ObjectId=" + row.BulletinId + "','', 'dialogWidth:836px;dialogHeight:638px;resizable:yes;')"; } } }
protected void BindData(LinkButton button) { GridViewRow gvr = (GridViewRow)button.Parent.Parent; int selectID = Convert.ToInt32(BulletinGridView.DataKeys[gvr.RowIndex].Value); this.EditID.Text = selectID.ToString(); ERS.BulletinRow bulletin = ms.GetBulletinById(selectID)[0]; string name = button.ID; this.EditBulletinTitleTextBox.Text = bulletin.BulletinTitle; this.EditBulletinContentTextBox.Text = bulletin.BulletinContent; this.EditIsActiveCheckBox.Checked = bulletin.IsActive; this.EditIsHotCheckBox.Checked = bulletin.IsHot; if (!bulletin.IsAttachFileNameNull()) { this.EditUCFileUpload.AttachmentFileName = bulletin.AttachFileName; } else { this.EditUCFileUpload.AttachmentFileName = null; } if (!bulletin.IsRealAttachFileNameNull()) { this.EditUCFileUpload.RealAttachmentFileName = bulletin.RealAttachFileName; } else { this.EditUCFileUpload.RealAttachmentFileName = null; } if (name == "TitleCtl") { EditBulletinTitleTextBox.ReadOnly = true; EditBulletinContentTextBox.ReadOnly = true; EditIsHotCheckBox.Enabled = false; EditIsActiveCheckBox.Enabled = false; tr1.Visible = false; this.EditUCFileUpload.IsView = true; } if (name == "EditBtn") { show(); } this.Opdiv.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { this.Page.Title = "ϵͳ¹«¸æ"; MasterDataBLL bll = new MasterDataBLL(); ERS.BulletinRow bulletin = bll.GetBulletinById(int.Parse(Request["ObjectId"]))[0]; this.BulletinTitleLabel.Text = bulletin.BulletinTitle; this.BulletinContentCtl.Text = bulletin.BulletinContent; this.CreateTimeLabel.Text = bulletin.CreateTime.ToString("yyyy-MM-dd"); if (!bulletin.IsAttachFileNameNull()) { this.ViewUCFileUpload.AttachmentFileName = bulletin.AttachFileName; } if (!bulletin.IsRealAttachFileNameNull()) { this.ViewUCFileUpload.RealAttachmentFileName = bulletin.RealAttachFileName; } }