?? doctordal.cs
字號:
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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -