111,129
社区成员
发帖
与我相关
我的任务
分享
public int GetGjjRecord(string yf, string bm, out DataTable datatable1,out SqlDataAdapter da)
{
string strsql = "select a.autoid,a.月份,b.部门,a.公积金编号,a.编号,a.姓名,a.序号,a.存取方式编码,a.存取方式名称,a.存入,a.支取,a.公积金,a.备注,a.制单人,a.制单人姓名,a.审核人,a.审核人姓名,a.制单时间,a.审核时间 ";
strsql += "from 公积金明细 a left join gzda b on (a.编号=b.编号) where a.记录标志 <> 0 and a.月份='"+yf +"' ";
if (bm=="**")
{
strsql+=" order by b.部门,a.编号";
}
else if (bm == "##")
{
strsql += "and isnull(b.部门,'')='' order by b.部门,a.编号";
}
else
{
strsql += "and b.部门='" + bm + "' order by b.部门,a.编号";
}
dt = new DataTable();
da = new SqlDataAdapter(strsql, mydb.conn);
scb = new SqlCommandBuilder(da);
da.Fill(dt);
datatable1 = dt;
return 0;
}