0813
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlDetailEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlDetailEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="费控项计划" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="CostControlDetailId" AllowCellEditing="true"
|
||||
ClicksToEdit="1" DataIDField="CostControlDetailId" AllowSorting="true" SortField="Months"
|
||||
SortDirection="ASC" EnableColumnLines="true" ForceFit="true"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnRowCommand="Grid1_RowCommand"
|
||||
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:Label ID="txtCostControlName" runat="server" Width="220px" LabelWidth="50px"
|
||||
LabelAlign="Right">
|
||||
</f:Label>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="true"
|
||||
runat="server" OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdate" Icon="Pencil" runat="server" ToolTip="调整计划"
|
||||
OnClick="btnUpdate_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSee" ToolTip="查看历史版本" Icon="Find" runat="server" OnClick="btnSee_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="100px" ColumnID="Months" DataField="Months"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM" HeaderText="月份" TextAlign="Center"
|
||||
HeaderTextAlign="Center">
|
||||
<Editor>
|
||||
<f:DatePicker ID="txtMonths" runat="server" DateFormatString="yyyy-MM"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
|
||||
HeaderText="本月计划完成量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbTotalNum" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField Width="30px" TextAlign="Center" HeaderText="删除" ToolTip="删除" CommandName="del"
|
||||
Icon="Delete" />
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="查看历史版本" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" IsModal="true"
|
||||
Width="800px" Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class CostControlDetailEdit : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 控制项主键
|
||||
/// </summary>
|
||||
public string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Id"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Id"] = value;
|
||||
}
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.Id = Request.Params["Id"];
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(this.Id);
|
||||
if (costControl != null)
|
||||
{
|
||||
this.txtCostControlName.Text = costControl.CostControlName;
|
||||
}
|
||||
var list = BLL.CostControlDetailService.GetCostControlDetailsByCostControlId(this.Id);
|
||||
this.Grid1.DataSource = list;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#region 增加按钮事件
|
||||
/// <summary>
|
||||
/// 增加按钮事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
var list = GetDetails();
|
||||
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
|
||||
detail.CostControlDetailId = SQLHelper.GetNewID();
|
||||
list.Add(detail);
|
||||
Grid1.DataSource = list;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
private List<Model.WBS_CostControlDetail> GetDetails()
|
||||
{
|
||||
List<Model.WBS_CostControlDetail> details = new List<Model.WBS_CostControlDetail>();
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
int i = mergedRow.Value<int>("index");
|
||||
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
|
||||
detail.CostControlDetailId = Grid1.Rows[i].RowID;
|
||||
detail.CostControlId = this.Id;
|
||||
detail.Months = Funs.GetNewDateTime(values.Value<string>("Months") + "-01");
|
||||
detail.PlanNum = Funs.GetNewDecimal(values.Value<string>("PlanNum"));
|
||||
details.Add(detail);
|
||||
}
|
||||
return details;
|
||||
}
|
||||
#region 行点击事件
|
||||
/// <summary>
|
||||
/// Grid行点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string detailId = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
var list = GetDetails();
|
||||
if (e.CommandName == "del")//删除
|
||||
{
|
||||
var detail = list.FirstOrDefault(x => x.CostControlDetailId == detailId);
|
||||
Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(detailId);
|
||||
if (detail != null)
|
||||
{
|
||||
list.Remove(detail);
|
||||
}
|
||||
if (oldDetail != null)
|
||||
{
|
||||
BLL.CostControlDetailService.DeleteCostControlDetail(detailId);
|
||||
}
|
||||
this.Grid1.DataSource = list;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var list = GetDetails();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(item.CostControlDetailId);
|
||||
if (oldDetail == null)
|
||||
{
|
||||
BLL.CostControlDetailService.AddCostControlDetail(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.ThisNum = oldDetail.ThisNum;
|
||||
BLL.CostControlDetailService.UpdateCostControlDetail(item);
|
||||
}
|
||||
}
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 调整计划
|
||||
/// <summary>
|
||||
/// 调整计划按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
var list = GetDetails();
|
||||
int versionNum = BLL.CostControlDetailHistoryService.GetMaxVersionNumByCostControlId(this.Id);
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.WBS_CostControlDetailHistory detailHistory = new Model.WBS_CostControlDetailHistory();
|
||||
detailHistory.CostControlDetailHistoryId = SQLHelper.GetNewID();
|
||||
detailHistory.CostControlId = item.CostControlId;
|
||||
detailHistory.Months = item.Months;
|
||||
detailHistory.PlanNum = item.PlanNum;
|
||||
detailHistory.VersionNum = versionNum + 1;
|
||||
BLL.CostControlDetailHistoryService.AddCostControlDetailHistory(detailHistory);
|
||||
}
|
||||
ShowNotify("历史版本保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看历史版本
|
||||
/// <summary>
|
||||
/// 查看历史版本
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSee_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CostControlDetailHistoryShow.aspx?Id={0}", this.Id, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class CostControlDetailEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtCostControlName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtCostControlName;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnUpdate;
|
||||
|
||||
/// <summary>
|
||||
/// btnSee 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSee;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// lblPageIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// txtMonths 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtMonths;
|
||||
|
||||
/// <summary>
|
||||
/// nbTotalNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbTotalNum;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlDetailHistoryShow.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlDetailHistoryShow" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="false" ShowHeader="false" EnableCollapse="false" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="CostControlDetailHistoryId" AllowSorting="true" EnableColumnLines="true"
|
||||
SortField="VersionNum" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" PageSize="1000"
|
||||
ShowSelectedCell="true" DataIDField="CostControlDetailHistoryId" IsDatabasePaging="true">
|
||||
<Columns>
|
||||
<f:RenderField Width="100px" ColumnID="VersionNum" DataField="VersionNum" FieldType="String" RendererFunction="renderGender"
|
||||
HeaderText="版本" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Months" DataField="Months"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM" HeaderText="月份" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
|
||||
HeaderText="本月计划完成量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script>
|
||||
function renderGender(value) {
|
||||
return 'V' + value + '.0';
|
||||
}
|
||||
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['VersionNum']);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class CostControlDetailHistoryShow : PageBase
|
||||
{
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string column1 = string.Empty;
|
||||
List<Model.WBS_CostControlDetailHistory> detailHistorys = BLL.CostControlDetailHistoryService.GetCostControlDetailHistorysByCostControlId(Request.Params["Id"]);
|
||||
Grid1.DataSource = detailHistorys;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class CostControlDetailHistoryShow {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCostControlCode" runat="server" Label="费用清单编号" ShowRedStar="true" Required="true" LabelWidth="130px" FocusOnPageLoad="true"></f:TextBox>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCostControlName" runat="server" Label="内容" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtTotalNum" NoDecimal="false" NoNegative="true" MinValue="0" Label="合同工作量" LabelWidth="130px"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtRealPrice" NoDecimal="false" NoNegative="true" MinValue="0" Label="成本单价" LabelWidth="130px"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,112 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class CostControlEdit : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
LoadData();
|
||||
string id = Request.Params["Id"];
|
||||
string operating = Request.Params["operating"];
|
||||
if (operating == "add")
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(id);
|
||||
if (costControl != null)
|
||||
{
|
||||
this.txtCostControlCode.Text = costControl.CostControlCode;
|
||||
this.txtCostControlName.Text = costControl.CostControlName;
|
||||
this.txtUnit.Text = costControl.Unit;
|
||||
if (costControl.TotalNum != null)
|
||||
{
|
||||
this.txtTotalNum.Text = costControl.TotalNum.ToString();
|
||||
}
|
||||
if (costControl.RealPrice != null)
|
||||
{
|
||||
this.txtRealPrice.Text = costControl.RealPrice.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string id = Request.Params["Id"];
|
||||
string code = Request.Params["Code"];
|
||||
string operating = Request.Params["operating"];
|
||||
if (operating == "add")
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(id);
|
||||
Model.WBS_CostControl costControl = new WBS_CostControl();
|
||||
costControl.CostControlCode = txtCostControlCode.Text.Trim();
|
||||
costControl.CostControlName = txtCostControlName.Text.Trim();
|
||||
costControl.ProjectId = wbsSet.ProjectId;
|
||||
costControl.WbsSetId = wbsSet.WbsSetId;
|
||||
costControl.Unit = txtUnit.Text.Trim();
|
||||
costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim());
|
||||
costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim());
|
||||
BLL.CostControlService.AddCostControl(costControl);
|
||||
//增加对应关系内容
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = id;
|
||||
wbsSetMatchCostControl.CostControlCode = costControl.CostControlCode;
|
||||
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "增加费用清单项!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(id);
|
||||
if (costControl != null)
|
||||
{
|
||||
//更新对应关系内容
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = BLL.WbsSetMatchCostControlService.GetWbsSetMatchCostControlByWbsSetIdAndCostControlCode(code, costControl.CostControlCode);
|
||||
if (wbsSetMatchCostControl != null)
|
||||
{
|
||||
wbsSetMatchCostControl.WbsSetId = code;
|
||||
wbsSetMatchCostControl.CostControlCode = txtCostControlCode.Text.Trim();
|
||||
BLL.WbsSetMatchCostControlService.UpdateWbsSetMatchCostControl(wbsSetMatchCostControl);
|
||||
}
|
||||
costControl.CostControlCode = txtCostControlCode.Text.Trim();
|
||||
costControl.CostControlName = txtCostControlName.Text.Trim();
|
||||
costControl.Unit = txtUnit.Text.Trim();
|
||||
costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim());
|
||||
costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim());
|
||||
BLL.CostControlService.UpdateCostControl(costControl);
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "修改费用清单项!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class CostControlEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtCostControlCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCostControlCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtCostControlName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCostControlName;
|
||||
|
||||
/// <summary>
|
||||
/// txtUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtTotalNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtTotalNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtRealPrice 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtRealPrice;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlInitEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlInitEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCostControlInitCode" runat="server" Label="费用清单编号" ShowRedStar="true" Required="true" LabelWidth="130px" FocusOnPageLoad="true"></f:TextBox>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCostControlInitName" runat="server" Label="内容" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,97 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class CostControlInitEdit : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
LoadData();
|
||||
string id = Request.Params["Id"];
|
||||
string operating = Request.Params["operating"];
|
||||
if (operating == "add")
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.WBS_CostControlInit costControl = BLL.CostControlInitService.GetCostControlInitByCostControlInitId(id);
|
||||
if (costControl != null)
|
||||
{
|
||||
this.txtCostControlInitCode.Text = costControl.CostControlInitCode;
|
||||
this.txtCostControlInitName.Text = costControl.CostControlInitName;
|
||||
this.txtUnit.Text = costControl.Unit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string id = Request.Params["Id"];
|
||||
string code = Request.Params["Code"];
|
||||
string operating = Request.Params["operating"];
|
||||
if (operating == "add")
|
||||
{
|
||||
Model.WBS_CostControlInit costControl = new WBS_CostControlInit();
|
||||
costControl.CostControlInitCode = txtCostControlInitCode.Text.Trim();
|
||||
costControl.CostControlInitName = txtCostControlInitName.Text.Trim();
|
||||
costControl.Unit = txtUnit.Text.Trim();
|
||||
BLL.CostControlInitService.AddCostControlInit(costControl);
|
||||
//增加对应关系内容
|
||||
Model.WBS_WbsSetMatchCostControlInit wbsSetMatchCostControlInit = new WBS_WbsSetMatchCostControlInit();
|
||||
wbsSetMatchCostControlInit.WbsSetMatchCostControlInitId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControlInit.WbsSetCode = id;
|
||||
wbsSetMatchCostControlInit.CostControlInitCode = costControl.CostControlInitCode;
|
||||
BLL.WbsSetMatchCostControlInitService.AddWbsSetMatchCostControlInit(wbsSetMatchCostControlInit);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "增加费用清单项!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.WBS_CostControlInit costControl = BLL.CostControlInitService.GetCostControlInitByCostControlInitId(id);
|
||||
if (costControl != null)
|
||||
{
|
||||
//更新对应关系内容
|
||||
Model.WBS_WbsSetMatchCostControlInit wbsSetMatchCostControlInit = BLL.WbsSetMatchCostControlInitService.GetWbsSetMatchCostControlInitByWbsSetCodeAndCostControlInitCode(code, costControl.CostControlInitCode);
|
||||
if (wbsSetMatchCostControlInit != null)
|
||||
{
|
||||
wbsSetMatchCostControlInit.WbsSetCode = code;
|
||||
wbsSetMatchCostControlInit.CostControlInitCode = txtCostControlInitCode.Text.Trim();
|
||||
BLL.WbsSetMatchCostControlInitService.UpdateWbsSetMatchCostControlInit(wbsSetMatchCostControlInit);
|
||||
}
|
||||
costControl.CostControlInitCode = txtCostControlInitCode.Text.Trim();
|
||||
costControl.CostControlInitName = txtCostControlInitName.Text.Trim();
|
||||
costControl.Unit = txtUnit.Text.Trim();
|
||||
BLL.CostControlInitService.UpdateCostControlInit(costControl);
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "修改费用清单项!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class CostControlInitEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtCostControlInitCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCostControlInitCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtCostControlInitName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCostControlInitName;
|
||||
|
||||
/// <summary>
|
||||
/// txtUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUnit;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -38,45 +38,33 @@
|
||||
BoxConfigAlign="Stretch" BoxConfigPosition="Left" runat="server">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Code" AllowSorting="true" EnableColumnLines="true"
|
||||
SortField="Code" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ForceFit="true"
|
||||
ShowSelectedCell="true" DataIDField="Code" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" AllowFilters="true" OnFilterChange="Grid1_FilterChange">
|
||||
<%--<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
runat="server" BoxFlex="1" DataKeyNames="CostControlInitId" AllowSorting="true" EnableColumnLines="true"
|
||||
SortField="CostControlInitCode,CostControlInitName" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ForceFit="true"
|
||||
ShowSelectedCell="true" DataIDField="CostControlInitId" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="100" OnPageIndexChange="Grid1_PageIndexChange" AllowFilters="true" OnFilterChange="Grid1_FilterChange">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存"
|
||||
OnClick="btnSave_Click">
|
||||
<f:Button ID="btnAdd" Icon="Add" runat="server" ToolTip="增加"
|
||||
OnClick="btnAdd_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>--%>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="Code" DataField="Code" FieldType="String"
|
||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="100px" ColumnID="CostControlInitCode" DataField="CostControlInitCode" FieldType="String"
|
||||
HeaderText="费用清单编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Name" DataField="Name" FieldType="String"
|
||||
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="400px" ColumnID="CostControlInitName" DataField="CostControlInitName" FieldType="String"
|
||||
HeaderText="内容" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ControlPoint" DataField="ControlPoint" FieldType="String"
|
||||
HeaderText="等级" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:TemplateField Width="300px" HeaderText="内容" ColumnID="ControlItemDef" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Bind("ControlItemDef") %>' ToolTip='<%# Bind("ControlItemDef") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="150px" HeaderText="备注" ColumnID="Remark" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Remark") %>' ToolTip='<%# Bind("Remark") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="200px" ColumnID="Type" DataField="Type" Hidden="true" FieldType="String"
|
||||
HeaderText="类型" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="70px" ColumnID="Unit" DataField="Unit" FieldType="String"
|
||||
HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
@@ -84,10 +72,10 @@
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="10" Value="10" />
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="100" Value="100" />
|
||||
<f:ListItem Text="200" Value="200" />
|
||||
<f:ListItem Text="300" Value="300" />
|
||||
<f:ListItem Text="400" Value="400" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
@@ -102,6 +90,10 @@
|
||||
<f:Window ID="Window2" Title="增加" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="800px" Height="300px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window3" Title="增加" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" OnClose="Window3_Close" IsModal="true"
|
||||
Width="800px" Height="300px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuAdd" OnClick="btnMenuAdd_Click" EnablePostBack="true" runat="server" Icon="Add" Hidden="true"
|
||||
@@ -117,10 +109,27 @@
|
||||
ConfirmText="确认删除选中项?" ConfirmTarget="Top" runat="server" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
<f:Menu ID="Menu2" runat="server">
|
||||
<Items>
|
||||
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"
|
||||
OnClick="btnMenuModify_Click">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Hidden="true" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
|
||||
OnClick="btnMenuDel_Click">
|
||||
</f:MenuButton>
|
||||
</Items>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var treeID = '<%= trWBS.ClientID %>';
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
var menuID2 = '<%= Menu2.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID2).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 保存当前菜单对应的树节点ID
|
||||
var currentNodeId;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
@@ -53,10 +54,12 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.btnMenuModify.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
this.btnMenuDel.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +107,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
e.Node.Nodes.Clear();
|
||||
if (e.Node.CommandName == "cnProfession") //展开专业节点
|
||||
{
|
||||
var unitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Convert.ToInt32(e.Node.NodeID) && x.SuperUnitProject == null orderby x.UnitProjectCode select x;
|
||||
var unitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Convert.ToInt32(e.Node.NodeID) && x.SuperUnitProject == null orderby x.SortIndex select x;
|
||||
foreach (var unitProject in unitProjects)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
@@ -122,15 +125,15 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
else if (e.Node.CommandName == "unitProject") //展开单位工程节点
|
||||
{
|
||||
var childUnitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.SuperUnitProject == e.Node.NodeID orderby x.UnitProjectCode select x;
|
||||
if (childUnitProjects.Count() > 0) //存在子单位工程
|
||||
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.UnitProjectCode == e.Node.NodeID && x.SuperWbsSetCode == null orderby x.WbsSetCode select x;
|
||||
if (wbsSet1s.Count() > 0)
|
||||
{
|
||||
foreach (var childUnitProject in childUnitProjects)
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = childUnitProject.UnitProjectName;
|
||||
newNode.NodeID = childUnitProject.UnitProjectCode;
|
||||
newNode.CommandName = "childUnitProject";
|
||||
newNode.Text = wbsSet1.WbsSetName;
|
||||
newNode.NodeID = wbsSet1.WbsSetCode;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
@@ -140,91 +143,6 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
else //不存在子单位工程,加载分部工程
|
||||
{
|
||||
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
|
||||
if (wbsSet1s.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = wbsSet1.WbsSetName;
|
||||
newNode.NodeID = wbsSet1.WbsSetCode;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var wbsSet3s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 3 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
|
||||
if (wbsSet3s.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet3 in wbsSet3s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = wbsSet3.WbsSetName;
|
||||
newNode.NodeID = wbsSet3.WbsSetCode;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
var childWbsSets = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(wbsSet3.WbsSetCode);
|
||||
if (childWbsSets.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var wbsSet4s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 4 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
|
||||
if (wbsSet4s.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet4 in wbsSet4s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = wbsSet4.WbsSetName;
|
||||
newNode.NodeID = wbsSet4.WbsSetCode;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Node.CommandName == "childUnitProject") //展开子单位工程节点
|
||||
{
|
||||
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == e.Node.NodeID orderby x.WbsSetCode select x;
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = wbsSet1.WbsSetName;
|
||||
newNode.NodeID = wbsSet1.WbsSetCode;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
var childWbsSets = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(wbsSet1.WbsSetCode);
|
||||
if (childWbsSets.Count > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Node.CommandName == "wbsSet") //展开分部/子分部/分项/子分项工程节点
|
||||
{
|
||||
@@ -259,10 +177,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
/// <param name="e"></param>
|
||||
protected void trWBS_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
if (this.Grid1.Rows.Count > 0)
|
||||
{
|
||||
SaveData();
|
||||
}
|
||||
//if (this.Grid1.Rows.Count > 0)
|
||||
//{
|
||||
// SaveData();
|
||||
//}
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
@@ -298,7 +216,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改关闭窗口
|
||||
#region 关闭窗口
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
@@ -306,24 +224,34 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
ShowNotify("修改成功!", MessageBoxIcon.Success);
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
|
||||
getWBSSet();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 拷贝关闭窗口
|
||||
|
||||
/// <summary>
|
||||
/// 拷贝关闭窗口
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
ShowNotify("增加成功!", MessageBoxIcon.Success);
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
|
||||
getWBSSet();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window3_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 右键增加、修改、删除方法
|
||||
@@ -364,6 +292,51 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加费控项
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (!string.IsNullOrEmpty(trWBS.SelectedNodeID))
|
||||
{
|
||||
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.WBSSetMenuId, BLL.Const.BtnAdd))
|
||||
{
|
||||
type = this.trWBS.SelectedNode.CommandName;
|
||||
this.hdSelectId.Text = this.trWBS.SelectedNodeID;
|
||||
Model.WBS_WbsSetInit wbsSet = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(this.trWBS.SelectedNodeID);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
var list = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(this.trWBS.SelectedNodeID);
|
||||
if (list.Count == 0)
|
||||
{
|
||||
operating = "add";
|
||||
string openUrl = String.Format("CostControlInitEdit.aspx?operating=add&Id={0}", trWBS.SelectedNodeID, "增加 - ");
|
||||
PageContext.RegisterStartupScript(Window3.GetShowReference(openUrl));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择工作项节点进行增加!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择工作项节点进行增加!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加
|
||||
/// </summary>
|
||||
@@ -631,62 +604,25 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
this.Grid1.Columns[2].Hidden = true;
|
||||
this.Grid1.Columns[3].Hidden = true;
|
||||
this.Grid1.Columns[4].Hidden = true;
|
||||
List<Model.WBSSetInitItem> items = new List<Model.WBSSetInitItem>();
|
||||
if (this.trWBS.SelectedNode != null)
|
||||
var codeList = BLL.WbsSetMatchCostControlInitService.GetWbsSetMatchCostControlInits(this.trWBS.SelectedNodeID);
|
||||
if (codeList.Count > 0) //存在费控对应关系项
|
||||
{
|
||||
if (this.trWBS.SelectedNode.CommandName == "cnProfession")
|
||||
string codes = string.Empty;
|
||||
foreach (var item in codeList)
|
||||
{
|
||||
Model.WBS_CnProfessionInit cnProfession = BLL.CnProfessionInitService.GetCnProfessionInitByCnProfessionId(this.trWBS.SelectedNode.NodeID);
|
||||
Model.WBSSetInitItem item = new Model.WBSSetInitItem();
|
||||
if (cnProfession != null)
|
||||
{
|
||||
item.Code = this.trWBS.SelectedNode.NodeID;
|
||||
item.Name = cnProfession.CnProfessionName;
|
||||
item.Type = "cnProfession";
|
||||
items.Add(item);
|
||||
}
|
||||
codes += item.CostControlInitCode + ",";
|
||||
}
|
||||
else if (this.trWBS.SelectedNode.CommandName == "unitProject" || this.trWBS.SelectedNode.CommandName == "childUnitProject")
|
||||
{
|
||||
this.Grid1.Columns[4].Hidden = false;
|
||||
Model.Wbs_UnitProjectInit unitProject = BLL.UnitProjectInitService.GetUnitProjectInitByUnitProjectCode(this.trWBS.SelectedNode.NodeID);
|
||||
Model.WBSSetInitItem item = new Model.WBSSetInitItem();
|
||||
if (unitProject != null)
|
||||
{
|
||||
item.Code = this.trWBS.SelectedNode.NodeID;
|
||||
item.Name = unitProject.UnitProjectName;
|
||||
item.Remark = unitProject.Remark;
|
||||
item.Type = "unitProject";
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
else if (this.trWBS.SelectedNode.CommandName == "wbsSet")
|
||||
{
|
||||
this.Grid1.Columns[4].Hidden = false;
|
||||
Model.WBS_WbsSetInit wbsSet = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(this.trWBS.SelectedNode.NodeID);
|
||||
var childWbsSets = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(this.trWBS.SelectedNode.NodeID);
|
||||
if (childWbsSets.Count == 0)
|
||||
{
|
||||
this.Grid1.Columns[2].Hidden = false;
|
||||
this.Grid1.Columns[3].Hidden = false;
|
||||
}
|
||||
Model.WBSSetInitItem item = new Model.WBSSetInitItem();
|
||||
if (wbsSet != null)
|
||||
{
|
||||
item.Code = this.trWBS.SelectedNode.NodeID;
|
||||
item.Name = wbsSet.WbsSetName;
|
||||
item.Type = "wbsSet";
|
||||
item.ControlPoint = wbsSet.ControlPoint;
|
||||
item.ControlItemDef = wbsSet.ControlItemDef;
|
||||
item.Remark = wbsSet.Remark;
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
this.Grid1.DataSource = items;
|
||||
this.Grid1.DataBind();
|
||||
string strSql = "SELECT * FROM WBS_CostControlInit where @CostControlInitCodes like '%'+CostControlInitCode+'%'";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@CostControlInitCodes", codes));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -707,43 +643,18 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据所给Id定位到对应具体的专业、单位工程、子单位工程、分部、子分部、分项、子分项
|
||||
#region 根据所给Id定位到对应具体的专业、单位工程、分部、子分部、分项、子分项
|
||||
/// <summary>
|
||||
/// 根据所给Id定位到对应具体的专业、单位工程、子单位工程、分部、子分部、分项、子分项
|
||||
/// 根据所给Id定位到对应具体的专业、单位工程、分部、子分部、分项、子分项
|
||||
/// </summary>
|
||||
private void getWBSSet()
|
||||
{
|
||||
string CnProfessionCode = string.Empty;
|
||||
string UnitProjectCode = string.Empty;
|
||||
string childUnitProjectCode = string.Empty;
|
||||
string CnProfessionId = String.Empty;
|
||||
string wbsSetParentCode1 = string.Empty;
|
||||
string wbsSetParentCode2 = string.Empty;
|
||||
string wbsSetParentCode3 = string.Empty;
|
||||
|
||||
//if (type.Equals("unitProject"))
|
||||
//{
|
||||
// this.hdSelectId.Text = node.ParentNode.NodeID;
|
||||
// if (!operating.Equals("add"))
|
||||
// {
|
||||
// this.hdSelectId.Text = node.ParentNode.NodeID;
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (type.Equals("cnProfession") && operating.Equals("add"))
|
||||
// {
|
||||
// this.hdSelectId.Text = node.NodeID;
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.hdSelectId.Text = node.ParentNode.NodeID;
|
||||
// }
|
||||
|
||||
|
||||
//}
|
||||
|
||||
Model.WBS_CnProfessionInit cnPro = BLL.CnProfessionInitService.GetCnProfessionInitByCnProfessionId(this.hdSelectId.Text);
|
||||
Model.Wbs_UnitProjectInit UnitProject = BLL.UnitProjectInitService.GetUnitProjectInitByUnitProjectCode(this.hdSelectId.Text);
|
||||
Model.WBS_WbsSetInit wbsSetParm = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(this.hdSelectId.Text);
|
||||
@@ -754,11 +665,6 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
UnitProjectCode = UnitProject.UnitProjectCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
childUnitProjectCode = UnitProject.UnitProjectCode;
|
||||
UnitProjectCode = UnitProject.SuperUnitProject;
|
||||
}
|
||||
Model.WBS_CnProfessionInit cn = BLL.CnProfessionInitService.GetCnProfessionInitByCnProfessionId(UnitProject.CnProfessionId.ToString());
|
||||
if (cn != null)
|
||||
{
|
||||
@@ -781,11 +687,6 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
UnitProjectCode = unitpro.UnitProjectCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
childUnitProjectCode = unitpro.UnitProjectCode;
|
||||
UnitProjectCode = unitpro.SuperUnitProject;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(wbsSetParm.SuperWbsSetCode))
|
||||
{
|
||||
wbsSetParentCode1 = wbsSetParm.SuperWbsSetCode;
|
||||
@@ -858,7 +759,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
if (cnProfession.CnProfessionId.ToString().Equals(CnProfessionCode))
|
||||
{
|
||||
newCnProfessionNode.Expanded = true;
|
||||
var UnitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId.ToString() == CnProfessionCode && x.SuperUnitProject == null orderby x.UnitProjectCode select x;
|
||||
var UnitProjects = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId.ToString() == CnProfessionCode && x.SuperUnitProject == null orderby x.SortIndex select x;
|
||||
foreach (var unitProject in UnitProjects)
|
||||
{
|
||||
TreeNode newNodeUnitPorject = new TreeNode();
|
||||
@@ -878,269 +779,126 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(childUnitProjectCode))//存在子单位工程
|
||||
if (wbsSetParm != null)
|
||||
{
|
||||
|
||||
newNodeUnitPorject.Expanded = true;
|
||||
var childUnitProjects = BLL.UnitProjectInitService.GetUnitProjectInitsBySuperUnitProject(newNodeUnitPorject.NodeID);
|
||||
foreach (var childUnitProject in childUnitProjects)
|
||||
{
|
||||
TreeNode newChildUnitProjectNode = new TreeNode();
|
||||
newChildUnitProjectNode.Text = childUnitProject.UnitProjectName;
|
||||
newChildUnitProjectNode.NodeID = childUnitProject.UnitProjectCode;
|
||||
newChildUnitProjectNode.CommandName = "childUnitProject";
|
||||
newChildUnitProjectNode.ToolTip = childUnitProject.UnitProjectCode;
|
||||
newChildUnitProjectNode.EnableExpandEvent = true;
|
||||
newChildUnitProjectNode.EnableClickEvent = true;
|
||||
|
||||
newNodeUnitPorject.Nodes.Add(newChildUnitProjectNode);
|
||||
if (wbsSetParm != null)
|
||||
{
|
||||
if (wbsSetParm.UnitProjectCode != childUnitProject.UnitProjectCode)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newChildUnitProjectNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
newChildUnitProjectNode.Expanded = true;
|
||||
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == wbsSetParm.UnitProjectCode orderby x.WbsSetCode select x;
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newwbsSet1Node = new TreeNode();
|
||||
newwbsSet1Node.Text = wbsSet1.WbsSetName;
|
||||
newwbsSet1Node.NodeID = wbsSet1.WbsSetCode;
|
||||
newwbsSet1Node.CommandName = "wbsSet";
|
||||
newwbsSet1Node.ToolTip = wbsSet1.WbsSetCode;
|
||||
newwbsSet1Node.EnableExpandEvent = true;
|
||||
newwbsSet1Node.EnableClickEvent = true;
|
||||
|
||||
newChildUnitProjectNode.Nodes.Add(newwbsSet1Node);
|
||||
var childWbsSets2 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet1Node.NodeID);
|
||||
if (childWbsSets2.Count() > 0)
|
||||
{
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet1.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet1Node.Expanded = true;
|
||||
foreach (var wbsSet2 in childWbsSets2)
|
||||
{
|
||||
TreeNode newwbsSet2Node = new TreeNode();
|
||||
newwbsSet2Node.Text = wbsSet2.WbsSetName;
|
||||
newwbsSet2Node.NodeID = wbsSet2.WbsSetCode;
|
||||
newwbsSet2Node.CommandName = "wbsSet";
|
||||
newwbsSet2Node.ToolTip = wbsSet2.WbsSetCode;
|
||||
newwbsSet2Node.EnableExpandEvent = true;
|
||||
newwbsSet2Node.EnableClickEvent = true;
|
||||
newwbsSet1Node.Nodes.Add(newwbsSet2Node);
|
||||
var childWbsSets3 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet2Node.NodeID);
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet2.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet2Node.Expanded = true;
|
||||
if (childWbsSets3.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet3 in childWbsSets3)
|
||||
{
|
||||
TreeNode newwbsSet3Node = new TreeNode();
|
||||
newwbsSet3Node.Text = wbsSet3.WbsSetName;
|
||||
newwbsSet3Node.NodeID = wbsSet3.WbsSetCode;
|
||||
newwbsSet3Node.CommandName = "wbsSet";
|
||||
newwbsSet3Node.ToolTip = wbsSet3.WbsSetCode;
|
||||
newwbsSet3Node.EnableExpandEvent = true;
|
||||
newwbsSet3Node.EnableClickEvent = true;
|
||||
newwbsSet2Node.Nodes.Add(newwbsSet3Node);
|
||||
var childWbsSets4 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet3Node.NodeID);
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet3.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet3Node.Expanded = true;
|
||||
if (childWbsSets4.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet4 in childWbsSets4)
|
||||
{
|
||||
TreeNode newwbsSet4Node = new TreeNode();
|
||||
newwbsSet4Node.Text = wbsSet4.WbsSetName;
|
||||
newwbsSet4Node.NodeID = wbsSet4.WbsSetCode;
|
||||
newwbsSet4Node.CommandName = "wbsSet";
|
||||
newwbsSet4Node.ToolTip = wbsSet4.WbsSetCode;
|
||||
newwbsSet4Node.EnableExpandEvent = true;
|
||||
newwbsSet4Node.EnableClickEvent = true;
|
||||
|
||||
newwbsSet3Node.Nodes.Add(newwbsSet4Node);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (childWbsSets4.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet3Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (childWbsSets3.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet2Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet1Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newChildUnitProjectNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
#region 不存在子单位工程
|
||||
if (wbsSetParm != null)
|
||||
{
|
||||
if (wbsSetParm.UnitProjectCode != UnitProjectCode)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNodeUnitPorject.Nodes.Add(emptyNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
newNodeUnitPorject.Expanded = true;
|
||||
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.Flag == 1 && x.UnitProjectCode == UnitProjectCode orderby x.WbsSetCode select x;
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newwbsSet1Node = new TreeNode();
|
||||
newwbsSet1Node.Text = wbsSet1.WbsSetName;
|
||||
newwbsSet1Node.NodeID = wbsSet1.WbsSetCode;
|
||||
newwbsSet1Node.CommandName = "wbsSet";
|
||||
newwbsSet1Node.ToolTip = wbsSet1.WbsSetCode;
|
||||
newwbsSet1Node.EnableExpandEvent = true;
|
||||
newwbsSet1Node.EnableClickEvent = true;
|
||||
newNodeUnitPorject.Nodes.Add(newwbsSet1Node);
|
||||
var childWbsSets2 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet1Node.NodeID);
|
||||
if (childWbsSets2.Count() > 0)
|
||||
{
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet1.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
|
||||
foreach (var wbsSet2 in childWbsSets2)
|
||||
{
|
||||
if (wbsSet1.WbsSetCode == wbsSet2.SuperWbsSetCode)
|
||||
{
|
||||
newwbsSet1Node.Expanded = true;
|
||||
}
|
||||
TreeNode newwbsSet2Node = new TreeNode();
|
||||
newwbsSet2Node.Text = wbsSet2.WbsSetName;
|
||||
newwbsSet2Node.NodeID = wbsSet2.WbsSetCode;
|
||||
newwbsSet2Node.CommandName = "wbsSet";
|
||||
newwbsSet2Node.ToolTip = wbsSet2.WbsSetCode;
|
||||
newwbsSet2Node.EnableExpandEvent = true;
|
||||
newwbsSet2Node.EnableClickEvent = true;
|
||||
newwbsSet1Node.Nodes.Add(newwbsSet2Node);
|
||||
var childWbsSets3 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet2Node.NodeID);
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet2.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet2Node.Expanded = true;
|
||||
if (childWbsSets3.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet3 in childWbsSets3)
|
||||
{
|
||||
TreeNode newwbsSet3Node = new TreeNode();
|
||||
newwbsSet3Node.Text = wbsSet3.WbsSetName;
|
||||
newwbsSet3Node.NodeID = wbsSet3.WbsSetCode;
|
||||
newwbsSet3Node.CommandName = "wbsSet";
|
||||
newwbsSet3Node.ToolTip = wbsSet3.WbsSetCode;
|
||||
newwbsSet3Node.EnableExpandEvent = true;
|
||||
newwbsSet3Node.EnableClickEvent = true;
|
||||
newwbsSet2Node.Nodes.Add(newwbsSet3Node);
|
||||
var childWbsSets4 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet3Node.NodeID);
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet3.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet3Node.Expanded = true;
|
||||
if (childWbsSets4.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet4 in childWbsSets4)
|
||||
{
|
||||
TreeNode newwbsSet4Node = new TreeNode();
|
||||
newwbsSet4Node.Text = wbsSet4.WbsSetName;
|
||||
newwbsSet4Node.NodeID = wbsSet4.WbsSetCode;
|
||||
newwbsSet4Node.CommandName = "wbsSet";
|
||||
newwbsSet4Node.ToolTip = wbsSet4.WbsSetCode;
|
||||
newwbsSet4Node.EnableExpandEvent = true;
|
||||
newwbsSet4Node.EnableClickEvent = true;
|
||||
newwbsSet3Node.Nodes.Add(newwbsSet4Node);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (childWbsSets4.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet3Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (childWbsSets3.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet2Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet1Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (wbsSetParm.UnitProjectCode != UnitProjectCode)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNodeUnitPorject.Nodes.Add(emptyNode);
|
||||
}
|
||||
#endregion
|
||||
else
|
||||
{
|
||||
newNodeUnitPorject.Expanded = true;
|
||||
var wbsSet1s = from x in Funs.DB.WBS_WbsSetInit where x.UnitProjectCode == UnitProjectCode && x.SuperWbsSetCode == null orderby x.WbsSetCode select x;
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newwbsSet1Node = new TreeNode();
|
||||
newwbsSet1Node.Text = wbsSet1.WbsSetName;
|
||||
newwbsSet1Node.NodeID = wbsSet1.WbsSetCode;
|
||||
newwbsSet1Node.CommandName = "wbsSet";
|
||||
newwbsSet1Node.ToolTip = wbsSet1.WbsSetCode;
|
||||
newwbsSet1Node.EnableExpandEvent = true;
|
||||
newwbsSet1Node.EnableClickEvent = true;
|
||||
newNodeUnitPorject.Nodes.Add(newwbsSet1Node);
|
||||
var childWbsSets2 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet1Node.NodeID);
|
||||
if (childWbsSets2.Count() > 0)
|
||||
{
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet1.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
|
||||
foreach (var wbsSet2 in childWbsSets2)
|
||||
{
|
||||
if (wbsSet1.WbsSetCode == wbsSet2.SuperWbsSetCode)
|
||||
{
|
||||
newwbsSet1Node.Expanded = true;
|
||||
}
|
||||
TreeNode newwbsSet2Node = new TreeNode();
|
||||
newwbsSet2Node.Text = wbsSet2.WbsSetName;
|
||||
newwbsSet2Node.NodeID = wbsSet2.WbsSetCode;
|
||||
newwbsSet2Node.CommandName = "wbsSet";
|
||||
newwbsSet2Node.ToolTip = wbsSet2.WbsSetCode;
|
||||
newwbsSet2Node.EnableExpandEvent = true;
|
||||
newwbsSet2Node.EnableClickEvent = true;
|
||||
newwbsSet1Node.Nodes.Add(newwbsSet2Node);
|
||||
var childWbsSets3 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet2Node.NodeID);
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet2.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet2Node.Expanded = true;
|
||||
if (childWbsSets3.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet3 in childWbsSets3)
|
||||
{
|
||||
TreeNode newwbsSet3Node = new TreeNode();
|
||||
newwbsSet3Node.Text = wbsSet3.WbsSetName;
|
||||
newwbsSet3Node.NodeID = wbsSet3.WbsSetCode;
|
||||
newwbsSet3Node.CommandName = "wbsSet";
|
||||
newwbsSet3Node.ToolTip = wbsSet3.WbsSetCode;
|
||||
newwbsSet3Node.EnableExpandEvent = true;
|
||||
newwbsSet3Node.EnableClickEvent = true;
|
||||
newwbsSet2Node.Nodes.Add(newwbsSet3Node);
|
||||
var childWbsSets4 = BLL.WbsSetInitService.GetWbsSetInitsBySuperWbsSetCode(newwbsSet3Node.NodeID);
|
||||
if (BLL.WbsSetInitService.IsExitWbsSetById2(wbsSet3.WbsSetCode, wbsSetParm.WbsSetCode))
|
||||
{
|
||||
newwbsSet3Node.Expanded = true;
|
||||
if (childWbsSets4.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet4 in childWbsSets4)
|
||||
{
|
||||
TreeNode newwbsSet4Node = new TreeNode();
|
||||
newwbsSet4Node.Text = wbsSet4.WbsSetName;
|
||||
newwbsSet4Node.NodeID = wbsSet4.WbsSetCode;
|
||||
newwbsSet4Node.CommandName = "wbsSet";
|
||||
newwbsSet4Node.ToolTip = wbsSet4.WbsSetCode;
|
||||
newwbsSet4Node.EnableExpandEvent = true;
|
||||
newwbsSet4Node.EnableClickEvent = true;
|
||||
newwbsSet3Node.Nodes.Add(newwbsSet4Node);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (childWbsSets4.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet3Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (childWbsSets3.Count() > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet2Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newwbsSet1Node.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNodeUnitPorject.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1182,5 +940,47 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuModify_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("CostControlInitEdit.aspx?type=modify&Id={0}&Code={1}", this.Grid1.SelectedRowID,this.trWBS.SelectedNodeID, "修改 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.WBS_CostControlInit costControl = BLL.CostControlInitService.GetCostControlInitByCostControlInitId(Grid1.SelectedRowID);
|
||||
if (costControl != null)
|
||||
{
|
||||
BLL.WbsSetMatchCostControlInitService.DeleteWbsSetMatchCostControlInitByWbsSetCodeAndCostControlInitCode(this.trWBS.SelectedNodeID,costControl.CostControlInitCode);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, Grid1.SelectedRowID, Grid1.SelectedRowID, BLL.Const.ProjectControlPointMenuId, "删除费用对应关系");
|
||||
Grid1.DataBind();
|
||||
BindGrid();
|
||||
Alert.ShowInTop("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+40
-4
@@ -94,22 +94,22 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label4;
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// btnAdd 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
protected global::FineUIPro.Button btnAdd;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
@@ -156,6 +156,15 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// Window3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window3;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
@@ -191,5 +200,32 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
|
||||
/// <summary>
|
||||
/// Menu2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu2;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuModify 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuModify;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>单位、分部、分项工程设置</title>
|
||||
<title>分部、工作项及费用清单设置</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner
|
||||
@@ -37,6 +37,11 @@
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -45,15 +50,15 @@
|
||||
<f:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server" Margin="5px">
|
||||
<Regions>
|
||||
<f:Region ID="Region1" ShowBorder="false" ShowHeader="false" RegionPosition="Left"
|
||||
Title="单位、分部、分项工程审核与发布" BodyPadding="0 5 0 0" Width="300px" Layout="Fit" runat="server"
|
||||
Title="分部、工作项及费用清单设置" BodyPadding="0 5 0 0" Width="300px" Layout="Fit" runat="server"
|
||||
EnableCollapse="true">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panel2" RegionPosition="Left" RegionSplit="true" EnableCollapse="true"
|
||||
Width="400" Title="单位、分部、分项工程设置" TitleToolTip="单位、分部、分项工程设置" ShowBorder="true"
|
||||
Width="400" Title="分部、工作项及费用清单设置" TitleToolTip="分部、工作项及费用清单设置" ShowBorder="true"
|
||||
ShowHeader="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Region">
|
||||
<Items>
|
||||
<f:Tree ID="trWBS" Width="290" EnableCollapse="true" ShowHeader="true" OnNodeCommand="trWBS_NodeCommand"
|
||||
OnNodeExpand="trWBS_NodeExpand" OnNodeCheck="trWBS_NodeCheck"
|
||||
OnNodeExpand="trWBS_NodeExpand" OnNodeCheck="trWBS_NodeCheck" EnableCheckBox="true" OnlyLeafCheck="true"
|
||||
AutoLeafIdentification="true" runat="server">
|
||||
<Listeners>
|
||||
<f:Listener Event="beforenodecontextmenu" Handler="onTreeNodeContextMenu" />
|
||||
@@ -68,93 +73,72 @@
|
||||
<f:Region ID="Region2" ShowBorder="false" ShowHeader="false" Position="Center" Layout="VBox"
|
||||
BoxConfigAlign="Stretch" BoxConfigPosition="Left" runat="server">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="Id" AllowSorting="true" EnableColumnLines="true"
|
||||
SortField="Id" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ShowSelectedCell="true"
|
||||
DataIDField="Id" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="CostControlId" AllowSorting="true" EnableColumnLines="true"
|
||||
SortField="CostControlCode,CostControlName" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ShowSelectedCell="true"
|
||||
DataIDField="CostControlId" AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
OnRowDataBound="Grid1_RowDataBound" AllowFilters="true" OnFilterChange="Grid1_FilterChange">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip ="保存" OnClick="btnSave_Click">
|
||||
<f:Button ID="btnAdd" Icon="Add" runat="server" ToolTip="增加" Hidden="true"
|
||||
OnClick="btnAdd_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" runat="server" ToolTip="导出WBS" Icon="FolderUp" OnClick="btnOut_Click">
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip ="保存" Hidden="true" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" ToolTip="导入" Icon="ApplicationGet" runat="server"
|
||||
<%--<f:Button ID="btnOut" runat="server" ToolTip="导出WBS" Icon="FolderUp" OnClick="btnOut_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" ToolTip="导入" Icon="ApplicationGet" runat="server"
|
||||
OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
</f:Button>--%>
|
||||
</Items>
|
||||
<Items>
|
||||
<%--<Items>
|
||||
<f:Label ID="red" runat="server" CssClass="customlabel" Text="桔黄色:开始和结束日期不在上一级的开始和结束日期之间或者开始日期大于结束日期 红色:未审批">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</Items>--%>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="Code" DataField="Code" FieldType="String"
|
||||
HeaderText="编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="100px" ColumnID="CostControlCode" DataField="CostControlCode" FieldType="String"
|
||||
HeaderText="费用清单编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="Name" DataField="Name" FieldType="String"
|
||||
HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="400px" ColumnID="CostControlName" DataField="CostControlName" FieldType="String"
|
||||
HeaderText="内容" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="139px" ColumnID="StartDate" DataField="StartDate" FieldType="Date"
|
||||
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="进度计划开始日期" HeaderTextAlign="Center">
|
||||
<f:RenderField Width="70px" ColumnID="Unit" DataField="Unit" FieldType="String"
|
||||
HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="130px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double"
|
||||
HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:DatePicker ID="DatePicker1" Required="true" runat="server">
|
||||
</f:DatePicker>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="139px" ColumnID="EndDate" DataField="EndDate" FieldType="Date"
|
||||
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="进度计划结束日期" HeaderTextAlign="Center">
|
||||
<Editor>
|
||||
<f:DatePicker ID="DatePicker2" Required="true" runat="server">
|
||||
</f:DatePicker>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="Type" DataField="Type" Hidden="true" FieldType="String"
|
||||
HeaderText="类型" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ControlPoint" DataField="ControlPoint" FieldType="String"
|
||||
Hidden="true" HeaderText="等级" HeaderTextAlign="Center" TextAlign="Left" EnableColumnEdit="true">
|
||||
<Editor>
|
||||
<f:DropDownList ID="drpControlPoint" runat="server" Label="">
|
||||
<f:ListItem Value="0" Text="-请选择-" />
|
||||
<f:ListItem Value="A级" Text="A级" />
|
||||
<f:ListItem Value="AH级" Text="AH级" />
|
||||
<f:ListItem Value="B级" Text="B级" />
|
||||
<f:ListItem Value="BH级" Text="BH级" />
|
||||
<f:ListItem Value="C级" Text="C级" />
|
||||
<f:ListItem Value="H级" Text="H级" />
|
||||
</f:DropDownList>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Cycle" DataField="Cycle" FieldType="Int" HeaderText="周期"
|
||||
Hidden="true" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbCycle" NoDecimal="true" NoNegative="true" MinValue="0" runat="server">
|
||||
<f:NumberBox ID="nbTotalNum" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Frequency" DataField="Frequency" FieldType="Int"
|
||||
Hidden="true" HeaderText="频次" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="100px" ColumnID="RealPrice" DataField="RealPrice" FieldType="Double"
|
||||
HeaderText="成本单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbFrequency" NoDecimal="true" NoNegative="true" MinValue="0" runat="server">
|
||||
<f:NumberBox ID="nbRealPrice" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="ControlItemDef" DataField="ControlItemDef"
|
||||
Hidden="true" FieldType="String" HeaderText="内容" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<f:RenderField Width="100px" ColumnID="PlanPrice" DataField="PlanPrice" FieldType="Double"
|
||||
HeaderText="控制预算单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbPlanPrice" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="ID" ColumnID="Id" DataField="Id" FieldType="String" Hidden="true">
|
||||
<f:RenderField Width="70px" ColumnID="CostControlId" DataField="CostControlId" FieldType="String"
|
||||
HeaderText="主键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true">
|
||||
</f:RenderField>
|
||||
<f:TemplateField Width="80px" HeaderText="勾选" HeaderTextAlign="Center" ID="IsApprove"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="cbIsApprove" runat="server" AutoPostBack="True" OnCheckedChanged="cbIsApprove_CheckedChanged">
|
||||
</asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
@@ -162,10 +146,10 @@
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="10" Value="10" />
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
<f:ListItem Text="100" Value="100" />
|
||||
<f:ListItem Text="200" Value="200" />
|
||||
<f:ListItem Text="300" Value="300" />
|
||||
<f:ListItem Text="400" Value="400" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
@@ -175,41 +159,65 @@
|
||||
</f:RegionPanel>
|
||||
<f:Window ID="Window1" Title="编辑" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="800px" Height="300px">
|
||||
Width="800px" Height="350px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="拷贝" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="800px" Height="400px">
|
||||
Width="800px" Height="450px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window3" Title="导入/导出WBS信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="1000px"
|
||||
Height="620px">
|
||||
<f:Window ID="Window3" Title="编辑" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="800px" OnClose="Window3_Close"
|
||||
Height="350px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window4" Title="设置计划" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="800px"
|
||||
Height="550px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuAdd" OnClick="btnMenuAdd_Click" EnablePostBack="true" runat="server"
|
||||
<f:MenuButton ID="btnMenuAdd" OnClick="btnMenuAdd_Click" EnablePostBack="true" runat="server" Icon="Add"
|
||||
Text="增加" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true" Icon="Pencil"
|
||||
runat="server" Text="修改" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuCopy" OnClick="btnMenuCopy_Click" EnablePostBack="true"
|
||||
<f:MenuButton ID="btnMenuCopy" OnClick="btnMenuCopy_Click" EnablePostBack="true" Icon="PageCopy"
|
||||
runat="server" Text="拷贝" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuCopy2" OnClick="btnMenuCopy2_Click" EnablePostBack="true"
|
||||
<%--<f:MenuButton ID="btnMenuCopy2" OnClick="btnMenuCopy2_Click" EnablePostBack="true"
|
||||
runat="server" Text="分级" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
</f:MenuButton>--%>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
|
||||
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuAudit" OnClick="btnMenuAudit_Click" EnablePostBack="true"
|
||||
<%--<f:MenuButton ID="btnMenuAudit" OnClick="btnMenuAudit_Click" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="审核" ConfirmTitle="是否确定通过此项及其子项的审核?">
|
||||
</f:MenuButton>
|
||||
</f:MenuButton>--%>
|
||||
</f:Menu>
|
||||
<f:Menu ID="Menu2" runat="server">
|
||||
<Items>
|
||||
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"
|
||||
OnClick="btnMenuModify_Click">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDetail" EnablePostBack="true" runat="server" Hidden="true" Text="设置计划" Icon="ApplicationViewDetail"
|
||||
OnClick="btnMenuDetail_Click">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Hidden="true" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
|
||||
OnClick="btnMenuDel_Click">
|
||||
</f:MenuButton>
|
||||
</Items>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var treeID = '<%= trWBS.ClientID %>';
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
var menuID2 = '<%= Menu2.ClientID %>';
|
||||
var btn = '<%= btnSave.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID2).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 保存当前菜单对应的树节点ID
|
||||
var currentNodeId;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+53
-80
@@ -102,6 +102,15 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAdd 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAdd;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
@@ -112,94 +121,31 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// nbTotalNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
protected global::FineUIPro.NumberBox nbTotalNum;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// nbRealPrice 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
protected global::FineUIPro.NumberBox nbRealPrice;
|
||||
|
||||
/// <summary>
|
||||
/// red 控件。
|
||||
/// nbPlanPrice 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label red;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker DatePicker1;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker DatePicker2;
|
||||
|
||||
/// <summary>
|
||||
/// drpControlPoint 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpControlPoint;
|
||||
|
||||
/// <summary>
|
||||
/// nbCycle 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbCycle;
|
||||
|
||||
/// <summary>
|
||||
/// nbFrequency 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbFrequency;
|
||||
|
||||
/// <summary>
|
||||
/// IsApprove 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TemplateField IsApprove;
|
||||
|
||||
/// <summary>
|
||||
/// cbIsApprove 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox cbIsApprove;
|
||||
protected global::FineUIPro.NumberBox nbPlanPrice;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
@@ -255,6 +201,15 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window3;
|
||||
|
||||
/// <summary>
|
||||
/// Window4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window4;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
@@ -291,15 +246,6 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuCopy;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuCopy2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuCopy2;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
@@ -310,12 +256,39 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuAudit 控件。
|
||||
/// Menu2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuAudit;
|
||||
protected global::FineUIPro.Menu Menu2;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuModify 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuModify;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDetail 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDetail;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trWbsSet2" Hidden="true">
|
||||
<Items>
|
||||
<f:TextArea ID="txtControlItemDef" runat="server" MaxLength="500" Label="内容" LabelWidth="150px"></f:TextArea>
|
||||
<f:NumberBox ID="txtWeights" runat="server" Label="权重(%)" NoDecimal="true" LabelWidth="150px"></f:NumberBox>
|
||||
<f:Label runat="server" ID="Label1" Text="">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trSortIndex">
|
||||
@@ -52,10 +54,10 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存数据" ValidateForms="SimpleForm1"
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
<f:HiddenField ID="hdCompileMan" runat="server"></f:HiddenField>
|
||||
</Items>
|
||||
|
||||
@@ -30,11 +30,13 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", cnProfession.EndDate);
|
||||
}
|
||||
}
|
||||
else if (type == "unitProject" || type == "childUnitProject")
|
||||
else if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
{
|
||||
txtCode.Text = GetNewCode(unitProject.UnitProjectCode, 0, "wbsSet");
|
||||
this.txtCode.Readonly = true;
|
||||
if (unitProject.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.StartDate);
|
||||
@@ -47,6 +49,8 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(id);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
txtCode.Text = GetNewCode(wbsSet.WbsSetCode, 0, "wbsSet");
|
||||
this.txtCode.Readonly = true;
|
||||
if (wbsSet.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", wbsSet.StartDate);
|
||||
@@ -54,48 +58,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "installation")
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
|
||||
if (installation != null)
|
||||
{
|
||||
if (installation.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", installation.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", installation.EndDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else //修改
|
||||
{
|
||||
if (type == "installation")
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
|
||||
if (installation != null)
|
||||
{
|
||||
txtCode.Text = installation.InstallationCode;
|
||||
txtName.Text = installation.InstallationName;
|
||||
if (installation.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", installation.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", installation.EndDate);
|
||||
}
|
||||
txtRemark.Text = installation.Def;
|
||||
this.trSortIndex.Hidden = true;
|
||||
this.trUnit.Hidden = false;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = BLL.UnitService.GetUnitByProjectIdList(installation.ProjectId);
|
||||
this.drpUnit.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
if (!string.IsNullOrEmpty(installation.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = installation.UnitId;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "unitProject" || type == "childUnitProject")
|
||||
if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
@@ -107,6 +73,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.EndDate);
|
||||
}
|
||||
if (unitProject.SortIndex != null)
|
||||
{
|
||||
txtSortIndex.Text = unitProject.SortIndex.ToString();
|
||||
}
|
||||
txtRemark.Text = unitProject.Remark;
|
||||
}
|
||||
}
|
||||
@@ -126,13 +96,16 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
if (BLL.WbsSetService.GetWbsSetsBySuperWbsSetId(id).Count == 0) //末级节点
|
||||
{
|
||||
this.trWbsSet2.Hidden = false;
|
||||
txtControlItemDef.Text = wbsSet.ControlItemDef;
|
||||
if (wbsSet.Weights != null)
|
||||
{
|
||||
txtWeights.Text = wbsSet.Weights.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "cnProfession")
|
||||
{
|
||||
this.trUnit.Hidden = false;
|
||||
//this.trUnit.Hidden = false;
|
||||
Model.WBS_CnProfession cnProfession = BLL.CnProfessionService.GetCnProfessionByCnProfessionId(id);
|
||||
if (cnProfession != null)
|
||||
{
|
||||
@@ -145,21 +118,72 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
this.trSortIndex.Hidden = true;
|
||||
this.txtRemark.Hidden = true;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = BLL.UnitService.GetUnitByProjectIdList(cnProfession.ProjectId);
|
||||
this.drpUnit.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
if (!string.IsNullOrEmpty(cnProfession.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = cnProfession.UnitId;
|
||||
}
|
||||
//this.drpUnit.DataTextField = "UnitName";
|
||||
//this.drpUnit.DataValueField = "UnitId";
|
||||
//this.drpUnit.DataSource = BLL.UnitService.GetUnitByProjectIdList(cnProfession.ProjectId);
|
||||
//this.drpUnit.DataBind();
|
||||
//Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
//if (!string.IsNullOrEmpty(cnProfession.UnitId))
|
||||
//{
|
||||
// this.drpUnit.SelectedValue = cnProfession.UnitId;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 获取编号
|
||||
/// <summary>
|
||||
/// 获取编号
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="i"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
private string GetNewCode(string code, int i, string type)
|
||||
{
|
||||
string newCode = string.Empty;
|
||||
string testCode = string.Empty;
|
||||
string istr = string.Empty;
|
||||
i++;
|
||||
if (i < 10)
|
||||
{
|
||||
istr = "0" + i.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
istr = i.ToString();
|
||||
}
|
||||
testCode = string.Empty;
|
||||
|
||||
|
||||
testCode = code + istr;
|
||||
if (BLL.WbsSetService.GetWbsSetByWbsSetCode(testCode, this.CurrUser.LoginProjectId) == null)
|
||||
{
|
||||
newCode = testCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
i++;
|
||||
if (i < 10)
|
||||
{
|
||||
istr = "0" + i.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
istr = i.ToString();
|
||||
}
|
||||
testCode = code + istr;
|
||||
} while (BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(testCode) != null);
|
||||
newCode = testCode;
|
||||
}
|
||||
return newCode;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
@@ -206,7 +230,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
BLL.UnitProjectService.AddUnitProject(unitProject);
|
||||
}
|
||||
else if (type == "unitProject" || type == "childUnitProject")
|
||||
else if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
@@ -232,7 +256,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.SortIndex = Convert.ToInt32(txtSortIndex.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtWeights.Text.Trim()))
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewDecimal(this.txtWeights.Text.Trim());
|
||||
}
|
||||
BLL.WbsSetService.AddWbsSet(wbsSet);
|
||||
}
|
||||
else if (type == "wbsSet")
|
||||
@@ -261,7 +288,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.SortIndex = Convert.ToInt32(txtSortIndex.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtWeights.Text.Trim()))
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewDecimal(this.txtWeights.Text.Trim());
|
||||
}
|
||||
BLL.WbsSetService.AddWbsSet(wbsSet);
|
||||
}
|
||||
else if (type == "installation")
|
||||
@@ -295,7 +325,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
else //修改
|
||||
{
|
||||
if (type == "unitProject" || type == "childUnitProject")
|
||||
if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
@@ -326,7 +356,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.SortIndex = Convert.ToInt32(txtSortIndex.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtWeights.Text.Trim()))
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewDecimal(this.txtWeights.Text.Trim());
|
||||
}
|
||||
BLL.WbsSetService.UpdateWbsSet(wbsSet);
|
||||
}
|
||||
}
|
||||
@@ -339,10 +372,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
cnProfession.CnProfessionName = txtName.Text.Trim();
|
||||
cnProfession.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
cnProfession.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
cnProfession.UnitId = this.drpUnit.SelectedValue;
|
||||
}
|
||||
//if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// cnProfession.UnitId = this.drpUnit.SelectedValue;
|
||||
//}
|
||||
BLL.CnProfessionService.UpdateCnProfession(cnProfession);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-2
@@ -85,13 +85,22 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
protected global::FineUIPro.FormRow trWbsSet2;
|
||||
|
||||
/// <summary>
|
||||
/// txtControlItemDef 控件。
|
||||
/// txtWeights 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtControlItemDef;
|
||||
protected global::FineUIPro.NumberBox txtWeights;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// trSortIndex 控件。
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCode" runat="server" Label="编号" LabelWidth="150px" Required="true" ShowRedStar="true" FocusOnPageLoad="true"></f:TextBox>
|
||||
<f:TextBox ID="txtCode" runat="server" Label="编号" Readonly="true" LabelWidth="150px" Required="true" ShowRedStar="true" ></f:TextBox>
|
||||
<f:TextBox ID="txtName" runat="server" Label="名称" LabelWidth="150px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
@@ -25,17 +25,6 @@
|
||||
<f:DatePicker runat="server" Label="进度计划结束日期" ID="txtEndDate" Required="true" ShowRedStar="true" LabelWidth="150px"></f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trWbsSet1" Hidden="true">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpControlPoint" runat="server" Label="等级" LabelWidth="150px" >
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trWbsSet2" Hidden="true">
|
||||
<Items>
|
||||
<f:TextArea ID="txtControlItemDef" runat="server" MaxLength="500" Label="内容" LabelWidth="150px" ></f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtSortIndex" runat="server" Label="排序" NoDecimal="true" LabelWidth="150px" ></f:NumberBox>
|
||||
|
||||
@@ -19,21 +19,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
LoadData();
|
||||
string id = Request.Params["Id"];
|
||||
string type = Request.Params["Type"];
|
||||
if (type == "childUnitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
{
|
||||
txtCode.Text = unitProject.UnitProjectCode;
|
||||
if (unitProject.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.EndDate);
|
||||
}
|
||||
txtRemark.Text = unitProject.Remark;
|
||||
}
|
||||
}
|
||||
else if (type == "wbsSet")
|
||||
if (type == "wbsSet")
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(id);
|
||||
if (wbsSet != null)
|
||||
@@ -90,226 +76,188 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
string updateId = string.Empty;
|
||||
string id = Request.Params["Id"];
|
||||
string type = Request.Params["Type"];
|
||||
if (type == "childUnitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject childUnitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
childUnitProject.IsSelected = true;
|
||||
childUnitProject.IsApprove = true;
|
||||
BLL.UnitProjectService.UpdateUnitProject(childUnitProject);
|
||||
var noShowWbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == childUnitProject.UnitProjectId && x.NoShow == true orderby x.WbsSetCode select x;
|
||||
if (noShowWbsSet1s.Count() == 0) //首次拷贝
|
||||
{
|
||||
noShowWbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == childUnitProject.UnitProjectId orderby x.WbsSetCode select x;
|
||||
foreach (var noShowWbsSet1 in noShowWbsSet1s)
|
||||
{
|
||||
noShowWbsSet1.NoShow = true;
|
||||
BLL.WbsSetService.UpdateWbsSet(noShowWbsSet1);
|
||||
}
|
||||
Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
updateId = newWbsSet1.WbsSetId;
|
||||
newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
newWbsSet1.CnProfessionId = childUnitProject.CnProfessionId;
|
||||
newWbsSet1.UnitProjectId = childUnitProject.UnitProjectId;
|
||||
newWbsSet1.InstallationId = childUnitProject.InstallationId;
|
||||
newWbsSet1.SuperWbsSetId = null;
|
||||
newWbsSet1.ProjectId = childUnitProject.ProjectId;
|
||||
newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
{
|
||||
newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
newWbsSet1.Flag = 1;
|
||||
newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
newWbsSet1.IsIn = false;
|
||||
newWbsSet1.IsSelected = true;
|
||||
newWbsSet1.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
noShowWbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.Flag == 1 && x.UnitProjectId == childUnitProject.UnitProjectId && x.NoShow == true orderby x.WbsSetCode select x;
|
||||
foreach (var noShowWbsSet1 in noShowWbsSet1s)
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, childUnitProject.UnitProjectCode);
|
||||
newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
newWbsSet2.UnitProjectId = childUnitProject.UnitProjectId;
|
||||
newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
newWbsSet1.SortIndex = noShowWbsSet1.SortIndex;
|
||||
newWbsSet2.Flag = 2;
|
||||
newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
newWbsSet2.IsIn = false;
|
||||
newWbsSet2.IsSelected = true;
|
||||
newWbsSet2.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
}
|
||||
}
|
||||
else //后续拷贝
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
updateId = newWbsSet1.WbsSetId;
|
||||
newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
newWbsSet1.CnProfessionId = childUnitProject.CnProfessionId;
|
||||
newWbsSet1.UnitProjectId = childUnitProject.UnitProjectId;
|
||||
newWbsSet1.InstallationId = childUnitProject.InstallationId;
|
||||
newWbsSet1.SuperWbsSetId = null;
|
||||
newWbsSet1.ProjectId = childUnitProject.ProjectId;
|
||||
newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
{
|
||||
newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
newWbsSet1.Flag = 1;
|
||||
newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
newWbsSet1.IsIn = false;
|
||||
newWbsSet1.IsSelected = true;
|
||||
newWbsSet1.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
foreach (var noShowWbsSet1 in noShowWbsSet1s)
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, childUnitProject.UnitProjectCode);
|
||||
newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
newWbsSet2.UnitProjectId = childUnitProject.UnitProjectId;
|
||||
newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
newWbsSet2.SortIndex = noShowWbsSet1.SortIndex;
|
||||
newWbsSet2.Flag = 2;
|
||||
newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
newWbsSet2.IsIn = false;
|
||||
newWbsSet2.IsSelected = true;
|
||||
newWbsSet2.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "wbsSet")
|
||||
if (type == "wbsSet")
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(id);
|
||||
wbsSet.IsSelected = true;
|
||||
wbsSet.IsApprove = true;
|
||||
BLL.WbsSetService.UpdateWbsSet(wbsSet);
|
||||
var noShowWbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == id && x.NoShow == true orderby x.WbsSetCode select x;
|
||||
if (noShowWbsSets.Count() == 0) //首次拷贝
|
||||
//wbsSet.IsSelected = true;
|
||||
//wbsSet.IsApprove = true;
|
||||
//BLL.WbsSetService.UpdateWbsSet(wbsSet);
|
||||
var wbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == id orderby x.WbsSetCode select x;
|
||||
Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
updateId = newWbsSet1.WbsSetId;
|
||||
newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
newWbsSet1.CnProfessionId = wbsSet.CnProfessionId;
|
||||
newWbsSet1.UnitProjectId = wbsSet.UnitProjectId;
|
||||
newWbsSet1.InstallationId = wbsSet.InstallationId;
|
||||
newWbsSet1.SuperWbsSetId = wbsSet.SuperWbsSetId;
|
||||
newWbsSet1.ProjectId = wbsSet.ProjectId;
|
||||
newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
{
|
||||
noShowWbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == id orderby x.WbsSetCode select x;
|
||||
foreach (var noShowWbsSet in noShowWbsSets)
|
||||
newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
newWbsSet1.IsIn = false;
|
||||
//newWbsSet1.IsSelected = true;
|
||||
//newWbsSet1.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
var totalWbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
|
||||
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
|
||||
foreach (var noShowWbsSet1 in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, wbsSet.WbsSetCode);
|
||||
newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
newWbsSet2.UnitProjectId = noShowWbsSet1.UnitProjectId;
|
||||
newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
newWbsSet2.SortIndex = noShowWbsSet1.SortIndex;
|
||||
newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
newWbsSet2.IsIn = false;
|
||||
//newWbsSet2.IsSelected = true;
|
||||
//newWbsSet2.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
//拷贝费用清单对应关系
|
||||
var wbsSetMatchCostControlInits = from x in totalWbsSetMatchCostControlInits where x.WbsSetCode == noShowWbsSet1.WbsSetCode orderby x.WbsSetCode select x;
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
|
||||
{
|
||||
noShowWbsSet.NoShow = true;
|
||||
BLL.WbsSetService.UpdateWbsSet(noShowWbsSet);
|
||||
}
|
||||
Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
updateId = newWbsSet1.WbsSetId;
|
||||
newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
newWbsSet1.CnProfessionId = wbsSet.CnProfessionId;
|
||||
newWbsSet1.UnitProjectId = wbsSet.UnitProjectId;
|
||||
newWbsSet1.InstallationId = wbsSet.InstallationId;
|
||||
newWbsSet1.SuperWbsSetId = id;
|
||||
newWbsSet1.ProjectId = wbsSet.ProjectId;
|
||||
newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
{
|
||||
newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
newWbsSet1.Flag = wbsSet.Flag + 1;
|
||||
newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
newWbsSet1.IsIn = false;
|
||||
newWbsSet1.IsSelected = true;
|
||||
newWbsSet1.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
noShowWbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == id && x.NoShow == true orderby x.WbsSetCode select x;
|
||||
foreach (var noShowWbsSet1 in noShowWbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, wbsSet.WbsSetCode);
|
||||
newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
newWbsSet2.UnitProjectId = noShowWbsSet1.UnitProjectId;
|
||||
newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
newWbsSet2.SortIndex = noShowWbsSet1.SortIndex;
|
||||
newWbsSet2.Flag = newWbsSet1.Flag + 1;
|
||||
newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
newWbsSet2.IsIn = false;
|
||||
newWbsSet2.IsSelected = true;
|
||||
newWbsSet2.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
}
|
||||
}
|
||||
else //后续拷贝
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
updateId = newWbsSet1.WbsSetId;
|
||||
newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
newWbsSet1.CnProfessionId = wbsSet.CnProfessionId;
|
||||
newWbsSet1.UnitProjectId = wbsSet.UnitProjectId;
|
||||
newWbsSet1.InstallationId = wbsSet.InstallationId;
|
||||
newWbsSet1.SuperWbsSetId = id;
|
||||
newWbsSet1.ProjectId = wbsSet.ProjectId;
|
||||
newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
{
|
||||
newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
newWbsSet1.Flag = wbsSet.Flag + 1;
|
||||
newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
newWbsSet1.IsIn = false;
|
||||
newWbsSet1.IsSelected = true;
|
||||
newWbsSet1.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
foreach (var noShowWbsSet1 in noShowWbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, wbsSet.WbsSetCode);
|
||||
newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
newWbsSet2.UnitProjectId = noShowWbsSet1.UnitProjectId;
|
||||
newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
newWbsSet2.SortIndex = noShowWbsSet1.SortIndex;
|
||||
newWbsSet2.Flag = newWbsSet1.Flag + 1;
|
||||
newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
newWbsSet2.IsIn = false;
|
||||
newWbsSet2.IsSelected = true;
|
||||
newWbsSet2.IsApprove = true;
|
||||
BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = newWbsSet2.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControl.CostControlCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.ProjectId = noShowWbsSet1.ProjectId;
|
||||
costControl.WbsSetId = newWbsSet2.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
BLL.CostControlService.AddCostControl(costControl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//if (noShowWbsSets.Count() == 0) //首次拷贝
|
||||
//{
|
||||
// noShowWbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == id orderby x.WbsSetCode select x;
|
||||
// foreach (var noShowWbsSet in noShowWbsSets)
|
||||
// {
|
||||
// noShowWbsSet.NoShow = true;
|
||||
// BLL.WbsSetService.UpdateWbsSet(noShowWbsSet);
|
||||
// }
|
||||
// Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
// newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
// updateId = newWbsSet1.WbsSetId;
|
||||
// newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
// newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
// newWbsSet1.CnProfessionId = wbsSet.CnProfessionId;
|
||||
// newWbsSet1.UnitProjectId = wbsSet.UnitProjectId;
|
||||
// newWbsSet1.InstallationId = wbsSet.InstallationId;
|
||||
// newWbsSet1.SuperWbsSetId = id;
|
||||
// newWbsSet1.ProjectId = wbsSet.ProjectId;
|
||||
// newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
// newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
// if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
// {
|
||||
// newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
// }
|
||||
// newWbsSet1.Flag = wbsSet.Flag + 1;
|
||||
// newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
// newWbsSet1.IsIn = false;
|
||||
// newWbsSet1.IsSelected = true;
|
||||
// newWbsSet1.IsApprove = true;
|
||||
// BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
// noShowWbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == id && x.NoShow == true orderby x.WbsSetCode select x;
|
||||
// foreach (var noShowWbsSet1 in noShowWbsSets)
|
||||
// {
|
||||
// Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
// newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
// newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, wbsSet.WbsSetCode);
|
||||
// newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
// newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
// newWbsSet2.UnitProjectId = noShowWbsSet1.UnitProjectId;
|
||||
// newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
// newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
// newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
// newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
// newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
// newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
// newWbsSet2.SortIndex = noShowWbsSet1.SortIndex;
|
||||
// newWbsSet2.Flag = newWbsSet1.Flag + 1;
|
||||
// newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
// newWbsSet2.IsIn = false;
|
||||
// newWbsSet2.IsSelected = true;
|
||||
// newWbsSet2.IsApprove = true;
|
||||
// BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
// }
|
||||
//}
|
||||
//else //后续拷贝
|
||||
//{
|
||||
// Model.Wbs_WbsSet newWbsSet1 = new Model.Wbs_WbsSet();
|
||||
// newWbsSet1.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
// updateId = newWbsSet1.WbsSetId;
|
||||
// newWbsSet1.WbsSetCode = this.txtCode.Text.Trim();
|
||||
// newWbsSet1.WbsSetName = this.txtName.Text.Trim();
|
||||
// newWbsSet1.CnProfessionId = wbsSet.CnProfessionId;
|
||||
// newWbsSet1.UnitProjectId = wbsSet.UnitProjectId;
|
||||
// newWbsSet1.InstallationId = wbsSet.InstallationId;
|
||||
// newWbsSet1.SuperWbsSetId = id;
|
||||
// newWbsSet1.ProjectId = wbsSet.ProjectId;
|
||||
// newWbsSet1.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
// newWbsSet1.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
// if (!string.IsNullOrEmpty(txtSortIndex.Text.Trim()))
|
||||
// {
|
||||
// newWbsSet1.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
// }
|
||||
// newWbsSet1.Flag = wbsSet.Flag + 1;
|
||||
// newWbsSet1.Remark = this.txtRemark.Text.Trim();
|
||||
// newWbsSet1.IsIn = false;
|
||||
// newWbsSet1.IsSelected = true;
|
||||
// newWbsSet1.IsApprove = true;
|
||||
// BLL.WbsSetService.AddWbsSet(newWbsSet1);
|
||||
// foreach (var noShowWbsSet1 in noShowWbsSets)
|
||||
// {
|
||||
// Model.Wbs_WbsSet newWbsSet2 = new Model.Wbs_WbsSet();
|
||||
// newWbsSet2.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
// newWbsSet2.WbsSetCode = GetReplaceCode(noShowWbsSet1.WbsSetCode, wbsSet.WbsSetCode);
|
||||
// newWbsSet2.WbsSetName = noShowWbsSet1.WbsSetName;
|
||||
// newWbsSet2.CnProfessionId = noShowWbsSet1.CnProfessionId;
|
||||
// newWbsSet2.UnitProjectId = noShowWbsSet1.UnitProjectId;
|
||||
// newWbsSet2.InstallationId = noShowWbsSet1.InstallationId;
|
||||
// newWbsSet2.SuperWbsSetId = newWbsSet1.WbsSetId;
|
||||
// newWbsSet2.ProjectId = noShowWbsSet1.ProjectId;
|
||||
// newWbsSet2.Weights = noShowWbsSet1.Weights;
|
||||
// newWbsSet2.StartDate = noShowWbsSet1.StartDate;
|
||||
// newWbsSet2.EndDate = noShowWbsSet1.EndDate;
|
||||
// newWbsSet2.SortIndex = noShowWbsSet1.SortIndex;
|
||||
// newWbsSet2.Flag = newWbsSet1.Flag + 1;
|
||||
// newWbsSet2.Remark = noShowWbsSet1.Remark;
|
||||
// newWbsSet2.IsIn = false;
|
||||
// newWbsSet2.IsSelected = true;
|
||||
// newWbsSet2.IsApprove = true;
|
||||
// BLL.WbsSetService.AddWbsSet(newWbsSet2);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
//BLL.Sys_LogService.AddLog(BLL.Const.System_1, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "拷贝单位、分部、分项工程");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(updateId) + ActiveWindow.GetHidePostBackReference());
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(updateId) + ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -75,42 +75,6 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtEndDate;
|
||||
|
||||
/// <summary>
|
||||
/// trWbsSet1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow trWbsSet1;
|
||||
|
||||
/// <summary>
|
||||
/// drpControlPoint 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpControlPoint;
|
||||
|
||||
/// <summary>
|
||||
/// trWbsSet2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow trWbsSet2;
|
||||
|
||||
/// <summary>
|
||||
/// txtControlItemDef 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtControlItemDef;
|
||||
|
||||
/// <summary>
|
||||
/// txtSortIndex 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -4,58 +4,53 @@
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCode" runat="server" Label="编号" LabelWidth="130px" Readonly="true" FocusOnPageLoad="true"></f:TextBox>
|
||||
<f:TextBox ID="txtName" runat="server" Label="名称" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<%--<f:FormRow runat="server" ID="trWbsSet1" Hidden="true">
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCode" runat="server" Label="编号" LabelWidth="130px" ShowRedStar="true" Required="true" FocusOnPageLoad="true"></f:TextBox>
|
||||
<f:TextBox ID="txtName" runat="server" Label="名称" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<%--<f:FormRow runat="server" ID="trWbsSet1" Hidden="true">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpControlPoint" runat="server" Label="等级" LabelWidth="130px" LabelAlign="right">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>--%>
|
||||
<f:FormRow runat="server" ID="trWbsSet2" Hidden="true">
|
||||
<Items>
|
||||
<f:TextArea ID="txtControlItemDef" runat="server" MaxLength="500" Label="内容" LabelWidth="130px"></f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trWeight" Hidden="true">
|
||||
<Items>
|
||||
<f:NumberBox ID="nbWeights" NoDecimal="false" NoNegative="false" MaxValue="100" MinValue="0" Label="权重" LabelWidth="130px"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRemark" runat="server" Label="备注" LabelWidth="130px"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:FormRow runat="server" ID="trWeight" Hidden="true">
|
||||
<Items>
|
||||
<f:NumberBox ID="nbWeights" NoDecimal="false" NoNegative="false" MaxValue="100" MinValue="0" Label="权重" LabelWidth="130px"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trSortIndex">
|
||||
<Items>
|
||||
<f:NumberBox ID="txtSortIndex" runat="server" Label="排序" NoNegative="true" NoDecimal="true" LabelWidth="130px"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -24,25 +24,23 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
if (operating == "add")
|
||||
{
|
||||
int i = 0;
|
||||
if (type.Equals("cnProfession") || type.Equals("unitProject"))
|
||||
if (type.Equals("cnProfession"))
|
||||
{
|
||||
txtCode.Text = GetNewCode(id, i, "cnProfession");
|
||||
//txtCode.Text = GetNewCode(id, i, "cnProfession");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
txtCode.Readonly = true;
|
||||
this.trSortIndex.Hidden = true;
|
||||
txtCode.Text = GetNewCode(id, i, "wbsSet");
|
||||
Model.WBS_WbsSetInit wbsSet = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(id);
|
||||
this.trWeight.Hidden = false;
|
||||
if (wbsSet != null)
|
||||
{
|
||||
if (BLL.WbsSetInitService.GetItemCount(id) == 0) //末级节点
|
||||
if (wbsSet.Weights != null)
|
||||
{
|
||||
this.trWbsSet2.Hidden = false;
|
||||
this.trWeight.Hidden = false;
|
||||
if (wbsSet.Weights != null)
|
||||
{
|
||||
this.nbWeights.Text = wbsSet.Weights.ToString();
|
||||
}
|
||||
this.nbWeights.Text = wbsSet.Weights.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,28 +54,30 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
txtCode.Text = unitProject.UnitProjectCode;
|
||||
txtName.Text = unitProject.UnitProjectName;
|
||||
txtRemark.Text = unitProject.Remark;
|
||||
if (unitProject.SortIndex != null)
|
||||
{
|
||||
txtSortIndex.Text = unitProject.SortIndex.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
txtCode.Readonly = true;
|
||||
this.trSortIndex.Hidden = true;
|
||||
Model.WBS_WbsSetInit wbsSet = BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(id);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
if (BLL.WbsSetInitService.GetItemCount(id) == 0) //末级节点
|
||||
{
|
||||
this.trWbsSet2.Hidden = false;
|
||||
this.trWeight.Hidden = false;
|
||||
if (wbsSet.Weights != null)
|
||||
{
|
||||
this.nbWeights.Text = wbsSet.Weights.ToString();
|
||||
}
|
||||
txtControlItemDef.Text = wbsSet.ControlItemDef;
|
||||
}
|
||||
txtCode.Text = wbsSet.WbsSetCode;
|
||||
txtName.Text = wbsSet.WbsSetName;
|
||||
txtRemark.Text = wbsSet.Remark;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
else
|
||||
{
|
||||
testCode = code + "-" + istr;
|
||||
testCode = code + istr;
|
||||
if (BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(testCode) == null)
|
||||
{
|
||||
newCode = testCode;
|
||||
@@ -180,7 +180,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
istr = i.ToString();
|
||||
}
|
||||
testCode = code + "-" + istr;
|
||||
testCode = code + istr;
|
||||
} while (BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(testCode) != null);
|
||||
newCode = testCode;
|
||||
}
|
||||
@@ -210,7 +210,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
unitProject.UnitProjectName = txtName.Text.Trim();
|
||||
unitProject.CnProfessionId = cnProfession.CnProfessionId;
|
||||
unitProject.IsIn = false;
|
||||
unitProject.Remark = txtRemark.Text.Trim();
|
||||
unitProject.SortIndex = Funs.GetNewIntOrZero(txtSortIndex.Text.Trim());
|
||||
BLL.UnitProjectInitService.AddUnitProjectInit(unitProject);
|
||||
}
|
||||
else
|
||||
@@ -227,21 +227,17 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
if (oldWbsSet == null)
|
||||
{
|
||||
wbsSet.Flag = 1;
|
||||
wbsSet.CnProfessionId = oldUnitProject.CnProfessionId;
|
||||
wbsSet.UnitProjectCode = oldUnitProject.UnitProjectCode;
|
||||
wbsSet.SuperWbsSetCode = oldUnitProject.UnitProjectCode;
|
||||
wbsSet.SuperWbsSetCode = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.Flag++;
|
||||
wbsSet.CnProfessionId = oldWbsSet.CnProfessionId;
|
||||
wbsSet.UnitProjectCode = oldWbsSet.UnitProjectCode;
|
||||
wbsSet.SuperWbsSetCode = oldWbsSet.WbsSetCode;
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
wbsSet.IsIn = false;
|
||||
wbsSet.Remark = txtRemark.Text.Trim();
|
||||
BLL.WbsSetInitService.AddWbsSetInit(wbsSet);
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "增加WBS库单位、分部、分项工程!");
|
||||
@@ -256,7 +252,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
unitProject.UnitProjectCode = id;
|
||||
unitProject.UnitProjectName = txtName.Text.Trim();
|
||||
unitProject.Remark = txtRemark.Text.Trim();
|
||||
unitProject.SortIndex = Funs.GetNewIntOrZero(txtSortIndex.Text.Trim());
|
||||
BLL.UnitProjectInitService.UpdateUnitProjectInit(unitProject);
|
||||
}
|
||||
}
|
||||
@@ -271,8 +267,6 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewIntOrZero(this.nbWeights.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
wbsSet.Remark = txtRemark.Text.Trim();
|
||||
BLL.WbsSetInitService.UpdateWbsSetInit(wbsSet);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-20
@@ -57,24 +57,6 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtName;
|
||||
|
||||
/// <summary>
|
||||
/// trWbsSet2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow trWbsSet2;
|
||||
|
||||
/// <summary>
|
||||
/// txtControlItemDef 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtControlItemDef;
|
||||
|
||||
/// <summary>
|
||||
/// trWeight 控件。
|
||||
/// </summary>
|
||||
@@ -94,13 +76,22 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
protected global::FineUIPro.NumberBox nbWeights;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// trSortIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
protected global::FineUIPro.FormRow trSortIndex;
|
||||
|
||||
/// <summary>
|
||||
/// txtSortIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtSortIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkloadInput.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.WorkloadInput" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>工作量录入</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.row-grid-disabled .f-grid-cell-inner {
|
||||
opacity: .5;
|
||||
filter: alpha(opacity=50);
|
||||
}
|
||||
|
||||
.f-grid-row.orange, .f-grid-row.orange .ui-icon, .f-grid-row.orange a {
|
||||
background-color: Orange;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.f-grid-row.red, .f-grid-row.red .ui-icon, .f-grid-row.red a {
|
||||
background-color: Red;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.customlabel span {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" runat="server" />
|
||||
<f:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server" Margin="5px">
|
||||
<Regions>
|
||||
<f:Region ID="Region1" ShowBorder="false" ShowHeader="false" RegionPosition="Left"
|
||||
Title="工作量录入" BodyPadding="0 5 0 0" Width="300px" Layout="Fit" runat="server"
|
||||
EnableCollapse="true">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panel2" RegionPosition="Left" RegionSplit="true" EnableCollapse="true"
|
||||
Width="400" Title="工作量录入" TitleToolTip="工作量录入" ShowBorder="true"
|
||||
ShowHeader="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Region">
|
||||
<Items>
|
||||
<f:Tree ID="trWBS" Width="290" EnableCollapse="true" ShowHeader="true" OnNodeCommand="trWBS_NodeCommand"
|
||||
OnNodeExpand="trWBS_NodeExpand" OnNodeCheck="trWBS_NodeCheck"
|
||||
AutoLeafIdentification="true" runat="server">
|
||||
</f:Tree>
|
||||
<f:HiddenField runat="server" ID="hdSelectId">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Region>
|
||||
<f:Region ID="Region2" ShowBorder="false" ShowHeader="false" Position="Center" Layout="VBox"
|
||||
BoxConfigAlign="Stretch" BoxConfigPosition="Left" runat="server">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="CostControlDetailId,CostControlId" AllowSorting="true" EnableColumnLines="true"
|
||||
SortField="CostControlCode,CostControlName" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ShowSelectedCell="true"
|
||||
DataIDField="CostControlDetailId" AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
OnRowDataBound="Grid1_RowDataBound" AllowFilters="true" OnFilterChange="Grid1_FilterChange">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:DatePicker runat="server" ID="txtMonths" DateFormatString="yyyy-MM" AutoPostBack="true"
|
||||
Label="月份" LabelWidth="50px" Width="150px" OnTextChanged="txtMonths_TextChanged">
|
||||
</f:DatePicker>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" Hidden="true" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="130px" ColumnID="CostControlCode" DataField="CostControlCode" FieldType="String"
|
||||
HeaderText="费用清单编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="400px" ColumnID="CostControlName" DataField="CostControlName" FieldType="String"
|
||||
HeaderText="内容" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" ColumnID="Unit" DataField="Unit" FieldType="String"
|
||||
HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double"
|
||||
HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
|
||||
HeaderText="本月计划完成量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RealPrice" DataField="RealPrice" FieldType="Double"
|
||||
HeaderText="成本单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanPrice" DataField="PlanPrice" FieldType="Double"
|
||||
HeaderText="控制预算单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="130px" ColumnID="ThisNum" DataField="ThisNum" FieldType="Double"
|
||||
HeaderText="本月完成量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbThisNum" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" ColumnID="CostControlDetailId" DataField="CostControlDetailId" FieldType="String"
|
||||
HeaderText="主键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" ColumnID="CostControlId" DataField="CostControlId" FieldType="String"
|
||||
HeaderText="外键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="100" Value="100" />
|
||||
<f:ListItem Text="200" Value="200" />
|
||||
<f:ListItem Text="300" Value="300" />
|
||||
<f:ListItem Text="400" Value="400" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Region>
|
||||
</Regions>
|
||||
</f:RegionPanel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function onGridAfterEdit(event, value, params) {
|
||||
var me = this, columnId = params.columnId, rowId = params.rowId;
|
||||
if (columnId === 'StartDate') {
|
||||
me.updateCellValue(rowId, 'ChangeId', rowId);
|
||||
me.updateCellValue(rowId, 'ChangeColumn', 'StartDate');
|
||||
}
|
||||
if (columnId === 'EndDate') {
|
||||
me.updateCellValue(rowId, 'ChangeId', rowId);
|
||||
me.updateCellValue(rowId, 'ChangeColumn', 'EndDate');
|
||||
}
|
||||
if (columnId === 'ControlPoint') {
|
||||
me.updateCellValue(rowId, 'ChangeId', rowId);
|
||||
me.updateCellValue(rowId, 'ChangeColumn', 'ControlPoint');
|
||||
}
|
||||
if (columnId === 'Cycle') {
|
||||
me.updateCellValue(rowId, 'ChangeId', rowId);
|
||||
me.updateCellValue(rowId, 'ChangeColumn', 'Cycle');
|
||||
}
|
||||
if (columnId === 'Frequency') {
|
||||
me.updateCellValue(rowId, 'ChangeId', rowId);
|
||||
me.updateCellValue(rowId, 'ChangeColumn', 'Frequency');
|
||||
}
|
||||
// updateDate();
|
||||
show();
|
||||
}
|
||||
|
||||
function updateDate() {
|
||||
// 回发到后台更新
|
||||
__doPostBack('', 'UPDATE_Date');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,717 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class WorkloadInput : PageBase
|
||||
{
|
||||
#region 页面加载
|
||||
/// <summary>
|
||||
/// 页面加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
InitTreeMenu();
|
||||
this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 树加载
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
this.trWBS.Nodes.Clear();
|
||||
this.trWBS.ShowBorder = false;
|
||||
this.trWBS.ShowHeader = false;
|
||||
this.trWBS.EnableIcons = true;
|
||||
this.trWBS.AutoScroll = true;
|
||||
this.trWBS.EnableSingleClickExpand = true;
|
||||
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
||||
if (project != null)
|
||||
{
|
||||
TreeNode rootNode = new TreeNode();
|
||||
rootNode.Text = project.ProjectName;
|
||||
rootNode.NodeID = project.ProjectId;
|
||||
rootNode.CommandName = "project";
|
||||
rootNode.EnableExpandEvent = true;
|
||||
this.trWBS.Nodes.Add(rootNode);
|
||||
if (BLL.Project_InstallationService.IsExitProjectInstallation(project.ProjectId))
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
rootNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 树节点展开
|
||||
/// <summary>
|
||||
/// 树节点展开
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trWBS_NodeExpand(object sender, TreeNodeEventArgs e)
|
||||
{
|
||||
e.Node.Nodes.Clear();
|
||||
bool needAddTempNode = false; //是否需要增加空节点
|
||||
if (e.Node.CommandName == "project") //展开项目节点
|
||||
{
|
||||
var installations = from x in Funs.DB.Project_Installation
|
||||
where x.ProjectId == e.Node.NodeID && x.SuperInstallationId == "0"
|
||||
orderby x.InstallationCode
|
||||
select x;
|
||||
foreach (var installation in installations)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = installation.InstallationName;
|
||||
newNode.NodeID = installation.InstallationId;
|
||||
newNode.CommandName = "installation";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
else if (e.Node.CommandName == "installation") //展开装置/单元节点
|
||||
{
|
||||
var installations = from x in Funs.DB.Project_Installation
|
||||
where x.SuperInstallationId == e.Node.NodeID
|
||||
orderby x.InstallationCode
|
||||
select x;
|
||||
if (installations.Count() > 0)
|
||||
{
|
||||
foreach (var installation in installations)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = installation.InstallationName;
|
||||
newNode.NodeID = installation.InstallationId;
|
||||
newNode.CommandName = "installation";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var cnProfessions = from x in Funs.DB.WBS_CnProfession where x.InstallationId == e.Node.NodeID && x.IsApprove == true orderby x.OldId select x;
|
||||
if (cnProfessions.Count() > 0) //普通装置主项
|
||||
{
|
||||
foreach (var cnProfession in cnProfessions)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = cnProfession.CnProfessionName;
|
||||
newNode.NodeID = cnProfession.CnProfessionId;
|
||||
newNode.CommandName = "cnProfession";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
else //总图
|
||||
{
|
||||
var unitProjects = from x in Funs.DB.Wbs_UnitProject where x.InstallationId == e.Node.NodeID && x.SuperUnitProjectId == null && x.IsApprove == true orderby x.SortIndex, x.UnitProjectCode select x;
|
||||
foreach (var unitProject in unitProjects)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = unitProject.UnitProjectName;
|
||||
newNode.NodeID = unitProject.UnitProjectId;
|
||||
newNode.CommandName = "unitProject";
|
||||
newNode.EnableExpandEvent = true;
|
||||
if (unitProject.IsApprove == true)
|
||||
{
|
||||
newNode.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
newNode.Checked = false;
|
||||
}
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Node.CommandName == "cnProfession") //展开专业节点
|
||||
{
|
||||
var unitProjects = from x in Funs.DB.Wbs_UnitProject where x.CnProfessionId == e.Node.NodeID && x.SuperUnitProjectId == null && x.IsApprove == true orderby x.SortIndex, x.UnitProjectCode select x;
|
||||
foreach (var unitProject in unitProjects)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = unitProject.UnitProjectName;
|
||||
newNode.NodeID = unitProject.UnitProjectId;
|
||||
newNode.CommandName = "unitProject";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableCheckBox = true;
|
||||
newNode.EnableCheckEvent = true;
|
||||
if (unitProject.IsSelected == true && unitProject.IsApprove == null)
|
||||
{
|
||||
unitProject.IsApprove = true;
|
||||
BLL.UnitProjectService.UpdateUnitProject(unitProject);
|
||||
}
|
||||
if (unitProject.IsApprove == true)
|
||||
{
|
||||
newNode.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
newNode.Checked = false;
|
||||
}
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
}
|
||||
else if (e.Node.CommandName == "unitProject") //展开单位工程节点
|
||||
{
|
||||
var wbsSet1s = from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == e.Node.NodeID && x.SuperWbsSetId == null && x.IsApprove == true orderby x.WbsSetCode select x;
|
||||
if (wbsSet1s.Count() > 0)
|
||||
{
|
||||
foreach (var wbsSet1 in wbsSet1s)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = wbsSet1.WbsSetName;
|
||||
newNode.NodeID = wbsSet1.WbsSetId;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableCheckBox = true;
|
||||
newNode.EnableCheckEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
var wbsSets = BLL.WbsSetService.GetWbsSetsBySuperWbsSetId(wbsSet1.WbsSetId);
|
||||
if (wbsSets.Count > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
//needAddTempNode = false;
|
||||
//var wbsSets = BLL.WbsSetService.GetWbsSetsBySuperWbsSetId(wbsSet1.WbsSetId);
|
||||
//foreach (var wbsSet in wbsSets)
|
||||
//{
|
||||
// var childWbsSets = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == wbsSet.WbsSetId select x;
|
||||
// if (childWbsSets.Count() > 0)
|
||||
// {
|
||||
// needAddTempNode = true;
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
//if (needAddTempNode)
|
||||
//{
|
||||
// TreeNode emptyNode = new TreeNode();
|
||||
// emptyNode.Text = "";
|
||||
// emptyNode.NodeID = "";
|
||||
// newNode.Nodes.Add(emptyNode);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.Node.CommandName == "wbsSet") //展开分部/子分部/分项/子分项工程节点
|
||||
{
|
||||
var childWbsSets = BLL.WbsSetService.GetApproveWbsSetsBySuperWbsSetId(e.Node.NodeID);
|
||||
foreach (var wbsSet in childWbsSets)
|
||||
{
|
||||
TreeNode newNode = new TreeNode();
|
||||
newNode.Text = wbsSet.WbsSetName;
|
||||
newNode.NodeID = wbsSet.WbsSetId;
|
||||
newNode.CommandName = "wbsSet";
|
||||
newNode.EnableExpandEvent = true;
|
||||
newNode.EnableClickEvent = true;
|
||||
e.Node.Nodes.Add(newNode);
|
||||
var wbsSets = BLL.WbsSetService.GetApproveWbsSetsBySuperWbsSetId(wbsSet.WbsSetId);
|
||||
if (wbsSets.Count > 0)
|
||||
{
|
||||
TreeNode emptyNode = new TreeNode();
|
||||
emptyNode.Text = "";
|
||||
emptyNode.NodeID = "";
|
||||
newNode.Nodes.Add(emptyNode);
|
||||
}
|
||||
//needAddTempNode = false;
|
||||
//var wbsSets = BLL.WbsSetService.GetWbsSetsBySuperWbsSetId(wbsSet.WbsSetId);
|
||||
//foreach (var wbsSetc in wbsSets)
|
||||
//{
|
||||
// var childWbsSets1 = from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == wbsSetc.WbsSetId select x;
|
||||
// if (childWbsSets1.Count() > 0)
|
||||
// {
|
||||
// needAddTempNode = true;
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
//if (needAddTempNode)
|
||||
//{
|
||||
// TreeNode emptyNode = new TreeNode();
|
||||
// emptyNode.Text = "";
|
||||
// emptyNode.NodeID = "";
|
||||
// newNode.Nodes.Add(emptyNode);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void trWBS_NodeCheck(object sender, FineUIPro.TreeCheckEventArgs e)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(e.NodeID);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
wbsSet.IsSelected = e.Checked;
|
||||
wbsSet.IsApprove = e.Checked;
|
||||
BLL.WbsSetService.UpdateWbsSet(wbsSet);
|
||||
Model.Wbs_WbsSet pWbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSet.SuperWbsSetId);
|
||||
if (pWbsSet != null)
|
||||
{
|
||||
pWbsSet.IsSelected = e.Checked;
|
||||
pWbsSet.IsApprove = e.Checked;
|
||||
BLL.WbsSetService.UpdateWbsSet(pWbsSet);
|
||||
Model.Wbs_WbsSet ppWbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(pWbsSet.SuperWbsSetId);
|
||||
if (ppWbsSet != null)
|
||||
{
|
||||
ppWbsSet.IsSelected = e.Checked;
|
||||
ppWbsSet.IsApprove = e.Checked;
|
||||
BLL.WbsSetService.UpdateWbsSet(ppWbsSet);
|
||||
Model.Wbs_WbsSet pppWbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(ppWbsSet.SuperWbsSetId);
|
||||
if (pppWbsSet != null)
|
||||
{
|
||||
pppWbsSet.IsSelected = e.Checked;
|
||||
pppWbsSet.IsApprove = e.Checked;
|
||||
BLL.WbsSetService.UpdateWbsSet(pppWbsSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(wbsSet.UnitProjectId);
|
||||
if (unitProject != null)
|
||||
{
|
||||
unitProject.IsSelected = e.Checked;
|
||||
unitProject.IsApprove = e.Checked;
|
||||
BLL.UnitProjectService.UpdateUnitProject(unitProject);
|
||||
}
|
||||
Model.WBS_CnProfession cnProfession = BLL.CnProfessionService.GetCnProfessionByCnProfessionId(wbsSet.CnProfessionId);
|
||||
if (cnProfession != null)
|
||||
{
|
||||
cnProfession.IsSelected = e.Checked;
|
||||
cnProfession.IsApprove = e.Checked;
|
||||
BLL.CnProfessionService.UpdateCnProfession(cnProfession);
|
||||
}
|
||||
}
|
||||
|
||||
//if (e.Checked)
|
||||
//{
|
||||
// CheckAllParentNodes(e.Node);
|
||||
// CheckAllChildNodes(e.Node);
|
||||
// this.UpdateSelect(e.Node, true);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (auditText == string.Empty)
|
||||
// {
|
||||
// trWBS.UncheckAllNodes(e.Node.Nodes);
|
||||
// this.UpdateSelect(e.Node, false);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// auditText = auditText.Substring(0, auditText.Length - 1);
|
||||
// e.Node.Checked = true;
|
||||
// ShowNotify("权重已有设置审核项:'" + auditText + "',不能取消设置!", MessageBoxIcon.Success);
|
||||
// }
|
||||
//}
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#region Tree点击事件
|
||||
/// <summary>
|
||||
/// Tree点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trWBS_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存事件
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtMonths.Text.Trim()))
|
||||
{
|
||||
Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01");
|
||||
if (Grid1.Rows.Count > 0)
|
||||
{
|
||||
decimal changeThisPlanValue = 0, changeThisRealCost = 0, changeThisPlanCost = 0, //当月总变化完成成本、完成预算
|
||||
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
|
||||
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
|
||||
JArray mergedData = Grid1.GetMergedData();
|
||||
foreach (JObject mergedRow in mergedData)
|
||||
{
|
||||
oldThisPlanValue = 0;
|
||||
oldThisRealCost = 0;
|
||||
oldThisPlanCost = 0;
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
string costControlDetailId = values.Value<string>("CostControlDetailId");
|
||||
string costControlId = values.Value<string>("CostControlId");
|
||||
string thisNum = values.Value<string>("ThisNum");
|
||||
string planPrice = values.Value<string>("PlanPrice");
|
||||
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(costControlDetailId);
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
|
||||
if (costControlDetail != null)
|
||||
{
|
||||
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
|
||||
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
|
||||
if (!string.IsNullOrEmpty(thisNum))
|
||||
{
|
||||
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
|
||||
}
|
||||
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
|
||||
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
|
||||
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
|
||||
BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
costControlDetail = new Model.WBS_CostControlDetail();
|
||||
costControlDetail.CostControlDetailId = costControlDetailId;
|
||||
costControlDetail.CostControlId = costControlId;
|
||||
costControlDetail.Months = months;
|
||||
if (!string.IsNullOrEmpty(thisNum))
|
||||
{
|
||||
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
|
||||
}
|
||||
thisPlanValue = 0;
|
||||
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
|
||||
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
|
||||
BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
|
||||
}
|
||||
//累加变化值,计算总的变化值
|
||||
changeThisRealCost += thisRealCost - oldThisRealCost;
|
||||
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
|
||||
}
|
||||
//累计所有子节点的计划值
|
||||
var costControls = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
|
||||
foreach (var item in costControls)
|
||||
{
|
||||
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(item.CostControlId, months);
|
||||
if (costControlDetail != null)
|
||||
{
|
||||
changeThisPlanValue += (costControlDetail.PlanNum ?? 0) * (item.PlanPrice ?? 0);
|
||||
}
|
||||
}
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(this.trWBS.SelectedNodeID, months);
|
||||
if (parentDetail != null) //如果工作项节点存在,则计算计划值差异值
|
||||
{
|
||||
changeThisPlanValue = changeThisPlanValue - (parentDetail.ThisPlanValue ?? 0);
|
||||
}
|
||||
//更新树节点
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
|
||||
//更新工作包、工作项
|
||||
UpdateWbsSetDetail(this.trWBS.SelectedNodeID, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
//更新分部
|
||||
Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.UnitProjectId, months);
|
||||
if (unitProjectDetail != null)
|
||||
{
|
||||
unitProjectDetail.ThisPlanValue += changeThisPlanValue;
|
||||
unitProjectDetail.ThisRealCost += changeThisRealCost;
|
||||
unitProjectDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(unitProjectDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProjectDetail = new Model.WBS_CostControlParentDetail();
|
||||
unitProjectDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
unitProjectDetail.ParentId = wbsSet.UnitProjectId;
|
||||
unitProjectDetail.Months = months;
|
||||
unitProjectDetail.ThisPlanValue = changeThisPlanValue;
|
||||
unitProjectDetail.ThisRealCost = changeThisRealCost;
|
||||
unitProjectDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail);
|
||||
}
|
||||
//更新专业
|
||||
Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.CnProfessionId, months);
|
||||
if (cnProfessionDetail != null)
|
||||
{
|
||||
cnProfessionDetail.ThisPlanValue += changeThisPlanValue;
|
||||
cnProfessionDetail.ThisRealCost += changeThisRealCost;
|
||||
cnProfessionDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(cnProfessionDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
cnProfessionDetail = new Model.WBS_CostControlParentDetail();
|
||||
cnProfessionDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
cnProfessionDetail.ParentId = wbsSet.CnProfessionId;
|
||||
cnProfessionDetail.Months = months;
|
||||
cnProfessionDetail.ThisPlanValue = changeThisPlanValue;
|
||||
cnProfessionDetail.ThisRealCost = changeThisRealCost;
|
||||
cnProfessionDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail);
|
||||
}
|
||||
//更新装置
|
||||
UpdateInstallationDetail(wbsSet.InstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
|
||||
BindGrid();
|
||||
Alert.ShowInTop("保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择工作项节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新工作包、工作项
|
||||
/// <summary>
|
||||
/// 更新工作包、工作项
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateWbsSetDetail(string wbsSetId, DateTime months, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSetId);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSetId, months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
parentDetail.ThisPlanValue += changeThisPlanValue;
|
||||
parentDetail.ThisRealCost += changeThisRealCost;
|
||||
parentDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentDetail = new Model.WBS_CostControlParentDetail();
|
||||
parentDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
parentDetail.ParentId = wbsSetId;
|
||||
parentDetail.Months = months;
|
||||
parentDetail.ThisPlanValue = changeThisPlanValue;
|
||||
parentDetail.ThisRealCost = changeThisRealCost;
|
||||
parentDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail);
|
||||
}
|
||||
if (wbsSet.SuperWbsSetId != null) //还存在上级节点,需要继续循环
|
||||
{
|
||||
UpdateWbsSetDetail(wbsSet.SuperWbsSetId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新装置
|
||||
/// <summary>
|
||||
/// 更新装置
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateInstallationDetail(string installationId, DateTime months, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost)
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId);
|
||||
if (installation != null)
|
||||
{
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(installationId, months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
parentDetail.ThisPlanValue += changeThisPlanValue;
|
||||
parentDetail.ThisRealCost += changeThisRealCost;
|
||||
parentDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentDetail = new Model.WBS_CostControlParentDetail();
|
||||
parentDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
parentDetail.ParentId = installationId;
|
||||
parentDetail.Months = months;
|
||||
parentDetail.ThisPlanValue = changeThisPlanValue;
|
||||
parentDetail.ThisRealCost = changeThisRealCost;
|
||||
parentDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail);
|
||||
}
|
||||
if (installation.SuperInstallationId != null) //还存在上级节点,需要继续循环
|
||||
{
|
||||
UpdateInstallationDetail(installation.SuperInstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
|
||||
private string upStartDate = string.Empty;
|
||||
private string upEndDate = string.Empty;
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
string id = e.RowID;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_FilterChange(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid1排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载Grid
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim()))
|
||||
{
|
||||
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01");
|
||||
var codeList = BLL.WbsSetMatchCostControlService.GetWbsSetMatchCostControls(this.trWBS.SelectedNodeID);
|
||||
Model.Wbs_WbsSet wbeSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
|
||||
if (codeList.Count > 0) //存在费控对应关系项
|
||||
{
|
||||
List<string> codes = new List<string>();
|
||||
foreach (var item in codeList)
|
||||
{
|
||||
codes.Add(item.CostControlCode);
|
||||
}
|
||||
var list = BLL.CostControlService.GetCostControlsByCostControlCodes(codes, this.trWBS.SelectedNodeID);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
List<Model.View_WBS_CostControlDetail> details = new List<Model.View_WBS_CostControlDetail>();
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (item.TotalNum != null)
|
||||
{
|
||||
Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdYearMonth(item.CostControlId, months);
|
||||
if (detail == null)
|
||||
{
|
||||
detail = new Model.View_WBS_CostControlDetail();
|
||||
detail.CostControlDetailId = SQLHelper.GetNewID();
|
||||
detail.CostControlId = item.CostControlId;
|
||||
detail.CostControlCode = item.CostControlCode;
|
||||
detail.CostControlName = item.CostControlName;
|
||||
detail.TotalNum = item.TotalNum;
|
||||
detail.Unit = item.Unit;
|
||||
detail.PlanNum = null;
|
||||
detail.RealPrice = item.RealPrice;
|
||||
detail.PlanPrice = item.PlanPrice;
|
||||
}
|
||||
details.Add(detail);
|
||||
}
|
||||
}
|
||||
Grid1.DataSource = details;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.WorkloadInputMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 月份选择事件
|
||||
/// <summary>
|
||||
/// 月份选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtMonths_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//InitTreeMenu();
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class WorkloadInput {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// RegionPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RegionPanel RegionPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// Region1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Region Region1;
|
||||
|
||||
/// <summary>
|
||||
/// panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panel2;
|
||||
|
||||
/// <summary>
|
||||
/// trWBS 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trWBS;
|
||||
|
||||
/// <summary>
|
||||
/// hdSelectId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdSelectId;
|
||||
|
||||
/// <summary>
|
||||
/// Region2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Region Region2;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// txtMonths 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtMonths;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// nbThisNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbThisNum;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkloadStatistics.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.WorkloadStatistics" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>工作量统计</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" Title="工作量统计" ForceFit="true"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="Id,Name" EnableTree="true" EnableColumnLines="true"
|
||||
TreeColumn="Name" DataIDField="Id" DataParentIDField="SupId" ExpandAllTreeNodes="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:DatePicker runat="server" ID="txtMonths" Required="true" Label="月份" DateFormatString="yyyy-MM" LabelWidth="70px" LabelAlign="Right" Width="200px"
|
||||
ShowRedStar="true">
|
||||
</f:DatePicker>
|
||||
<%--<f:RadioButtonList runat="server" ID="rblStatisticsType" AutoPostBack="true" Width="450px"
|
||||
OnSelectedIndexChanged="rblStatisticsType_SelectedIndexChanged">
|
||||
<f:RadioItem Value="1" Text="全部" Selected="true" />
|
||||
<f:RadioItem Value="2" Text="分类" />
|
||||
</f:RadioButtonList>--%>
|
||||
<f:DropDownList ID="drpCnProfession" OnSelectedIndexChanged="drpCnProfession_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpUnitProject" OnSelectedIndexChanged="drpUnitProject_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="分部工程" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpWbsSet" runat="server" Label="工作包" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server"
|
||||
OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField />
|
||||
<f:BoundField Width="400px" ColumnID="Name" ExpandUnusedSpace="true" DataField="Name" HeaderTextAlign="Center"
|
||||
HeaderText="施工工作包" />
|
||||
<f:BoundField Width="100px" DataField="Unit" HeaderText="单位" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double"
|
||||
HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="RealPrice" DataField="RealPrice" FieldType="Double"
|
||||
HeaderText="成本单价" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
|
||||
HeaderText="本月计划完成量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="ThisNum" DataField="ThisNum" FieldType="Double"
|
||||
HeaderText="本月完成量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="PlanPrice" DataField="PlanPrice" FieldType="Double"
|
||||
HeaderText="控制预算单价" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="ThisRealCost" DataField="ThisRealCost" FieldType="Double"
|
||||
HeaderText="本月实际成本" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="ThisPlanValue" DataField="ThisPlanValue" FieldType="Double"
|
||||
HeaderText="本月计划完成预算" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="ThisPlanCost" DataField="ThisPlanCost" FieldType="Double"
|
||||
HeaderText="本月完成预算" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="TotalPlanNum" DataField="TotalPlanNum" FieldType="Double"
|
||||
HeaderText="累计计划完成量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="TotalThisNum" DataField="TotalThisNum" FieldType="Double"
|
||||
HeaderText="累计完成量" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="TotalRealCost" DataField="TotalRealCost" FieldType="Double"
|
||||
HeaderText="累计完成成本" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="TotalPlanValue" DataField="TotalPlanValue" FieldType="Double"
|
||||
HeaderText="累计计划完成预算" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="TotalPlanCost" DataField="TotalPlanCost" FieldType="Double"
|
||||
HeaderText="累计完成预算" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,136 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class WorkloadStatistics : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.drpCnProfession.DataValueField = "CnProfessionId";
|
||||
this.drpCnProfession.DataTextField = "CnProfessionName";
|
||||
this.drpCnProfession.DataSource = BLL.CnProfessionInitService.GetCnProfessionInitDropDownList();
|
||||
this.drpCnProfession.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpCnProfession);
|
||||
Funs.FineUIPleaseSelect(drpUnitProject);
|
||||
Funs.FineUIPleaseSelect(drpWbsSet);
|
||||
this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim()))
|
||||
{
|
||||
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim());
|
||||
//if (this.rblStatisticsType.SelectedValue == "1")
|
||||
//{
|
||||
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (this.drpCnProfession.SelectedValue != BLL.Const._Null)
|
||||
// {
|
||||
// DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue);
|
||||
// Grid1.DataSource = table;
|
||||
// Grid1.DataBind();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 统计类型选择事件
|
||||
/// <summary>
|
||||
/// 统计类型选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void rblStatisticsType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//if (this.rblStatisticsType.SelectedValue == "1")
|
||||
//{
|
||||
// this.drpCnProfession.Hidden = true;
|
||||
// this.drpUnitProject.Hidden = true;
|
||||
// this.drpCnProfession.SelectedValue = BLL.Const._Null;
|
||||
//}
|
||||
//else if (this.rblStatisticsType.SelectedValue == "2")
|
||||
//{
|
||||
// this.drpCnProfession.Hidden = false;
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void drpCnProfession_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpCnProfession.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
this.drpUnitProject.DataValueField = "UnitProjectCode";
|
||||
this.drpUnitProject.DataTextField = "UnitProjectName";
|
||||
this.drpUnitProject.DataSource = BLL.UnitProjectInitService.GetUnitProjectInitsByCnProfessionId(this.drpCnProfession.SelectedValue);
|
||||
this.drpUnitProject.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpUnitProject);
|
||||
this.drpUnitProject.SelectedValue = BLL.Const._Null;
|
||||
this.drpWbsSet.Items.Clear();
|
||||
Funs.FineUIPleaseSelect(drpWbsSet);
|
||||
this.drpWbsSet.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpUnitProject.Items.Clear();
|
||||
Funs.FineUIPleaseSelect(drpUnitProject);
|
||||
this.drpUnitProject.SelectedValue = BLL.Const._Null;
|
||||
this.drpWbsSet.Items.Clear();
|
||||
Funs.FineUIPleaseSelect(drpWbsSet);
|
||||
this.drpWbsSet.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void drpUnitProject_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpUnitProject.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
this.drpWbsSet.DataValueField = "WbsSetCode";
|
||||
this.drpWbsSet.DataTextField = "WbsSetName";
|
||||
this.drpWbsSet.DataSource = BLL.WbsSetInitService.GetWbsSetInitsByUnitProjectCode(this.drpUnitProject.SelectedValue);
|
||||
this.drpWbsSet.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpWbsSet);
|
||||
this.drpWbsSet.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpWbsSet.Items.Clear();
|
||||
Funs.FineUIPleaseSelect(drpWbsSet);
|
||||
this.drpWbsSet.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class WorkloadStatistics {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtMonths 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtMonths;
|
||||
|
||||
/// <summary>
|
||||
/// drpCnProfession 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCnProfession;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnitProject 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitProject;
|
||||
|
||||
/// <summary>
|
||||
/// drpWbsSet 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpWbsSet;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user