protected void Button3_Click(object sender, EventArgs e) { BHomework bh = new BHomework(); Homework s = new Homework( sname, true ); bh.UpdateHomework2(s); BGrade bll = new BGrade(); bll.DeleteGrade(workname); Grade ge = new Grade( Convert.ToString(workname), Convert.ToString(sname), Convert.ToString(Label4.Text), Convert.ToString(Label3.Text), Convert.ToString(TextBox1.Text), Convert.ToString(TextBox2.Text), true, true, true, false, classid); if (Page.IsValid) { bll.InsertGrade(ge); Response.Write("<script>alert('提交成功!');location='Upwork.aspx'</script>"); } else { Response.Write("<script>alert('提交失败!');</script>"); } }
public void Update(GameTime gameTime) { int TimeLeft = Game.peach.PlayerStats.TimeRemainingGradeRoom; if (Game.level.DelayUpdate > 180 && TimeLeft > Constants.ZERO) { AGrade aGrade = new AGrade(Game.Content, Game.GraphicsDevice) { Location = new Vector2(randomLocation.Next(Constants.ZERO, 3000), 1900), Visible = true, Checkable = true }; BGrade bGrade = new BGrade(Game.Content, Game.GraphicsDevice) { Location = new Vector2(randomLocation.Next(Constants.ZERO, 3000), 1900), Visible = true, Checkable = true }; CGrade cGrade = new CGrade(Game.Content, Game.GraphicsDevice) { Location = new Vector2(randomLocation.Next(Constants.ZERO, 3000), 1900), Visible = true, Checkable = true }; DGrade dGrade = new DGrade(Game.Content, Game.GraphicsDevice) { Location = new Vector2(randomLocation.Next(Constants.ZERO, 3000), 1900), Visible = true, Checkable = true }; FGrade fGrade = new FGrade(Game.Content, Game.GraphicsDevice) { Location = new Vector2(randomLocation.Next(Constants.ZERO, 3000), 1900), Visible = true, Checkable = true }; aGrade.Sprite.Velocity = new Vector2(Constants.ZERO, randomVelocity.Next(100, 500)); bGrade.Sprite.Velocity = new Vector2(Constants.ZERO, randomVelocity.Next(100, 500)); cGrade.Sprite.Velocity = new Vector2(Constants.ZERO, randomVelocity.Next(100, 500)); dGrade.Sprite.Velocity = new Vector2(Constants.ZERO, randomVelocity.Next(100, 500)); fGrade.Sprite.Velocity = new Vector2(Constants.ZERO, randomVelocity.Next(100, 500)); Game.level.Entities.Add(aGrade); Game.level.Entities.Add(cGrade); Game.level.Entities.Add(dGrade); Game.level.Entities.Add(fGrade); Game.level.Entities.Add(bGrade); Collections.Instance.GetCollisionRef().ReRegister(aGrade); Collections.Instance.GetCollisionRef().ReRegister(bGrade); Collections.Instance.GetCollisionRef().ReRegister(cGrade); Collections.Instance.GetCollisionRef().ReRegister(dGrade); Collections.Instance.GetCollisionRef().ReRegister(fGrade); Game.level.DelayUpdate = Constants.ZERO; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "back") { string[] CommandArgumentValue = e.CommandArgument.ToString().Split(','); string sno = CommandArgumentValue[0]; string cname = CommandArgumentValue[1]; string workname = CommandArgumentValue[2]; BGrade bg = new BGrade(); Grade G = new Grade(workname, sno, cname, false); bg.UpdateGrade2(G); BHomework bh = new BHomework(); Homework h = new Homework(sno, false); if (Page.IsValid) { bh.UpdateHomework2(h); Response.Write("<script>alert('发回成功!');location='RemarkDone.aspx'</script>"); } else { Response.Write("<script>alert('发回失败!');</script>"); } } if (e.CommandName == "download") { string[] CommandArgumentValue = e.CommandArgument.ToString().Split(','); string cname = CommandArgumentValue[0]; string sname = CommandArgumentValue[1]; string workname = CommandArgumentValue[2]; string fileName = cname + sname + workname + ".rar"; string filePath = Server.MapPath("..//Student/upload/" + cname + sname + workname + ".rar"); System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath); if (fileInfo.Exists == true) { FileStream fs = new FileStream(filePath, FileMode.Open); byte[] bytes = new byte[(int)fs.Length]; fs.Read(bytes, 0, bytes.Length); fs.Close(); Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); Response.BinaryWrite(bytes); Response.Flush(); Response.End(); } else { Response.Write("<script>alert('下载失败,该学生(" + cname + sname + workname + ")未上传作业材料')</script>"); } } }
protected void Button1_Click(object sender, EventArgs e) { string tname = Session["tname"].ToString(); //string tname = Session ["tname"].ToString(); BGrade b = new BGrade(); Grade s = new Grade( workname, sno, cname, Convert.ToUInt32(TextBox1.Text), Convert.ToString(TextBox2.Text), true, tname ); if (Page.IsValid) { b.UpdateGrade(s); Response.Write("<script>alert('批阅成功!');location='RemarkDone.aspx'</script>"); } else { Response.Write("<script>alert('批阅失败!');</script>"); } }
protected void Button2_Click(object sender, EventArgs e) { BGrade bll = new BGrade(); Grade ge = new Grade( Convert.ToString(workname), Convert.ToString(sname), Convert.ToString(Label4.Text), Convert.ToString(Label3.Text), Convert.ToString(TextBox1.Text), Convert.ToString(TextBox2.Text), false, false, false, false, classid); if (Page.IsValid) { bll.InsertGrade(ge); Response.Write("<script>alert('暂存成功!');location='Upwork.aspx'</script>"); } else { Response.Write("<script>alert('暂存失败!');</script>"); } }