protected void BtnOk_Click(object sender, EventArgs e) { Business.correcting correcting = new Business.correcting(); Business.correctingData correctingdata = new Business.correctingData(); correctingdata.hwtit = hwtit.Text; correctingdata.userid = userid.Text; correctingdata.ctime = ctime.Text; correctingdata.ccon = ccon.Text; correctingdata.ter = ter.Text; correctingdata.cdate = cdate.Text; correctingdata.scores = scores.Text; correctingdata.messages = messages.Text; if (Request.QueryString["id"] != null) { correctingdata.Id = Request.QueryString["id"]; correcting.Modify(correctingdata); } else { correcting.Insert(correctingdata); } Response.Redirect("correctingtb.aspx"); correcting = null; correctingdata = null; }
protected void Button1_Click(object sender, EventArgs e) { if (userid.Value == "") { Response.Write("<script>alert('请填写你的学号姓名!')</script>"); } else { Business.correcting correcting = new Business.correcting(); Business.correctingData correctingdata = new Business.correctingData(); string ccon = ""; foreach (RepeaterItem ri in Repeater1.Items) { Label key = (Label)ri.FindControl("Label1"); TextBox value = (TextBox)ri.FindControl("TextBox1"); ccon += "题目:" + key.Text + "<br/>答案:" + value.Text + "<br/>"; } correctingdata.hwtit = Label2.Text; correctingdata.userid = userid.Value; correctingdata.ctime = DateTime.Now.ToString(); correctingdata.ccon = ccon; correctingdata.ter = ""; correctingdata.cdate = ""; correctingdata.scores = ""; correctingdata.messages = ""; correcting.Insert(correctingdata); Response.Redirect("correctingtb.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { Business.correcting correcting = new Business.correcting(); correcting.Update(Request.QueryString["id"], Text2.Value, Text3.Value); Response.Redirect("tercorrectingtb.aspx"); correcting = null; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Business.correcting correcting = new Business.correcting(); Repeater1.DataSource = correcting.Get(string.Format(" and userid ='{0}'", (string)Session["UserId"])); Repeater1.DataBind(); correcting = null; } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { string Id = e.CommandName; Business.correcting correcting = new Business.correcting(); correcting.Delete(Id); Repeater1.DataSource = correcting.Get(""); Repeater1.DataBind(); correcting = null; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Business.correcting correcting = new Business.correcting(); Repeater1.DataSource = correcting.Get(""); Repeater1.DataBind(); correcting = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if ((string)Session["UserType"] == "老师") { Business.correcting correcting = new Business.correcting(); Repeater1.DataSource = correcting.Get(""); Repeater1.DataBind(); correcting = null; } else { Response.Redirect("login.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["id"] != null) { Business.correcting correcting = new Business.correcting(); Business.correctingData[] correctingdata = correcting.Select(Request.QueryString["id"]); Label1.Text = correctingdata[0].userid; Label2.Text = correctingdata[0].ctime; Label3.Text = correctingdata[0].ccon; correcting = null; correctingdata = null; } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["id"] != null) { Business.correcting correcting = new Business.correcting(); Business.correctingData[] correctingdata = correcting.Select(Request.QueryString["id"]); hwtit.Text = correctingdata[0].hwtit; userid.Text = correctingdata[0].userid; ctime.Text = correctingdata[0].ctime; ccon.Text = correctingdata[0].ccon; ter.Text = correctingdata[0].ter; cdate.Text = correctingdata[0].cdate; scores.Text = correctingdata[0].scores; messages.Text = correctingdata[0].messages; correcting = null; correctingdata = null; } } }