Web/Admin/Paper/AddPaperByRandomSelection.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;

using Entity;
using BLL;

public partial class Admin_Paper_AddPaperByRandomSelection : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RoleCheck.DenyLogin();
        string sql = "select * from T_Department where deptName<>'管理员'";
        DataSet ds = SqlHelper.ExecuteDataSet(sql);
        drlDeptList.DataTextField = "deptName";
        drlDeptList.DataValueField = "deptID";
        drlDeptList.DataSource = ds.Tables[0].DefaultView;
        drlDeptList.DataBind();
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            PaperByRandomSelection paper = new PaperByRandomSelection();
            paper.JudgeSum = Convert.ToInt32(txtJudgeSum.Text);
            paper.SingleSelectionSum = Convert.ToInt32(txtSingleSelectionSum.Text);
            paper.MultiSelectionSum = Convert.ToInt32(txtMultiSelectionSum.Text);
            paper.PaperName = txtPaperName.Text;
            paper.PaperType.DeptID = Convert.ToInt16(drlDeptList.SelectedValue);
            paper.PaperType.DeptName = drlDeptList.SelectedItem.Text;
            paper.Creator = SessionClass.GetLoginUser();
            paper.CreatedTime = DateTime.Now;
            paper.JudgeCateID = Convert.ToInt32(drpSubjectTypeCategory1.SelectedValue);
            paper.SingleSelectionCateID = Convert.ToInt32(drpSubjectTypeCategory2.SelectedValue);
            paper.MultiSelectionCateID = Convert.ToInt32(drpSubjectTypeCategory3.SelectedValue);

            if (paper.JudgeSum > Convert.ToInt32(Label1.Text))
            {
                lblMsg.Text = "判断题数量不能超过" + Label1.Text + "题";
                return;
            }

            if (paper.SingleSelectionSum > Convert.ToInt32(Label2.Text))
            {
                lblMsg.Text = "单选题数量不能超过" + Label2.Text + "题";
                return;
            }
            if (paper.MultiSelectionSum > Convert.ToInt32(Label3.Text))
            {
                lblMsg.Text = "多选题数量不能超过" + Label3.Text + "题";
                return;
后面还有 27 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。