修改培训穿透页面和安全月报
This commit is contained in:
@@ -1985,6 +1985,12 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
#endregion
|
||||
|
||||
#region HSE培训
|
||||
public class Bosheng {
|
||||
public string TrainType { get; set; }
|
||||
|
||||
public decimal TrainPeriod { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示月报告HSE培训情况
|
||||
/// </summary>
|
||||
@@ -2009,7 +2015,8 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
trainSort.TrainType = item.TrainTypeName;
|
||||
if (listTrain.Count > 0)
|
||||
{
|
||||
trainSort.TeachHour = listTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TeachHour);
|
||||
trainSort.TeachHour = 0;
|
||||
//trainSort.TeachHour = listTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TeachHour);
|
||||
trainSort.PersonNum = listTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TrainPersonNum);
|
||||
}
|
||||
else
|
||||
@@ -2026,7 +2033,21 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
trainSort.PersonNum += listBosheng.Where(x => x.TrainType.Contains("入场")).Sum(x=>x.PersonCount);
|
||||
Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
decimal numSum = 0;
|
||||
trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("入场")).Sum(x => funDelegate(x.TrainPeriod, numSum));
|
||||
var listB = listBosheng.Where(x => x.TrainType.Contains("入场")).Select(x => new Bosheng
|
||||
{
|
||||
TrainType = x.TrainType,
|
||||
TrainPeriod = Convert.ToDecimal(x.TrainPeriod)
|
||||
});
|
||||
var model = listB.Where(x => x.TrainType.Contains("入场")).OrderByDescending(x => x.TrainPeriod).FirstOrDefault();
|
||||
if (model != null)
|
||||
{
|
||||
trainSort.TeachHour += model.TrainPeriod;
|
||||
}
|
||||
else {
|
||||
trainSort.TeachHour = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (item.TrainTypeId == "c1a513bb-a547-45b0-944d-b0dd88f06f82")
|
||||
{
|
||||
@@ -2034,14 +2055,41 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
trainSort.PersonNum += listBosheng.Where(x => x.TrainType.Contains("其他")).Sum(x => x.PersonCount);
|
||||
Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
decimal numSum = 0;
|
||||
trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("其他")).Sum(x => funDelegate(x.TrainPeriod, numSum));
|
||||
var listB = listBosheng.Where(x => x.TrainType.Contains("其他")).Select(x => new Bosheng {
|
||||
TrainType = x.TrainType,
|
||||
TrainPeriod = Convert.ToDecimal(x.TrainPeriod)
|
||||
});
|
||||
|
||||
var model = listB.Where(x => x.TrainType.Contains("其他")).OrderByDescending(x => x.TrainPeriod).FirstOrDefault();
|
||||
if (model != null)
|
||||
{
|
||||
trainSort.TeachHour += model.TrainPeriod;
|
||||
}
|
||||
else
|
||||
{
|
||||
trainSort.TeachHour = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//专项
|
||||
trainSort.PersonNum += listBosheng.Where(x => x.TrainType.Contains("专项")).Sum(x => x.PersonCount);
|
||||
Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
decimal numSum = 0;
|
||||
trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("专项")).Sum(x => funDelegate(x.TrainPeriod, numSum));
|
||||
var listB = listBosheng.Where(x => x.TrainType.Contains("专项")).Select(x => new Bosheng
|
||||
{
|
||||
TrainType = x.TrainType,
|
||||
TrainPeriod = Convert.ToDecimal(x.TrainPeriod)
|
||||
});
|
||||
var model = listB.Where(x => x.TrainType.Contains("专项")).OrderByDescending(x => x.TrainPeriod).FirstOrDefault();
|
||||
if (model != null)
|
||||
{
|
||||
trainSort.TeachHour += model.TrainPeriod;
|
||||
}
|
||||
else
|
||||
{
|
||||
trainSort.TeachHour = 0;
|
||||
}
|
||||
//Func<string, decimal, decimal> funDelegate = CustomCount;
|
||||
//decimal numSum = 0;
|
||||
//trainSort.TeachHour += listBosheng.Where(x => x.TrainType.Contains("专项")).Max(x => funDelegate(x.TrainPeriod, numSum));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3226,6 +3274,34 @@ namespace FineUIPro.Web.HSSE.Manager
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 4.4修改数量自动修改本月和累计
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Zy_TextChanged(object sender, EventArgs e) {
|
||||
if (!string.IsNullOrEmpty(nbFireWorkCount.Text)&&!string.IsNullOrEmpty(nbBreakGroundCount.Text)&&
|
||||
!string.IsNullOrEmpty(nbLimitedSpaceCount.Text) && !string.IsNullOrEmpty(nbElectricityCount.Text) &&
|
||||
!string.IsNullOrEmpty(nbHeightWorkCount.Text) && !string.IsNullOrEmpty(nbRadialWork.Text) &&
|
||||
!string.IsNullOrEmpty(nbLiftingWorkCount.Text) && !string.IsNullOrEmpty(nbNightWork.Text) )
|
||||
{
|
||||
|
||||
|
||||
var number1 = Convert.ToInt32(nbFireWorkCount.Text);
|
||||
var number2 = Convert.ToInt32(nbBreakGroundCount.Text);
|
||||
var number3 = Convert.ToInt32(nbLimitedSpaceCount.Text);
|
||||
var number4 = Convert.ToInt32(nbElectricityCount.Text);
|
||||
var number5 = Convert.ToInt32(nbHeightWorkCount.Text);
|
||||
var number6 = Convert.ToInt32(nbRadialWork.Text);
|
||||
var number7 = Convert.ToInt32(nbLiftingWorkCount.Text);
|
||||
var number8 = Convert.ToInt32(nbNightWork.Text);
|
||||
|
||||
//作业累计
|
||||
nbProCount.Text = (Convert.ToInt32(nbProCount.Text) - Convert.ToInt32(nbMonthCount.Text)
|
||||
+ number1 + number2 + number3 + number4 + number5 + number6 + number7 + number8).ToString();
|
||||
nbYearCount.Text= (Convert.ToInt32(nbYearCount.Text) - Convert.ToInt32(nbMonthCount.Text)
|
||||
+ number1 + number2 + number3 + number4 + number5 + number6 + number7 + number8).ToString();
|
||||
nbMonthCount.Text = ( number1 + number2 + number3 + number4 + number5 + number6 + number7 + number8).ToString();
|
||||
}}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user