doctordal.cs
来自「不错的一个做的医院管理系统源码」· CS 代码 · 共 38 行
CS
38 行
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Youzi.DBUtility;
using Youzi.Model;
namespace Youzi.DAL
{
public class DoctorDAL
{
public DataSet SelectAll()
{
string sql = " select * from View_Doctor";
return SQLHelper.SelectAll(sql);
}
public int Insert(DoctorInfo entity)
{
string sql = "insert into Doctor values('" + entity.DoctorName + "','" + entity.DoctorSex + "','" + entity.DoctorAge + "','" + entity.DoctorDegree + "','" + entity.DoctorPosition + "','" + entity.OfficeInfo.OfficeName + "','" + entity.OperateDate + "','" + entity.Operator + "')";
return SQLHelper.ExecuteNonQuery(sql);
}
public int Delete(int id)
{
string sql = "delete from Doctor where DoctorID=" + id;
return SQLHelper.ExecuteNonQuery(sql);
}
public int Update(DoctorInfo entity)
{
string sql = "update Doctor set DoctorName='"+entity.DoctorName+"',DoctorSex='" + entity.DoctorSex + "',DoctorAge='" + entity.DoctorAge + "',DoctorDegree='" + entity.DoctorDegree + "',DoctorPosition='" + entity.DoctorPosition + "',OfficeName='" + entity.OfficeInfo.OfficeName + "',OperateDate='" + entity.OperateDate + "',Operator='" + entity.Operator + "'where DoctorID="+entity.DoctorID;
return SQLHelper.ExecuteNonQuery(sql);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?