App_Code/StudentMgr.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Data.SqlClient;
/// <summary>
/// Student管理类
/// </summary>
public class StudentMgr
{
/// <summary>
/// 初始化管理类
/// </summary>
public StudentMgr()
{
}
#region 函数UpdateStudent | 更新Student信息
/// <summary>
/// 更新Student类信息
/// </summary>
/// <param name="student">学生类参数</param>
/// <param name="IsNew">是否为新增学生1为是,0为否</param>
/// <returns>更新成功返回true 否则返回false</returns>
public bool UpdateStudent(Student student,int IsNew)
{
string strSQL = "";
SqlDataAdapter sa = null;
SqlCommandBuilder builder = null;
DataRow row = null;
DataTable dt = null;
bool returnValue = false;
if (student != null)
{
if (IsNew == 1)
{
strSQL = "SELECT Top 0 * FROM Experiment_Student";
}
else
{
strSQL = "SELECT * FROM Experiment_Student WHERE StudentID = " + student.StudentID.ToString();
}
dt = CMMgr.GetDataTable(strSQL);
if (IsNew == 0)
{
row = dt.Rows[0];
}
else
{
row = dt.NewRow();
}
row["StudentID"] = student.StudentID;
row["StudentName"] = student.StudentName;
row["Sex"] = student.Sex;
row["Password"] = student.Password;
if (IsNew == 1)
{
dt.Rows.Add(row);
后面还有 111 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。