C# WinForm 数据统计问题
privatevoidGatherFBJF(){FBJFinfo=newFBJF();info.GatherYear=this.dtpStatDate.Value.Yea...
private void GatherFBJF()
{
FBJF info = new FBJF();
info.GatherYear = this.dtpStatDate.Value.Year;
info.GatherMonth = this.dtpStatDate.Value.Month;
foreach (RSTJ data in lsRSTJ)
{
info.ShouFeiBiShu += data.ShouFeiBiShu;
}
info.BiShuTongBi = info.ShouFeiBiShu - 1609;
foreach (RSTJ data in lsRSTJ)
{
info.ShouFeiJinE += data.ShouFeiJinE / 10000; //金额单位为万元
}
info.JinETongBi = (info.ShouFeiJinE - 3023);
foreach (RSTJ data in lsRSTJ)
{
if (data.JieSuanFangShi == "现金")
{
info.XianJinBiShu += data.ShouFeiBiShu;
info.XianJinJinE += data.ShouFeiJinE / 10000; //金额单位为万元
}
if (data.JieSuanFangShi == "转帐支票" | data.JieSuanFangShi == "承兑汇票" | data.JieSuanFangShi == "内部帐单" | data.JieSuanFangShi == "转帐")
{
info.ZhuanZhangBiShu += data.ShouFeiBiShu;
info.ZhuanZhangJinE += data.ShouFeiJinE / 10000; //金额单位为万元
}
}
//info.Add();
lsFBJF.Add(info);
this.bseFBJF.DataSource = lsFBJF;
}
说明:FBJF是目标数据(SQL)类,RSTJ是源数据(Excel)类。在上述统计方法中出现了两个问题。一是金额取万元后怎样四舍五入,这个不会弄;二是怎么把统计出的数据写入数据库?注释掉的“//info.Add();”是FBJF类的添加数据的方法,但结果不对,写入数据库的数据合部变为了整数。请高人指点一下! 展开
{
FBJF info = new FBJF();
info.GatherYear = this.dtpStatDate.Value.Year;
info.GatherMonth = this.dtpStatDate.Value.Month;
foreach (RSTJ data in lsRSTJ)
{
info.ShouFeiBiShu += data.ShouFeiBiShu;
}
info.BiShuTongBi = info.ShouFeiBiShu - 1609;
foreach (RSTJ data in lsRSTJ)
{
info.ShouFeiJinE += data.ShouFeiJinE / 10000; //金额单位为万元
}
info.JinETongBi = (info.ShouFeiJinE - 3023);
foreach (RSTJ data in lsRSTJ)
{
if (data.JieSuanFangShi == "现金")
{
info.XianJinBiShu += data.ShouFeiBiShu;
info.XianJinJinE += data.ShouFeiJinE / 10000; //金额单位为万元
}
if (data.JieSuanFangShi == "转帐支票" | data.JieSuanFangShi == "承兑汇票" | data.JieSuanFangShi == "内部帐单" | data.JieSuanFangShi == "转帐")
{
info.ZhuanZhangBiShu += data.ShouFeiBiShu;
info.ZhuanZhangJinE += data.ShouFeiJinE / 10000; //金额单位为万元
}
}
//info.Add();
lsFBJF.Add(info);
this.bseFBJF.DataSource = lsFBJF;
}
说明:FBJF是目标数据(SQL)类,RSTJ是源数据(Excel)类。在上述统计方法中出现了两个问题。一是金额取万元后怎样四舍五入,这个不会弄;二是怎么把统计出的数据写入数据库?注释掉的“//info.Add();”是FBJF类的添加数据的方法,但结果不对,写入数据库的数据合部变为了整数。请高人指点一下! 展开
1个回答
迈杰
2024-11-30 广告
2024-11-30 广告
RNA-seq数据分析是转录组研究的核心,包括数据预处理、序列比对、定量分析、差异表达分析、功能注释和可视化等步骤。数据预处理主要是质量控制和去除低质量序列。序列比对使用HISAT2、STAR等工具将reads比对到参考基因组。定量分析评估...
点击进入详情页
本回答由迈杰提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询