qq_32320747 2018-02-12 07:16 采纳率: 100%
浏览 851
已采纳

c#窗体代码中调用类库中的一个类使 lblist.Text=lblist

类库中的方法如下

    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();
        }

要怎么做?

  • 写回答

3条回答 默认 最新

  • zyy1111111 2018-03-02 02:57
    关注

    通过dal调用相关的数值

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?