利用C#开发科技档案管理系统(二)
2009-02-27 08:18:21 来源:WEB开发网6)查询 -- 按分类卷号
#region
public DataSet Find_Scroll_ByScl_1(ClsScroll TmpScroll, string tbName) //模糊查询
{
SqlParameter[] prams = {
data.MakeInParam("@Scl_1", SqlDbType.VarChar, 20, "%" + TmpScroll.MyScl_1+"%"),
};
return (data.RunProcReturn("select Id,Scl_1,Scl_2,Scl_3,Scl_4,Scl_5," +
"Scl_6,Scl_7,Scl_17,Scl_18,Scl_19,Scl_20,Scl_21,Creator,Ctime,Mender,Mtime" +
" from tb_Scroll where Scl_1 like @Scl_1" +
" order by Id", prams, tbName));
}
#endregion
7)查询 -- 按装订代号
#region
public DataSet Find_Scoll_ByScl_2(ClsScroll TmpScroll, string tbName) //模糊查询
{
SqlParameter[] prams = {
data.MakeInParam("@Scl_2", SqlDbType.VarChar, 20, "%" + TmpScroll.MyScl_2 + "%"),
};
return (data.RunProcReturn("select Id,Scl_1,Scl_2,Scl_3,Scl_4,Scl_5," +
"Scl_6,Scl_7,Scl_17,Scl_18,Scl_19,Scl_20,Scl_21,Creator,Ctime,Mender,Mtime" +
" from tb_Scroll where Scl_2 like @Scl_2" +
" order by Id", prams, tbName));
}
#endregion
8)查询 -- 按姓名年月 – 模糊查询
#region
public DataSet Find_Scroll_Name_YM(string TmpName, string TmpYM, string tbName) //不显示重复记录distinct
{
return (data.RunProcReturn("select distinct Id,Scl_1,Scl_2,Scl_3,Scl_4,Scl_5,Scl_6,Scl_7,Scl_8,Scl_9,Scl_10,Scl_11," +
"Scl_12,Scl_13,Scl_14,Scl_15,Scl_16,Scl_17,Scl_18,Scl_19,Scl_20,Scl_21,Creator,Ctime,Mender,Mtime" +
" from tb_Scroll" +
" where (Creator like '%" + TmpName + "%' and Ctime like '%" + TmpYM + "%')" +
" Or (Mender like '%" + TmpName + "%' and Mtime like '%" + TmpYM + "%')" +
" order by Id", tbName));
}
#endregion
更多精彩
赞助商链接