ExaminationDAL/TbScoreService.cs
(开头部分) 13KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using ExaminationModels;
namespace ExaminationDAL
{
public class TbScoreService
{
/// <summary>
/// 添加成绩返回新添加信息成绩ID
/// </summary>
/// <param name="Ts">成绩表对象</param>
/// <returns></returns>
public int AddScore(TbScore Ts)
{
string sql = "insert into tbScore (KgtID,DxtScore,DuoxtScore,PdtScore,ZgtScore,Zt) values(@KgtID,@DxtScore,@DuoxtScore,@PdtScore,@ZgtScore,@Zt);select @@IDENTITY";
SqlParameter[] sqle = new SqlParameter[]
{
new SqlParameter("@KgtID",Ts.KgtID),
new SqlParameter("@DxtScore",Ts.DxtScore),
new SqlParameter("@DuoxtScore",Ts.DuoxtScore),
new SqlParameter("@PdtScore",Ts.PdtScore),
new SqlParameter("@ZgtScore",Ts.ZgtScore),
new SqlParameter("@Zt",Ts.Zt)
};
return DBHelper.GetScalar(sql, sqle);
}
/// <summary>
/// 更新成绩表信息返回受影响行数
/// </summary>
/// <param name="Ts"></param>
/// <returns></returns>
public int UpdScroe(TbScore Ts)
{
Ts.ZgtScore = 0;
string sql = "update tbScore set DxtScore=@DxtScore,DuoxtScore=@DuoxtScore,PdtScore=@PdtScore,ZgtScore=@ZgtScore,Zt=@Zt where CjID=@CjID or KgtID=@KgtID";
SqlParameter[] sqle = new SqlParameter[]
{
new SqlParameter("@DxtScore",Ts.DxtScore),
new SqlParameter("@DuoxtScore",Ts.DuoxtScore),
new SqlParameter("@PdtScore",Ts.PdtScore),
new SqlParameter("@ZgtScore",Ts.ZgtScore),
new SqlParameter("@Zt",Ts.Zt),
new SqlParameter("@CjID",Ts.CjID),
new SqlParameter("@KgtID",Ts.KgtID)
};
int OK = DBHelper.ExecuteCommand(sql, sqle);
return OK;
}
/// <summary>
/// 更新成绩表分数主观题信息返回受影响行数
/// </summary>
/// <param name="Defen"></param>
/// <param name="Zt"></param>
后面还有 250 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
