admin/DaoRuChengJi.aspx.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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.Xml.Linq;
using System.Data.OleDb;
public partial class admin_DaoRuChengJi : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
string dbconn = "";
protected void Button1_Click(object sender, EventArgs e)
{
string path = DaoRu();
if (path != "")
{
dbconn = GetConn.ReConn(path);
try
{
DaoRuScore();
AddDanXuan();
AddDuoXuan();
Response.Write("<script>alert('导入成功');</script>");
}
catch
{
Response.Write("导入失败");
}
}
}
private void DaoRuScore()
{
string sql = "select * from tb_score";
DataTable dt = Exam.OleDbHelper.ExecuteDataset(dbconn, CommandType.Text, sql).Tables[0];
if (dt != null && dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if (IsExit("select count(1) from tb_score where studentid='" + dt.Rows[i]["studentid"].ToString() + "' and paperId=" + dt.Rows[i]["paperId"].ToString() + "") == 0)
{
string insql = "insert into tb_score(StudentID,LessonName,score,StudentName,Examtype,paperName,paperID) values('" + dt.Rows[i]["studentid"].ToString() + "','" + dt.Rows[i]["LessonName"].ToString() + "'," + dt.Rows[i]["score"].ToString() + ",'" + dt.Rows[i]["StudentName"].ToString() + "','" + dt.Rows[i]["Examtype"].ToString() + "','" + dt.Rows[i]["paperName"].ToString() + "','" + dt.Rows[i]["paperID"].ToString() + "');Select @@IDENTITY;";
string sqlid = Exam.SqlHelper.ExecuteScalar(BaseClass.DBCon(), CommandType.Text, insql).ToString();
OleDbConnection olconn = new OleDbConnection(dbconn);
olconn.Open();
string dbsql1 = "update DanXuan_DanAn set cjid=" + sqlid + " where cjid=" + dt.Rows[i]["ID"].ToString() + "";
OleDbCommand olcomm = new OleDbCommand(dbsql1, olconn);
olcomm.ExecuteNonQuery();
string dbsql2 = "update DuoXuan_DaAn set cjid=" + sqlid + " where cjid=" + dt.Rows[i]["ID"].ToString() + "";
OleDbCommand olcomm1 = new OleDbCommand(dbsql2, olconn);
后面还有 71 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
