类库中的方法如下
public List<DataContract.ClinicInCharge.Records_Moneys> Querydgvlist(string months)//
{
string sql = string.Empty, err = string.Empty;
DataTable dt = new DataTable();
sql = string.Format(@"
SELECT a.months, b.dept_code ,b.dept_name ,
c.user_code , isnull(c.user_name,username) as user_name,a.moneys
,a.userid,a.deptid,a.id,a.RecordUser,a.RecordTime,a.iscw
FROM {0} a
inner join {1} b on a.deptid=b.deptid
left outer join {2} c on c.userid=a.userid
where a.months='{3}'
", TableName, Tables.tbDeptList, Tables.tbuser, months);
dt = SqlHelper.QueryFromDatabase(ThisConn.sCono, sql, out err);
string lblist = "上报明细:" + dt.Rows.Count.ToString() + "行, 人数:" + dt.Rows.Count.ToString() + ",科室总奖金:" + DataConverter.ToDecimal(dt.Compute("sum(moneys)", "")).ToString("") + "元";
return DataConverter.DataTableToIList<DataContract.ClinicInCharge.Records_Moneys>(dt).ToList();
}
要怎么做?
通过dal调用相关的数值
还是说不能引用这个数值啊,求回答
当前类库中的该方法并未将局部变量的获取到的值返回,换句话说你要么重写该类的
public List Querydgvlist(string months) 为
public List Querydgvlist(string months, out string list)
{
//其余略
string lblist = "上报明细:" + dt.Rows.Count.ToString() + "行, 人数:" + dt.Rows.Count.ToString() + ",科室总奖金:" + DataConverter.ToDecimal(dt.Compute("sum(moneys)", "")).ToString("") + "元";
list=lblist;
//其余略
}