📄 clinicschedule.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using Sybase.DataWindow;
using SPRFrame;
namespace HPIResource.Register
{
// 排班
public class ClinicSchedule : DataStore
{
string strSQl = "";
public ClinicSchedule()
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_ClinicSchedule";
this.SetTransaction(SPRF.GetDB());
strSQl = this.GetSqlSelect();
}
public ClinicSchedule(string sType)
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_ClinicSchedule_" + sType;
this.SetTransaction(SPRF.GetDB());
strSQl = this.GetSqlSelect();
}
public void ResetSQL()
{
this.SetSqlSelect(strSQl);
}
#region 属性
public int Reg_Date
{
get
{
if (this.RowCount == 0) return -1;
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow,"reg_date"));
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow,"reg_date",value);
}
}
public int CD_ID
{
get
{
if (this.RowCount == 0) return -1;
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "cd_id"));
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "cd_id", value);
}
}
public int CD2_ID
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "cd2_id"));
}
catch
{
return -1;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "cd2_id", value);
}
}
public int Doct_ID
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "doct_id"));
}
catch
{
return -1;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "doct_id", value);
}
}
public string RegType
{
get
{
if (this.RowCount == 0) return "Nodata";
try
{
return this.GetItemString(this.CurrentRow, "regtype_id");
}
catch
{
return "";
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow,"regtype_id",value);
}
}
public string Reg_AP
{
get
{
if (this.RowCount == 0) return "Nodata";
try
{
return this.GetItemString(this.CurrentRow, "ap_sts");
}
catch
{
return "";
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow, "ap_sts", value);
}
}
public int Price_ID
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "regPriceid"));
}
catch
{
return -1;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "regPriceid", value);
}
}
/// <summary>
/// 可挂数
/// </summary>
public int Reg_C0
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "Reg_C0"));
}
catch
{
return 0;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "Reg_C0", value);
}
}
/// <summary>
/// 已挂数
/// </summary>
public int Reg_C1
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "Reg_C1"));
}
catch
{
return 0;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "Reg_C1", value);
}
}
/// <summary>
/// 退号数
/// </summary>
public int Reg_C2
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "Reg_C2"));
}
catch
{
return 0;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "Reg_C2", value);
}
}
/// <summary>
/// 已诊数
/// </summary>
public int Reg_C3
{
get
{
if (this.RowCount == 0) return -1;
try
{
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "Reg_C3"));
}
catch
{
return 0 ;
}
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "Reg_C3", value);
}
}
#endregion
#region 方法
/// <summary>
/// 以模版的方式检索数据
/// </summary>
public void SetDataAsModel()
{
ResetSQL();
string s = this.GetSqlSelect().ToUpper();
if (s.IndexOf("WHERE") > 0)
{
s += "and reg_date <= 7 order by reg_date,cd_id";
}
else
{
s += "where reg_date <= 7 order by reg_date,cd_id";
}
this.SetSqlSelect(s);
}
/// <summary>
/// 按照日期检索门诊排班
/// </summary>
/// <param name="iDate"></param>
public void SetDataByDate(int iDate)
{
ResetSQL();
string s = this.GetSqlSelect().ToUpper();
if (s.IndexOf("WHERE") > 0)
{
s += "and reg_date = "+iDate.ToString()+" order by reg_date,cd_id";
}
else
{
s += "where reg_date = "+iDate.ToString()+" order by reg_date,cd_id";
}
this.SetSqlSelect(s);
}
public void SetDataByDate(int iSDate,int iEDate)
{
ResetSQL();
string s = this.GetSqlSelect().ToUpper();
int i = s.IndexOf("WHERE");
string s1 = s.Substring(0, i + 5);
string s2 = s.Substring(i + 6, s.Length - i - 6);
if (i > 0)
{
s = s1 + "(reg_date >= " + iSDate.ToString() + " and reg_date <= " +iEDate.ToString() + ") and " + s2;
}
else
{
s = s1 + "where reg_date >= " + iSDate.ToString() + " and reg_date <= "+iEDate.ToString();
}
this.SetSqlSelect(s);
}
/// <summary>
/// 根据weekday检索数据
/// </summary>
/// <param name="week">weekday</param>
public void SetDataByWeek(int week)
{
ResetSQL();
string SqlString = this.GetSqlSelect().ToUpper();
if (SqlString.IndexOf("WHERE") > 0)
{
SqlString += "reg_date = " + week.ToString() + " order by reg_date,cd_id";
}
else
{
SqlString += "where reg_date = " + week.ToString() + " order by reg_date,cd_id";
}
this.SetSqlSelect(SqlString);
}
/// <summary>
/// 检索排班记录--挂号
/// </summary>
/// <param name="Reg_Date">排班日期</param>
/// <param name="CD_Id">一级科室</param>
/// <param name="CD2_Id">二级科室</param>
/// <param name="RegType_Id">诊别</param>
/// <param name="Doct_Id">医生</param>
public void SetDataByData(int Reg_Date, int CD_Id, int CD2_Id, string RegType_Id, int Doct_Id)
{
ResetSQL();
string SqlString = this.GetSqlSelect().ToUpper();
if (SqlString.IndexOf("WHERE") > 0)
{
SqlString += " and reg_date = " + Reg_Date.ToString() +" and CD_Id = " + CD_Id.ToString();// +" and CD2_Id = " + CD2_Id.ToString() + " and RegType_Id = '" + RegType_Id.ToString() + "' and Doct_Id = " + Doct_Id.ToString() + "order by reg_date,cd_id";
}
else
{
SqlString += "where reg_date = " + Reg_Date.ToString() + " and CD_Id = " + CD_Id.ToString() + " and CD2_Id = " + CD2_Id.ToString() + " and RegType_Id = '" + RegType_Id.ToString() + "' and Doct_Id = " + Doct_Id.ToString() + "order by reg_date,cd_id";
}
this.SetSqlSelect(SqlString);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -