提交代码

This commit is contained in:
2023-12-13 16:47:03 +08:00
parent 4e3d979993
commit 61a2d7c518
7 changed files with 100 additions and 27 deletions
+66 -23
View File
@@ -438,7 +438,7 @@ namespace BLL
} }
} }
public static List<Model.View_WBS> GetAllTreeDataTable2(string projectId, string IsOut, string startTime, string endTime, string isOK) public static List<Model.View_WBS> GetAllTreeDataTable2(string projectId, string IsOut, string startTime, string endTime, string isOK, string unitWorkId)
{ {
using (var db = new Model.SGGLDB(Funs.ConnString)) using (var db = new Model.SGGLDB(Funs.ConnString))
{ {
@@ -446,22 +446,43 @@ namespace BLL
List<Model.View_WBS> newList = new List<Model.View_WBS>(); List<Model.View_WBS> newList = new List<Model.View_WBS>();
if (getWBSs.Count() > 0) if (getWBSs.Count() > 0)
{ {
if (unitWorkId == BLL.Const._Null)
var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0");
int a = 1;
foreach (var item in projectTypes)
{ {
item.Code = a.ToString(); var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0");
newList.Add(item); int a = 1;
if (string.IsNullOrEmpty(IsOut)) foreach (var item in projectTypes)
{ {
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK); item.Code = a.ToString();
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK);
}
else
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK);
}
a++;
} }
else }
else
{
var unitWork = getWBSs.Where(x => x.Id == unitWorkId);
int a = 1;
foreach (var item in unitWork)
{ {
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK); item.Code = a.ToString();
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK);
}
else
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK);
}
a++;
} }
a++;
} }
} }
return newList; return newList;
@@ -472,7 +493,7 @@ namespace BLL
/// 获取模拟树表格 /// 获取模拟树表格
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime, string isOK) public static DataTable GetAllTreeDataTable(string projectId, string IsOut, string startTime, string endTime, string isOK, string unitWorkId)
{ {
using (var db = new Model.SGGLDB(Funs.ConnString)) using (var db = new Model.SGGLDB(Funs.ConnString))
{ {
@@ -525,21 +546,43 @@ namespace BLL
if (getWBSs.Count() > 0) if (getWBSs.Count() > 0)
{ {
List<Model.View_WBS> newList = new List<Model.View_WBS>(); List<Model.View_WBS> newList = new List<Model.View_WBS>();
var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0"); if (unitWorkId == BLL.Const._Null)
int a = 1;
foreach (var item in projectTypes)
{ {
item.Code = a.ToString(); var projectTypes = getWBSs.Where(x => x.WBSType == "ProjectType" && x.SupId == "0");
newList.Add(item); int a = 1;
if (string.IsNullOrEmpty(IsOut)) foreach (var item in projectTypes)
{ {
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK); item.Code = a.ToString();
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK);
}
else
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK);
}
a++;
} }
else }
else
{
var unitWork = getWBSs.Where(x => x.Id == unitWorkId);
int a = 1;
foreach (var item in unitWork)
{ {
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK); item.Code = a.ToString();
newList.Add(item);
if (string.IsNullOrEmpty(IsOut))
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), startTime, endTime, isOK);
}
else
{
AddDetail(newList, getWBSs.ToList(), item.Id, a.ToString(), string.Empty, startTime, endTime, isOK);
}
a++;
} }
a++;
} }
DataRow row; DataRow row;
foreach (Model.View_WBS item in newList) foreach (Model.View_WBS item in newList)
@@ -30,6 +30,8 @@
<f:Toolbar ID="Toolbar2" Position="Top" runat="server"> <f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items> <Items>
<f:TextBox runat="server" ID="hdId" Hidden="true"></f:TextBox> <f:TextBox runat="server" ID="hdId" Hidden="true"></f:TextBox>
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程" LabelAlign="Right" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpUnitWork_SelectedIndexChanged">
</f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>
<%--<f:Button ID="btnShow" Icon="ChartPie" runat="server" ToolTip="统计" Text="统计" <%--<f:Button ID="btnShow" Icon="ChartPie" runat="server" ToolTip="统计" Text="统计"
OnClick="btnShow_Click"> OnClick="btnShow_Click">
@@ -132,6 +132,7 @@ namespace FineUIPro.Web.JDGL.Check
{ {
errorInfos = string.Empty; errorInfos = string.Empty;
string Id = Request.Params["Id"]; string Id = Request.Params["Id"];
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
BindGrid(); BindGrid();
} }
} }
@@ -143,7 +144,7 @@ namespace FineUIPro.Web.JDGL.Check
private void BindGrid() private void BindGrid()
{ {
DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, null, null, "0"); DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, null, null, "0", this.drpUnitWork.SelectedValue);
Grid1.RecordCount = table.Rows.Count; Grid1.RecordCount = table.Rows.Count;
var table2 = this.GetPagedDataTable(Grid1, table); var table2 = this.GetPagedDataTable(Grid1, table);
Grid1.DataSource = table2; Grid1.DataSource = table2;
@@ -368,6 +369,12 @@ namespace FineUIPro.Web.JDGL.Check
} }
} }
#endregion #endregion
#endregion #endregion
protected void drpUnitWork_SelectedIndexChanged(object sender, EventArgs e)
{
BindGrid();
}
} }
} }
@@ -66,6 +66,15 @@ namespace FineUIPro.Web.JDGL.Check {
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox hdId; protected global::FineUIPro.TextBox hdId;
/// <summary>
/// drpUnitWork 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitWork;
/// <summary> /// <summary>
/// btnSave 控件。 /// btnSave 控件。
/// </summary> /// </summary>
@@ -45,6 +45,8 @@
<f:RadioItem Value="1" Text="已完成" /> <f:RadioItem Value="1" Text="已完成" />
<f:RadioItem Value="2" Text="未完成" /> <f:RadioItem Value="2" Text="未完成" />
</f:RadioButtonList> </f:RadioButtonList>
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程" LabelAlign="Right" EnableEdit="true">
</f:DropDownList>
<f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" > <f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" >
</f:Button> </f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>
@@ -21,6 +21,7 @@ namespace FineUIPro.Web.JDGL.Check
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
BindGrid(); BindGrid();
} }
} }
@@ -28,7 +29,7 @@ namespace FineUIPro.Web.JDGL.Check
private void BindGrid() private void BindGrid()
{ {
var table = BLL.WorkPackageService.GetAllTreeDataTable2(this.CurrUser.LoginProjectId, string.Empty,this.txtStartTime.Text.Trim(),this.txtEndTime.Text.Trim(),this.rblIsOK.SelectedValue); var table = BLL.WorkPackageService.GetAllTreeDataTable2(this.CurrUser.LoginProjectId, string.Empty, this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), this.rblIsOK.SelectedValue, this.drpUnitWork.SelectedValue);
Grid1.RecordCount = table.Count; Grid1.RecordCount = table.Count;
var table2 = this.GetPagedDataTable(Grid1, table); var table2 = this.GetPagedDataTable(Grid1, table);
Grid1.DataSource = table2; Grid1.DataSource = table2;
@@ -132,7 +133,7 @@ namespace FineUIPro.Web.JDGL.Check
workPackage.JDWeights = Funs.GetNewDecimal(weights); workPackage.JDWeights = Funs.GetNewDecimal(weights);
workPackage.Unit = unit; workPackage.Unit = unit;
workPackage.PlanProjectQuantity = Funs.GetNewDecimal(planProjectQuantity); workPackage.PlanProjectQuantity = Funs.GetNewDecimal(planProjectQuantity);
workPackage.DrawProjectQuantity= Funs.GetNewDecimal(drawProjectQuantity); workPackage.DrawProjectQuantity = Funs.GetNewDecimal(drawProjectQuantity);
workPackage.RealProjectQuantity = Funs.GetNewDecimal(realProjectQuantity); workPackage.RealProjectQuantity = Funs.GetNewDecimal(realProjectQuantity);
workPackage.PlanStartDate = Funs.GetNewDateTime(planStartDate); workPackage.PlanStartDate = Funs.GetNewDateTime(planStartDate);
workPackage.PlanEndDate = Funs.GetNewDateTime(planEndDate); workPackage.PlanEndDate = Funs.GetNewDateTime(planEndDate);
@@ -202,7 +203,7 @@ namespace FineUIPro.Web.JDGL.Check
{ {
try try
{ {
DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, "Out",this.txtStartTime.Text.Trim(),this.txtEndTime.Text.Trim(), this.rblIsOK.SelectedValue); DataTable table = BLL.WorkPackageService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, "Out", this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), this.rblIsOK.SelectedValue, BLL.Const._Null);
string projectNmae = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); string projectNmae = BLL.ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId);
if (!string.IsNullOrEmpty(projectNmae)) if (!string.IsNullOrEmpty(projectNmae))
{ {
+9
View File
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.JDGL.Check {
/// </remarks> /// </remarks>
protected global::FineUIPro.RadioButtonList rblIsOK; protected global::FineUIPro.RadioButtonList rblIsOK;
/// <summary>
/// drpUnitWork 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnitWork;
/// <summary> /// <summary>
/// btnQuery 控件。 /// btnQuery 控件。
/// </summary> /// </summary>