Exemple #1
0
        protected void btnThemBaiViet_Click(object sender, EventArgs e)
        {
            int mbv = mabaiviet() + 1;

            try
            {
                bviet.Newsid      = mbv;
                bviet.Cateid      = int.Parse(ddlChuyenMuc.SelectedValue.ToString());
                bviet.Title       = txtTieuDe.Text;
                bviet.description = txtTomTat.Text;
                bviet.content     = fckNoiDung1.Value;
                bviet.username    = Session["username"].ToString();
                bviet.author      = txtTacGia.Text;

                bviet.picture    = fileHinhAnh.FileName.ToString();
                bviet.createdate = lblNgayDang.Text;
                bviet.link       = "";
                bviet.active     = 0;
                bviet.insert(bviet);
            }
            catch (Exception ex)
            {
                lblKetQua.Text = ex.Message.ToString();
            }
        }
Exemple #2
0
        protected void btnThemBai_Click(object sender, EventArgs e)
        {
            int mbv = mabaiviet() + 1;

            //Response.Write("<script language='javascript'>alert('" + mbv.ToString() + "')</script>");
            try
            {
                bviet.Newsid      = mbv;
                bviet.Cateid      = int.Parse(DropDownList1.SelectedValue.ToString());
                bviet.Title       = txtTieuDe.Text;
                bviet.description = txtMoTa.Text;
                bviet.content     = fckNoidung.Value;
                bviet.username    = Session["username"].ToString();
                bviet.author      = txtTacGia.Text;
                bviet.picture     = Label2.Text;
                bviet.createdate  = Label1.Text;
                bviet.link        = "";
                bviet.active      = 0;
                bviet.views       = 0;
                bviet.insert(bviet);
                LamMoi();
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message.ToString();
            }
        }