增加数据穿透界面
This commit is contained in:
@@ -25,10 +25,11 @@ namespace FineUIPro.Web.DataShow
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||
// 绑定表格t
|
||||
BindGrid();
|
||||
this.Panel1.Title = "工时数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
@@ -57,7 +58,7 @@ namespace FineUIPro.Web.DataShow
|
||||
|
||||
// cpara += " AND c.RegisterDate <=" + this.txtEndTime.Text;
|
||||
//}
|
||||
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -148,7 +149,7 @@ namespace FineUIPro.Web.DataShow
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkingHoursItem.aspx?projectId={0}", Grid1.SelectedRowID, "查看 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
protected void btnView_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -168,25 +169,23 @@ namespace FineUIPro.Web.DataShow
|
||||
{
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getD1 = from x in Funs.DB.SitePerson_DayReport
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
select x;
|
||||
if (datetime1.HasValue)
|
||||
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
where x.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
if (getAllPersonInOutList.Count() > 0)
|
||||
{
|
||||
getD1 = getD1.Where(x => x.CompileDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getD1 = getD1.Where(x => x.CompileDate <= datetime2);
|
||||
}
|
||||
var getC = from x in Funs.DB.SitePerson_DayReportDetail
|
||||
join y in getD1 on x.DayReportId equals y.DayReportId
|
||||
where y.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
if (getC.Count() > 0)
|
||||
{
|
||||
cout1 = getC.Sum(x => x.PersonWorkTime ?? 0);
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate <= datetime2);
|
||||
}
|
||||
if (getAllPersonInOutList.Count() > 0)
|
||||
{
|
||||
cout1 = getAllPersonInOutList.Sum(x => x.WorkHours ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return cout1;
|
||||
@@ -206,11 +205,11 @@ namespace FineUIPro.Web.DataShow
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getD1 = from x in Funs.DB.Accident_AccidentHandle
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
select x;
|
||||
where y.ProjectState == Const.ProjectState_1 && x.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
var getD2 = from x in Funs.DB.Accident_AccidentReport
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
where y.ProjectState == Const.ProjectState_1 && x.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
@@ -246,48 +245,53 @@ namespace FineUIPro.Web.DataShow
|
||||
{
|
||||
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
|
||||
var getC1 = from x in Funs.DB.SitePerson_DayReport
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
select x;
|
||||
var getAllPersonInOutList = from x in Funs.DB.SitePerson_PersonInOutNumber
|
||||
where x.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
if (getAllPersonInOutList.Count() > 0)
|
||||
{
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getAllPersonInOutList = getAllPersonInOutList.Where(x => x.InOutDate <= datetime2);
|
||||
}
|
||||
if (getAllPersonInOutList.Count() > 0)
|
||||
{
|
||||
cout1 = getAllPersonInOutList.Sum(x => x.WorkHours ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
var getD1 = from x in Funs.DB.Accident_AccidentHandle
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
where y.ProjectState == Const.ProjectState_1 && x.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
var getD2 = from x in Funs.DB.Accident_AccidentReport
|
||||
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
|
||||
where y.ProjectState == Const.ProjectState_1
|
||||
where y.ProjectState == Const.ProjectState_1 && x.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
|
||||
if (datetime1.HasValue)
|
||||
{
|
||||
getC1 = getC1.Where(x => x.CompileDate >= datetime1);
|
||||
getD1 = getD1.Where(x => x.AccidentDate >= datetime1);
|
||||
getD2 = getD2.Where(x => x.CompileDate >= datetime1);
|
||||
}
|
||||
if (datetime2.HasValue)
|
||||
{
|
||||
getC1 = getC1.Where(x => x.CompileDate <= datetime2);
|
||||
getD1 = getD1.Where(x => x.AccidentDate <= datetime2);
|
||||
getD2 = getD2.Where(x => x.CompileDate <= datetime2);
|
||||
}
|
||||
var getC = from x in Funs.DB.SitePerson_DayReportDetail
|
||||
join y in getC1 on x.DayReportId equals y.DayReportId
|
||||
where y.ProjectId == projectId.ToString()
|
||||
select x;
|
||||
if (getC.Count() > 0)
|
||||
{
|
||||
cout1 = getC.Sum(x => x.PersonWorkTime ?? 0);
|
||||
}
|
||||
|
||||
|
||||
if (getD1.Count() > 0)
|
||||
{
|
||||
cout1 = cout1 -getD1.Sum(x => x.WorkHoursLoss ?? 0);
|
||||
cout1 = cout1 - getD1.Sum(x => x.WorkHoursLoss ?? 0);
|
||||
}
|
||||
if (getD2.Count() > 0)
|
||||
{
|
||||
cout1 = cout1- getD2.Sum(x => x.WorkingHoursLoss ?? 0);
|
||||
cout1 = cout1 - getD2.Sum(x => x.WorkingHoursLoss ?? 0);
|
||||
}
|
||||
}
|
||||
return cout1;
|
||||
|
||||
Reference in New Issue
Block a user