submitpaper.ashx

来自「本在线考试系统采用了面向对象的分析和设计」· ASHX 代码 · 共 37 行

ASHX
37
字号
<%@ WebHandler Language="C#" Class="SubmitPaper" %>

using System;
using System.Web;
using ExaminationSystem.BLL.Domain;
using ExaminationSystem.BLL.Service;

public class SubmitPaper : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {

        try
        {
           
            Student student = new StudentService().GetById(long.Parse(context.Request.Form["ID"].ToString()));
             //保存试卷
            PaperHelper.SaveAnswer(context);
            //交卷

            new ExaminationService().SubmitPaper(student);
      
            context.Response.Write("交卷成功!");

        }
        catch (Exception e)
        {
            context.Response.Write(e.Message);
        } 
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?