?? 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 + -