protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["NguoiDung_MonHocid"] != null && Request.QueryString["NguoiDung_MonHocid"] != "") { divAnnouce.InnerHtml = ""; int NguoiDung_MonHocID = -1; if (int.TryParse(Request.QueryString["NguoiDung_MonHocid"].ToString().Trim(), out NguoiDung_MonHocID)) { if (Request.QueryString["bodeid"] != null && Request.QueryString["bodeid"] != "") { int BoDeID = -1; if (int.TryParse(Request.QueryString["bodeid"].ToString().Trim(), out BoDeID)) { DataTable dtMaDe = data.dnn_NuceThi_DeThi.getMa(BoDeID); ddlMaDe.DataSource = dtMaDe; ddlMaDe.DataTextField = "Ma"; ddlMaDe.DataValueField = "DeThiID"; ddlMaDe.DataBind(); if (dtMaDe.Rows.Count > 0) { string strDeThiID = dtMaDe.Rows[0]["DeThiID"].ToString(); ddlMaDe.SelectedValue = strDeThiID; divContent.InnerHtml = UtilsDisplayDe.displayDe(strDeThiID, ddlMaDe.SelectedItem.Text, this.PortalId); } } else { Response.Redirect(string.Format("/tabid/{0}/default.aspx?NguoiDung_MonHocid={1}", this.TabId, NguoiDung_MonHocID)); } } else { Response.Redirect(string.Format("/tabid/{0}/default.aspx?NguoiDung_MonHocid={1}", this.TabId, NguoiDung_MonHocID)); } } else { Response.Redirect(string.Format("/tabid/{0}/default.aspx", this.TabId)); } } else { Response.Redirect(string.Format("/tabid/{0}/default.aspx", this.TabId)); } } }
protected void ProcessDeThi() { string strDeThiID = Request.QueryString["dethiid"]; string strMaDe = Request.QueryString["made"]; int PortalID = int.Parse(Request.QueryString["portalid"]); string strHtml = UtilsDisplayDe.displayDe(strDeThiID, strMaDe, PortalID); Response.Clear(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=" + "PDFfile.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); //strHtml= "<font face='arial unicode ms'>Hoàng Nam Thắng</font>"; //strHtml += "<div><font face='arial unicode ms'>Thử coi thế nào</font></div>"; Response.BinaryWrite(GetPDF(strHtml)); Response.End(); }
protected void btnShow_Click(object sender, EventArgs e) { divContent.InnerHtml = UtilsDisplayDe.displayDe(ddlMaDe.SelectedValue, ddlMaDe.SelectedItem.Text, this.PortalId); //displayDe(ddlMaDe.SelectedValue); }