📄 cdrug_list.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using Sybase.DataWindow;
using SPRFrame;
using HPIResource;
namespace HPIResource.CDrug
{
// 中药表
public class CDrug_List : Sybase.DataWindow.DataStore
{
public CDrug_List()
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_mdrug_list";
this.SetTransaction(SPRF.GetDB());
}
public CDrug_List(string sTYPE)
{
if (sTYPE == "E")
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_cdrug_edit";
this.SetTransaction(SPRF.GetDB());
}
else
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_mdrug_list";
this.SetTransaction(SPRF.GetDB());
}
}
#region 属性
public int ID
{
get
{
if (this.RowCount == 0) return -1;
return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "id"));
}
set
{
if (this.RowCount == 0) return;
this.SetItemDouble(this.CurrentRow, "id", value);
}
}
public string YPMC_CHN //中文名称
{
get
{
if (this.RowCount == 0) return "NoData";
return this.GetItemString(this.CurrentRow, "ypmc_chn");
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow, "ypmc_chn", value);
}
}
public string SFDH //收费代号_联新
{
get
{
if (this.RowCount == 0) return "NoData";
return this.GetItemString(this.CurrentRow, "sfdh");
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow, "spdh", value);
}
}
public string YLFL
{ //药理分类
get
{
if (this.RowCount == 0) return "NoData";
return this.GetItemString(this.CurrentRow, "ylfl");
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow, "ylfl", value);
}
}
public string FPDW
{ //发票单位
get
{
if (this.RowCount == 0) return "NoData";
return this.GetItemString(this.CurrentRow, "fpdw");
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow, "fpdw", value);
}
}
#endregion
#region 取数据的方法
public void SetDataById(int iId)
{
string SqlString = this.GetSqlSelect();
SqlString += "where id = " + iId.ToString();
this.SetSqlSelect(SqlString);
}
public void SetDataByCode(string sCode)
{
string SqlString = this.GetSqlSelect();
SqlString += "where sfdh like '%" + sCode + "%' order by sfdh";
this.SetSqlSelect(SqlString);
}
public void SetDataByYLFL(string sYLFL)
{//根据药理分类检索
string SqlString = this.GetSqlSelect();
SqlString += "where ylfl like '" + sYLFL + "%' order by ylfl";
this.SetSqlSelect(SqlString);
}
public void SetDataByCondition(string sYLFL, string sSFDH, string sPYDM, string sYPMC_CHN, int iTY_FLAG)
{//iTY_FLAG 停用标致:-1 全部,0 不停用,1 停用
string SqlString = this.GetSqlSelect();
if ((sYLFL != null) || (sSFDH != "") || (sPYDM != "") || (sYPMC_CHN != "") || (iTY_FLAG != -1))
{//如果所有参数都为空则不加任何条件返回
SqlString += "where ";
}
else
{
this.SetSqlSelect(SqlString);
return;
}
if (sYLFL != null)
{
SqlString += "YLFL like '" + sYLFL + "%' and ";
}
if (sSFDH != "")
{
SqlString += "SFDH like '%" + sSFDH + "%' and ";
}
if (sPYDM != "")
{
SqlString += "PYDM like '%" + sPYDM + "%' and ";
}
if (sYPMC_CHN != "")
{
SqlString += "YPMC_CHN like '%" + sYPMC_CHN + "%' and ";
}
if (iTY_FLAG != -1)
{
SqlString += "TY_FLAG = " + iTY_FLAG + " and ";
}
SqlString = SqlString.Substring(0, SqlString.Length - 5);
SqlString += " order by SFDH";
this.SetSqlSelect(SqlString);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -