/// <summary> /// 修正链接 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void fixUrl(object sender, EventArgs e) { HyperLink hl = (HyperLink)sender; NoteEntity ne = NoteOperation.GetNote(int.Parse(hl.NavigateUrl)); hl.NavigateUrl = string.Format("../loadnotes.aspx?startline={0}&cid={1}&isDing=2", ne.StartLine, ne.Cid); }
/// <summary> /// Page_Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = int.Parse(Request.QueryString["id"].ToString()); NoteEntity ne = NoteOperation.GetNote(int.Parse(Request.QueryString["id"].ToString())); if (ne != null) { DataBase db = new DataBase(); DataSet sql = db.ExCommand(string.Format("SELECT tb_note.id, tb_note.noteName, tb_note.upTime, tb_note.cid, tb_note.uid, tb_user.userName, tb_code.path FROM tb_user INNER JOIN tb_note ON tb_user.id = tb_note.uid INNER JOIN tb_code ON tb_note.cid = tb_code.id WHERE (tb_note.id ={0} ) ", id)); string User = sql.Tables[0].Rows[0]["userName"].ToString(); string Path = sql.Tables[0].Rows[0]["path"].ToString(); //在表单中显示数据 lb_NoteName.Text = ne.NoteName; lb_Id.Text = ne.Id.ToString(); lb_Path.Text = Path; lb_User.Text = User; lb_UpTime.Text = ne.UpTime.ToString(); } } }