コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string str = Request.QueryString["str"];
     bool i = new QuestionsManage().Question(str);
     this.Response.ContentType = "xml";
     this.Response.Write("<?xml version='1.0' encoding='utf-8' ?>" + "\n");
     this.Response.Write("<root><Response>" + ((i==true)?"Yes":"No") + "</Response></root>");
 }
コード例 #2
0
 protected void Confirm_Click(object sender, EventArgs e)
 {
     string answer = AnswerText.Text.Trim();
     bool i = new QuestionsManage().Answer(qid, answer);
     if (i ==true)
         Response.Redirect("QAManage.aspx");
     Response.Write("<script language=javascript>alert('操作失败!请重试或联系管理员')</script>");
     QuestionRepeater.DataSource = new QuestionsManage().QueryOneQuestion(qid);
     QuestionRepeater.DataBind();
 }
コード例 #3
0
 protected void Delete_Command(object sender, CommandEventArgs e)
 {
     string qid = e.CommandArgument.ToString();
     bool i = new QuestionsManage().Delete(qid);
     if (i==true)
     {
         Response.Write("<script language=javascript>alert('删除成功!')</script>");
         UnAnsRepeater.DataSource = new QuestionsManage().QueryQuestionsWithoutAnswer();
     UnAnsRepeater.DataBind();
     AnsRepeater.DataSource = new QuestionsManage().QueryQuestionsWithAnswer();
     AnsRepeater.DataBind();
     }
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     pix = Request.QueryString["pix"];
     if (pix == null)
         pix = "1";
     QuestionRepeater.DataSource = new QuestionsManage().FormRepeater(new QuestionsManage().QueryQuestionsWithAnswer(), Int32.Parse(pix), 10);
     QuestionRepeater.DataBind();
     int num = new QuestionsManage().QueryQuestionsWithAnswer().Rows.Count;
     int pagecount = 0;
     if (num % 10 == 0)
         pagecount = num / 10;
     else pagecount = num / 10 + 1;
     pageIndicator.Columns.Add("pageIndex");
     for (int i = 0; i < pagecount; i++)
     {
         pageIndicator.Rows.Add();
         pageIndicator.Rows[i]["pageIndex"] = (i + 1).ToString();
     }
     PageIndicatorRepeater.DataSource = pageIndicator;
     PageIndicatorRepeater.DataBind();
     NewQuestion.Attributes.Add("onclick", "clearText()");
     NewQuestion.Attributes.Add("onblur", "recoveryText()");
 }