C/S快速开发框架旗舰版V5.1 - IDatabase接口使用方式
使用方式:
实例参考,查询数据。
public DataSet QueryByPage(DateTime beginDate, DateTime endDate, string docNo1, string docNo2, int pageNo, int pageSize)
{
CommandHelper sp = _Database.CreateSqlProc("usp_PageSearch_SO");
sp.AddParam("@BeginDate", DbType.DateTime, beginDate);
sp.AddParam("@EndDate", DbType.DateTime, endDate);
sp.AddParam("@DocNo1", DbType.String, docNo1.Trim());
sp.AddParam("@DocNo2", DbType.String, docNo2.Trim());
sp.AddParam("@PageNo", DbType.Int32, pageNo);
sp.AddParam("@PageSize", DbType.Int32, pageSize);
DataSet ds = _Database.GetDataSet(sp.Command);
ds.Tables[0].TableName = tb_SO.__TableName;
ds.Tables[1].TableName = "PAGE_COUNT";
return ds;
}
实例参考,查询数据。
public DataSet QueryReportData(QueryBusinessBase P)
{
CommandHelper sp = _Database.CreateSqlProc("sp_RptSO");
sp.AddParam("@DocNoFrom", DbType.String, P.DocNoFrom.Trim());
sp.AddParam("@DocNoTo", DbType.String, P.DocNoTo.Trim());
sp.AddParam("@DateFrom", DbType.String, ConvertEx.ToCharYYYYMMDD(P.DocDateFrom));
sp.AddParam("@DateTo", DbType.String, ConvertEx.ToCharYYYYMMDD(P.DocDateTo));
DataSet ds = _Database.GetDataSet(sp.Command);
ds.Tables[0].TableName = tb_SO.__TableName;
ds.Tables[1].TableName = tb_SOs.__TableName;
return ds;
}
实例参考,查询数据。
public void TestConcurrent(string customerCode)
{
string sql = "UPDATE tb_Customer SET Remark=NativeName WHERE CustomerCode='" + customerCode + "' ";
_Database.ExecuteSQL(sql);
}
public override DataTable GetLookupData()
{
string sql = "SELECT ISID,CustomerCode,NativeName,EnglishName,ContactPerson FROM tb_Customer ORDER BY CustomerCode";
return _Database.GetTable(sql, tb_Customer.__TableName);
}
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
CSV5 C/S框架网