提交代码
This commit is contained in:
@@ -161,6 +161,30 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
}
|
||||
StatisticsList.Add(StatisticsLast);
|
||||
}
|
||||
//增加累计
|
||||
List<Model.JDGL_WeekPlan> sumTotalList = new List<Model.JDGL_WeekPlan>();
|
||||
if (totalList.Count() > 0)
|
||||
{
|
||||
var startDate = totalList.First().StartDate;
|
||||
sumTotalList = (from x in db.JDGL_WeekPlan where x.ProjectId == this.CurrUser.LoginProjectId && x.StartDate <= startDate select x).ToList();
|
||||
}
|
||||
Model.JDGL_WeekPlan StatisticsSum = new Model.JDGL_WeekPlan();
|
||||
StatisticsSum.WorkContent = "累计";
|
||||
int c = sumTotalList.Count();
|
||||
int d = sumTotalList.Count(x => x.IsOK == true);
|
||||
StatisticsSum.UnitId = c.ToString();
|
||||
StatisticsSum.DutyPerson = d.ToString();
|
||||
if (c != 0)//被除数不能为零
|
||||
{
|
||||
StatisticsSum.Remark = Math.Round((double)d / (double)c * 100, 2) + "%";//保留两位小数、后四舍五入
|
||||
}
|
||||
else
|
||||
{
|
||||
StatisticsSum.Remark = "0%";
|
||||
}
|
||||
StatisticsList.Add(StatisticsSum);
|
||||
this.Grid1.DataSource = StatisticsList;
|
||||
this.Grid1.DataBind();
|
||||
this.Grid1.DataSource = StatisticsList;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user