コード例 #1
0
ファイル: News.aspx.cs プロジェクト: dsbissett/chonet
    private void LoadTinTuc(int tintucid)
    {
        try
        {
            TinTuc tt = new TinTuc();
            DataSet ds = tt.SelectByID(tintucid);

            if (ds.Tables[0].Rows.Count > 0)
            {
                lblTieuDe.Text = ds.Tables[0].Rows[0]["tieude"].ToString();
                if (ds.Tables[0].Rows[0]["anh"] != null)
                {
                    spnImage.InnerHtml = "<br><br><img width=\"200px\" src=\"" + ds.Tables[0].Rows[0]["anh"]
                                         + "\" border=\"0\" /><br>";
                }

                spnTinTuc.InnerHtml = "<br>" +
                                      "<div>" + ds.Tables[0].Rows[0]["NoiDung"] + "</div>";
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("../message.aspx?msg=" + ex.ToString().Replace("\r\n", " "));
        }
    }
コード例 #2
0
ファイル: AddNews.aspx.cs プロジェクト: dsbissett/chonet
    private void LoadData(string Id)
    {
        try
        {
            TinTuc tt = new TinTuc();
            DataSet ds = tt.SelectByID(Convert.ToInt32(Id));

            if (ds.Tables[0].Rows.Count > 0)
            {
                txtTieuDe.Text = ds.Tables[0].Rows[0]["TieuDe"].ToString();
                txtTomTat.Text = ds.Tables[0].Rows[0]["TomTat"].ToString();
                wheNoiDung.Text = ds.Tables[0].Rows[0]["NoiDung"].ToString();
                imgAnhChinh.ImageUrl = "." + ds.Tables[0].Rows[0]["Anh"];
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }