⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set_score.aspx.cs

📁 基于WEB的在线考试系统建立在系统后台的数据库的基础上
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Teacher_Set_Score : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    private void DataBand()
    {
        int SubjectID = Convert.ToInt32(Subject.SelectedValue.ToString());
        int TypeID = Convert.ToInt32(TopicType.SelectedValue.ToString());
        BLL.Teacher.CommonOp cp = new BLL.Teacher.CommonOp();
        DataSet dd = cp.get_Data_ForSetScore(SubjectID, TypeID);
        DataInfo.DataSource = dd.Tables["dd"].DefaultView;
        DataInfo.DataKeyNames = new string[] { "ID" };
        totalNumber.Text = dd.Tables["dd"].Rows.Count.ToString();
        DataInfo.DataBind();

    }
    protected void Ok_Click(object sender, EventArgs e)
    {
        Resub.Enabled = true;
        Ok.Enabled = false;
        Subject.Enabled = false;
        TopicType.Enabled = false;
        UpdatePanel1.Visible = true;
        DataBand();
    }
    protected void DataInfo_RowEditing(object sender, GridViewEditEventArgs e)
    {
        
        DataInfo.EditIndex = e.NewEditIndex;
        DataBand();
    }
    protected void DataInfo_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        DataInfo.EditIndex = -1;
       
        DataBand();
    }
    protected void DataInfo_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int ID = int.Parse(DataInfo.DataKeys[e.RowIndex]["ID"].ToString());
        if (PageCommon.VldInt(((TextBox)DataInfo.Rows[e.RowIndex].Cells[3].FindControl("getscore")).Text.ToString()))
        {
            int Getscore = int.Parse(((TextBox)DataInfo.Rows[e.RowIndex].Cells[3].FindControl("getscore")).Text.ToString());
            BLL.Teacher.CommonOp op = new BLL.Teacher.CommonOp();
            op.set_Score_ForTopic(ID, Getscore, int.Parse(TopicType.SelectedValue.ToString()));

            DataInfo.EditIndex = -1;
            DataBand();

            
        }
        else
        {
            DataInfo.EditIndex = -1;
            DataBand();
            return;
        
        }
    }
    protected void Resub_Click(object sender, EventArgs e)
    {
        Ok.Enabled = true;
        Resub.Enabled = false;
        Subject.Enabled = true;
        TopicType.Enabled = true;
        UpdatePanel1.Visible = false;
    }
}

⌨️ 快捷键说明

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