📄 price_list.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using Sybase.DataWindow;
using SPRFrame;
using HPIResource;
namespace HPIResource.Price
{
// 价格分类表
public class Price_List : Sybase.DataWindow.DataStore
{
string Sql = "";
public Price_List()
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_price_list";
this.SetTransaction(SPRF.GetDB());
Sql = this.GetSqlSelect();
}
public void ResetSql()
{
this.SetSqlSelect(Sql);
}
public Price_List(string Type)
{
if (Type == "E")
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_price_edit";
this.SetTransaction(SPRF.GetDB());
}
else
{
this.LibraryList = HPIR.PbdFile;
this.DataWindowObject = "dw_price_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 XiangMu_MC
{
get
{
if (this.RowCount == 0) return "NoData";
return this.GetItemString(this.CurrentRow, "xiangmumc");
}
set
{
if (this.RowCount == 0) return;
this.SetItemString(this.CurrentRow, "xiangmumc", value);
}
}
#endregion
#region 取数据的方法
public void SetDataById(int iCatalogId)
{
string SqlString = this.GetSqlSelect();
SqlString += "where id = " + iCatalogId.ToString();
this.SetSqlSelect(SqlString);
}
public void SetDataByBM(string sBM)
{
string SqlString = this.GetSqlSelect();
SqlString += "where xiangmubm like '" + sBM + "%' order by xiangmubm";
this.SetSqlSelect(SqlString);
}
public void SetDataBySpellCode(string sCode)
{
string SqlString = this.GetSqlSelect();
SqlString += "where pinyinm like '" + sCode + "%' order by pinyinm";
this.SetSqlSelect(SqlString);
}
/*-----------------------------------------------------add by shj---------------------------------------------------------------------*/
public void SetDataByBM_BM(string sBM, string sBM2)
{
string SqlString = this.GetSqlSelect();
SqlString += "where xiangmubm like '" + sBM + "%' and xiangmubm like '" + sBM2 + "%' order by xiangmubm";
this.SetSqlSelect(SqlString);
}
public void SetDataByBM_SpellCode(string sBM, string sSpellCode)
{
string SqlString = this.GetSqlSelect();
SqlString += "where xiangmubm like '" + sBM + "%' and pinyinm like '%" + sSpellCode + "%' order by pinyinm";
this.SetSqlSelect(SqlString);
}
public void SetDataByBM_ChiName(string sBM, string sSpellCode)
{
string SqlString = this.GetSqlSelect();
SqlString += "where xiangmubm like '" + sBM + "%' and xiangmumc like '%" + sSpellCode + "%' order by xiangmumc";
this.SetSqlSelect(SqlString);
}
public void SetDataByChiName(string sChiName)
{
string SqlString = this.GetSqlSelect();
SqlString += "where xiangmumc like '%" + sChiName + "%' order by xiangmumc";
this.SetSqlSelect(SqlString);
}
public void SetDataByIdAndLB(int id, string xiangmulb)
{
ResetSql();
string SqlString = this.GetSqlSelect();
SqlString += "where id = " + id.ToString() + " and xiangmulb like '" + xiangmulb + "%'";
this.SetSqlSelect(SqlString);
}
/*-----------------------------------------------------------------------------------------------------------------------------------*/
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -