⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doctordal.cs

📁 不错的一个做的医院管理系统源码
💻 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 + -