?? patientdal.cs
字號:
?using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Youzi.Model;
using Youzi.DBUtility;
namespace Youzi.DAL
{
class PatientDAL
{
public int InsertPatient(PatientInfo entity)
{
DateTime dt = DateTime.Now;
string num = dt.ToString("yyyyMMdd");
string PatientID=SQLHelper.GetMaxOrder("Patient");
//maxorder存放最大號
string maxorder = num +PatientID; //自動編號
string sql = "insert into Patient values('"+maxorder+"','" + entity.PatientName + "','" + entity.PatientSex + "','" + entity.PatientAge + "','" + entity.Department + "','" + entity.Address + "','" + entity.OperateDate + "','" + entity.Operator + "')";
return SQLHelper.ExecuteNonQuery(sql);
}
public int Delete(int id)
{
string sql = "delete from Patient where PatientID=" + id;
return SQLHelper.ExecuteNonQuery(sql);
}
public DataSet Select()
{
string sql = "Select * from View_Office_Doctor";
return SQLHelper.Select(sql);
}
public DataSet SelectRegisterType()
{
string sql = "select * from View_RegisterType";
return SQLHelper.Select(sql);
}
public DataSet SelectPatient()
{
string sql = "select * from View_Patient";
return SQLHelper.Select(sql);
}
public DataSet SelectPatientToday(string StartID,string EndID)
{
string sql = "select * from View_Patient where 病人編號>='" + StartID + "'and 病人編號<='" + EndID + "'";
return SQLHelper.Select(sql);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -