protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int docID = Convert.ToInt32(Request.QueryString["docID"]); Doc dc = new Doc(); dc.Docload(docID); txtTitle.Text = dc.docTitle; Assess ass = new Assess(); DataSet ds = new DataSet(); ds = ass.Loadassess(docID); GridView1.DataSource = ds.Tables[0].DefaultView; GridView1.DataBind(); } if (ddlState.SelectedValue != "21") { RequiredFieldValidator1.Enabled = true; } else { //5&1&a&s&p&x RequiredFieldValidator1.Enabled = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string expert = Request.Cookies["userID"].Value.ToString(); int docID = Convert.ToInt32(Request.QueryString["docID"]); Doc dc = new Doc(); dc.Docload(docID); Label1.Text = dc.docTitle; DataRow dr = dc.viewassess(expert, docID); lblAssessment.Text = dr[0].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int docID = Convert.ToInt32(Request.QueryString["docID"]); Doc dc = new Doc(); dc.Docload(docID); txtTitle.Text = dc.docTitle; txtAbstract.Text = dc.docAbstract; txtKeyword.Text = dc.docKeywords; txtLetters.Text = dc.docLetters.ToString(); txtAuthorInfo.Text = dc.docAuthor; } }
protected void Bt_upload_Click(object sender, EventArgs e) { int docID = Convert.ToInt32(Request.QueryString["docID"]); if (FileUpload1.HasFile) { string name = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString(); string type = FileUpload1.FileName.Substring(FileUpload1.FileName.LastIndexOf(".") + 1); //获取上传文件的后缀 string filename = name + "." + type; if (type == "doc") { if (FileUpload1.FileName != "") { String path = Server.MapPath("~/upfiles/" + filename); FileUpload1.PostedFile.SaveAs(path); Attach attach = new Attach(); attach.Delete(docID); Hashtable ht = new Hashtable(); ht.Add("attachFilename", SQLString.GetQuotedString(FileUpload1.FileName)); ht.Add("attachName", SQLString.GetQuotedString(filename)); ht.Add("docID", SQLString.GetQuotedString(Convert.ToString(docID))); attach.Add(ht); Doc dc = new Doc(); dc.Docload(docID); string docState = dc.docState; string state = ""; if (docState == "12") { state = "11"; } if (docState == "22") { state = "25"; } dc.Update_attach(docID, state); } Response.Write("<script language='javascript'>alert('上传成功!');window.location='modifylist.aspx'</script>"); } else { Response.Write("<script language='javascript'>alert('对不起,目前只接受.doc格式文档,请重新上传!')</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Doc dc = new Doc(); int id = Convert.ToInt32(Request.QueryString["docID"]); dc.Docload(id); lbldocTitle.Text = dc.docTitle; Assess ass = new Assess(); DataSet ds = new DataSet(); ds = ass.Loadassess(Convert.ToInt32(Request.QueryString["docID"])); GridView1.DataSource = ds.Tables[0].DefaultView; GridView1.DataBind();//5*1*a*s*p*x } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int docID = Convert.ToInt32(Request.QueryString["docID"]); Doc dc = new Doc(); dc.Docload(docID); txtTitle.Text = dc.docTitle; txtAbstract.Text = dc.docAbstract; txtKeyword.Text = dc.docKeywords; txtLetters.Text = dc.docLetters.ToString(); txtAuthorInfo.Text = dc.docAuthor; } if (DropDownList1.SelectedValue != "11") { CheckBoxList1.Visible = false; RequiredFieldValidator1.Enabled = true; } else { CheckBoxList1.Visible = true; RequiredFieldValidator1.Enabled = false; } }