20230531 脚本、版本日志整理
This commit is contained in:
@@ -13731,7 +13731,7 @@
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>0</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:9492/</IISUrl>
|
||||
<IISUrl>http://localhost:14646/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>安全费用管理</title>
|
||||
<title>HSE费用申请表</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -12,7 +12,7 @@
|
||||
<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" ShowHeader="false" Title="分包HSE费用管理" EnableCollapse="true"
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="HSE费用申请表" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="CostManageId"
|
||||
DataIDField="CostManageId" AllowSorting="true" SortField="CostManageCode" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
EnableColumnLines="true" EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" >
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="drpUnit" EnableEdit="true" Width="300px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
@@ -46,8 +45,8 @@
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
|
||||
<Listeners>
|
||||
<%-- <f:Listener Event="dataload" Handler="onGridDataLoad" />--%>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
@@ -63,7 +62,7 @@
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="费用计划" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
|
||||
Width="1200px" Height="650px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="按单位" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
@@ -89,6 +88,9 @@
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
//function onGridDataLoad(event) {
|
||||
// this.mergeColumns(['SupCostTypeName'], { depends: true });
|
||||
//}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.CostGoods
|
||||
{
|
||||
@@ -31,8 +33,8 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
InitYearGrid();
|
||||
}
|
||||
|
||||
protected static DateTime sDate = new DateTime();
|
||||
protected static DateTime eDate = new DateTime();
|
||||
protected static int sDate = 0;
|
||||
protected static int eDate = 0;
|
||||
#region 按年份
|
||||
private void InitYearGrid()
|
||||
{
|
||||
@@ -66,14 +68,29 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
var getProject = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == this.ProjectId);
|
||||
if (getProject != null)
|
||||
{
|
||||
sDate= getProject.StartDate ?? DateTime.Now;
|
||||
eDate = getProject.EndDate ?? DateTime.Now;
|
||||
for (int i = 0; sDate.Year + i <= eDate.Year; i++)
|
||||
sDate= getProject.StartDate.HasValue ? getProject.StartDate.Value.Year : DateTime.Now.Year;
|
||||
eDate = getProject.EndDate.HasValue ? getProject.EndDate.Value.Year: DateTime.Now.Year;
|
||||
var getCostEx = Funs.DB.CostGoods_Expense.Where(x => x.ProjectId == this.ProjectId);
|
||||
if (getCostEx.Count() > 0)
|
||||
{
|
||||
var getMaxYear = getCostEx.Max(x => x.Year);
|
||||
if (getMaxYear.HasValue && getMaxYear > eDate)
|
||||
{
|
||||
eDate = getMaxYear.Value;
|
||||
}
|
||||
var getMinYear = getCostEx.Min(x => x.Year);
|
||||
if (getMinYear.HasValue && getMinYear < sDate)
|
||||
{
|
||||
sDate = getMinYear.Value;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; sDate + i <= eDate; i++)
|
||||
{
|
||||
bf = new FineUIPro.BoundField();
|
||||
bf.DataField = (sDate.Year + i).ToString();
|
||||
bf.DataField = (sDate + i).ToString();
|
||||
bf.DataFormatString = "{0}";
|
||||
bf.HeaderText = (sDate.Year + i).ToString() +"年";
|
||||
bf.HeaderText = (sDate + i).ToString() +"年";
|
||||
bf.Width = 200;
|
||||
bf.HeaderTextAlign = TextAlign.Center;
|
||||
Grid1.Columns.Add(bf);
|
||||
@@ -136,9 +153,9 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
table.Columns.Add(new DataColumn("Id", typeof(string)));
|
||||
table.Columns.Add(new DataColumn("SupCostTypeName", typeof(string)));
|
||||
table.Columns.Add(new DataColumn("CostTypeName", typeof(string)));
|
||||
for (int i = 0; sDate.Year + i <= eDate.Year; i++)
|
||||
for (int i = 0; sDate + i <= eDate; i++)
|
||||
{
|
||||
table.Columns.Add(new DataColumn((sDate.Year + i).ToString(), typeof(string)));
|
||||
table.Columns.Add(new DataColumn((sDate + i).ToString(), typeof(string)));
|
||||
}
|
||||
|
||||
table.Columns.Add(new DataColumn("SumC", typeof(String)));
|
||||
@@ -150,30 +167,34 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
where y.ProjectId == this.ProjectId && y.UnitId == this.drpUnit.SelectedValue
|
||||
orderby y.Year, x.SupSortIndex, x.SortIndex
|
||||
select new { x.ExpenseDetailId, x.ExpenseId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
|
||||
|
||||
foreach (var item in getDetail)
|
||||
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
|
||||
foreach (var item in getType)
|
||||
{
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = item.ExpenseDetailId +"#" +item.ExpenseId;
|
||||
row[1] = item.SupCostTypeName;
|
||||
row[2] = item.CostTypeName;
|
||||
int r = 3;
|
||||
for (int i = 0; sDate.Year + i <= eDate.Year; i++)
|
||||
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
|
||||
if (getD != null)
|
||||
{
|
||||
var getV = getDetail.Where(x => x.Year == sDate.Year + i && x.CostType == item.CostType);
|
||||
if (getV.Count() > 0)
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = getD.ExpenseDetailId + "#" + getD.ExpenseId;
|
||||
row[1] = getD.SupCostTypeName;
|
||||
row[2] = getD.CostTypeName;
|
||||
int r = 3;
|
||||
for (int i = 0; sDate + i <= eDate; i++)
|
||||
{
|
||||
row[r] = getV.Sum(x => x.CostMoney ?? 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
var getV = getDetail.Where(x => x.Year == sDate + i && x.CostType == item.CostType);
|
||||
if (getV.Count() > 0)
|
||||
{
|
||||
row[r] = getV.Sum(x => x.CostMoney ?? 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
|
||||
r = i + 4;
|
||||
r = i + 4;
|
||||
}
|
||||
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -183,30 +204,34 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
where y.ProjectId == this.ProjectId
|
||||
orderby y.Year, x.SupSortIndex, x.SortIndex
|
||||
select new { x.ExpenseDetailId, x.ExpenseId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
|
||||
|
||||
foreach (var item in getDetail)
|
||||
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
|
||||
foreach (var item in getType)
|
||||
{
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = item.ExpenseDetailId + "#" + item.ExpenseId;
|
||||
row[1] = item.SupCostTypeName;
|
||||
row[2] = item.CostTypeName;
|
||||
int r = 3;
|
||||
for (int i = 0; sDate.Year + i <= eDate.Year; i++)
|
||||
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
|
||||
if (getD != null)
|
||||
{
|
||||
var getV = getDetail.Where(x => x.Year == sDate.Year + i && x.CostType == item.CostType);
|
||||
if (getV.Count() > 0)
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = getD.ExpenseDetailId + "#" + getD.ExpenseId;
|
||||
row[1] = getD.SupCostTypeName;
|
||||
row[2] = getD.CostTypeName;
|
||||
int r = 3;
|
||||
for (int i = 0; sDate + i <= eDate; i++)
|
||||
{
|
||||
row[r] = getV.Sum(x => x.CostMoney ?? 0);
|
||||
var getV = getDetail.Where(x => x.Year == sDate + i && x.CostType == item.CostType);
|
||||
if (getV.Count() > 0)
|
||||
{
|
||||
row[r] = getV.Sum(x => x.CostMoney ?? 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = "0.00";
|
||||
}
|
||||
|
||||
r = i + 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = "0.00";
|
||||
}
|
||||
|
||||
r = i + 4;
|
||||
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,9 +253,9 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = this.Grid1.RecordCount;
|
||||
|
||||
Response.Write(GetTableHtml(GetDataTable()));
|
||||
Response.Write(GetGridTableHtml(this.Grid1));
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页 排序
|
||||
@@ -316,11 +341,11 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
{
|
||||
if (this.btnMenuEdit.Hidden || type == "view") ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ExpenseView.aspx?ExpenseId={0}", id, "查看 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ExpenseView.aspx?ExpenseId={0}", getEx.ExpenseId, "查看 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ExpenseEdit.aspx?ExpenseId={0}", id, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ExpenseEdit.aspx?ExpenseId={0}", getEx.ExpenseId, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,5 +418,10 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
LoadData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,120 +30,34 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" IsFluid="true" BodyPadding="10" EnableCollapse="false" Title="" runat="server" ShowHeader="false">
|
||||
<Items>
|
||||
<f:GroupPanel Title="安全施工(单位:元)" BodyPadding="10" ID="GroupPanel1" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="SimpleForm2" ShowBorder="false" ShowHeader="false" runat="server" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="办公用品" FocusOnPageLoad="true" ID="txtA1" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="HSE培训" ID="txtA2" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="警示标识" ID="txtA3" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="检测器具" ID="txtA4" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="安全奖励" ID="txtA5" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="安全技术" ID="txtA6" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="安全用电" ID="txtA7" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="高处作业及临边孔洞" LabelWidth="150px" ID="txtA8" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="气瓶防护" ID="txtA9" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="脚手架(防护)" LabelWidth="150px" ID="txtA10" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="木工防护棚" ID="txtA11" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="钢筋加工防护棚" LabelWidth="150px" ID="txtA12" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="受限空间" ID="txtA13" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="机械设备" ID="txtA14" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="喷砂作业" ID="txtA15" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="消防" ID="txtA16" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="应急" ID="txtA17" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="化工试车" ID="txtA18" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel Title="职业健康(单位:元)" BodyPadding="10" ID="GroupPanel2" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="50% 25% 25%">
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="临时设施(饮水间、厕所、吸烟室等)" LabelWidth="250px"
|
||||
ID="txtB1" DecimalPrecision="2" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="防护用品" ID="txtB2" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="体检费用" ID="txtB3" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel Title="环境保护(单位:元)" BodyPadding="10" ID="GroupPanel3" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="Form3" ShowBorder="false" ShowHeader="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="噪声控制"
|
||||
ID="txtC1" DecimalPrecision="2" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="扬尘控制" ID="txtC2" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="固体废弃物清理" LabelWidth="150px" ID="txtC3" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="污水处理"
|
||||
ID="txtC4" DecimalPrecision="2" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="高危物质控制" LabelWidth="150px" ID="txtC5" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="防辐射" ID="txtC6" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel Title="文明施工(单位:元)" BodyPadding="10" ID="GroupPanel4" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="Form4" ShowBorder="false" ShowHeader="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox runat="server" Label="场容场貌"
|
||||
ID="txtD1" DecimalPrecision="2" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="宣传标识" ID="txtD2" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
<f:NumberBox runat="server" Label="智慧化工地" ID="txtD3" DecimalPrecision="2" NoNegative="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="ExpenseDetailId" AllowCellEditing="true" SortField="SupSortIndex,SortIndex" AllowSorting="true"
|
||||
ClicksToEdit="1" DataIDField="ExpenseDetailId" EnableColumnLines="true" ForceFit="true"
|
||||
EnableHeaderMenu="false">
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="SupCostTypeName" DataField="SupCostTypeName" FieldType="String"
|
||||
HeaderTextAlign="Center" TextAlign="Center" HeaderText="类别名称">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="CostTypeName" DataField="CostTypeName" FieldType="String"
|
||||
HeaderTextAlign="Center" TextAlign="Center" HeaderText="分项名称">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="CostMoney" DataField="CostMoney" SortField="CostMoney"
|
||||
FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" HeaderText="计划费用">
|
||||
<Editor>
|
||||
<f:NumberBox ID="txtCostMoney" Text='<%# Eval("CostMoney")%>' runat="server" DecimalPrecision="2" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="1px" ColumnID="ExpenseDetailId" DataField="ExpenseDetailId"
|
||||
FieldType="String" HeaderText="主键" Hidden="true" HeaderTextAlign="Center">
|
||||
<Editor>
|
||||
<f:TextBox runat="server" ID="txtExpenseDetailId" Text='<%# Eval("ExpenseDetailId")%>'>
|
||||
</f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
@@ -169,4 +83,4 @@
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.HSSE.License;
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -49,82 +52,101 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideRefreshReference();
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, false);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN;
|
||||
this.txtYear.Text = DateTime.Now.Year.ToString();
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && !CommonService.IsSedinOrSub(this.CurrUser.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnit.Readonly = true;
|
||||
}
|
||||
|
||||
this.ExpenseId = Request.Params["ExpenseId"];
|
||||
Model.CostGoods_Expense expense = new Model.CostGoods_Expense();
|
||||
if (string.IsNullOrEmpty(this.ExpenseId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN;
|
||||
this.txtYear.Text = DateTime.Now.Year.ToString();
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
var getEx = Funs.DB.CostGoods_Expense.FirstOrDefault(x => x.UnitId == this.drpUnit.SelectedValue && x.Year == Funs.GetNewInt(this.txtYear.Text));
|
||||
if (getEx != null)
|
||||
{
|
||||
this.ExpenseId = getEx.ExpenseId;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CommonService.IsSedinOrSub(this.drpUnit.SelectedValue))
|
||||
{
|
||||
this.lbSortIndex.Text = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
var index = Funs.DB.CostGoods_Expense.Where(x => x.Year.ToString() == this.txtYear.Text).Max(x => x.SortIndex);
|
||||
if (index.HasValue)
|
||||
{
|
||||
this.lbSortIndex.Text = (index.Value + 1).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbSortIndex.Text = "2";
|
||||
}
|
||||
}
|
||||
|
||||
Model.CostGoods_Expense newExpense = new Model.CostGoods_Expense
|
||||
{
|
||||
ExpenseId = SQLHelper.GetNewID(),
|
||||
ProjectId = this.ProjectId,
|
||||
UnitId = this.drpUnit.SelectedValue,
|
||||
ReportDate = DateTime.Now,
|
||||
CreateDate = DateTime.Now,
|
||||
CompileMan =this.CurrUser.PersonId,
|
||||
CompileDate = DateTime.Now,
|
||||
Year =Funs.GetNewInt(this.txtYear.Text),
|
||||
SortIndex=Funs.GetNewIntOrZero(this.lbSortIndex.Text),
|
||||
};
|
||||
|
||||
ExpenseService.AddExpense(newExpense);
|
||||
ExpenseDetailService.AddCostDetail(newExpense.ExpenseId);
|
||||
}
|
||||
expense = Funs.DB.CostGoods_Expense.FirstOrDefault(x =>x.ProjectId == this.ProjectId && x.UnitId == this.drpUnit.SelectedValue && x.Year == Funs.GetNewInt(this.txtYear.Text));
|
||||
}
|
||||
else
|
||||
{
|
||||
expense = BLL.ExpenseService.GetExpenseById(this.ExpenseId);
|
||||
}
|
||||
|
||||
SetPage(BLL.ExpenseService.GetExpenseById(this.ExpenseId));
|
||||
SetPage(expense);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 页面呈现
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private void SetPage(Model.CostGoods_Expense expense)
|
||||
{
|
||||
{
|
||||
if (expense != null)
|
||||
{
|
||||
{
|
||||
this.ExpenseId = expense.ExpenseId;
|
||||
this.ProjectId = expense.ProjectId;
|
||||
this.drpUnit.SelectedValue = expense.UnitId;
|
||||
this.txtYear.Text = expense.Year.ToString();
|
||||
this.lbSortIndex.Text=expense.SortIndex.ToString();
|
||||
|
||||
}
|
||||
this.lbSortIndex.Text = expense.SortIndex.ToString();
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", expense.ReportDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
int Year = Funs.GetNewIntOrZero(this.txtYear.Text);
|
||||
var getProject = ProjectService.GetProjectByProjectId(this.ProjectId);
|
||||
if (getProject != null && (!getProject.EndDate.HasValue || Year <= getProject.EndDate.Value.Year) && (!getProject.StartDate.HasValue || Year >= getProject.StartDate.Value.Year))
|
||||
{
|
||||
if (CommonService.IsSedinOrSub(this.drpUnit.SelectedValue))
|
||||
{
|
||||
this.lbSortIndex.Text = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
var index = Funs.DB.CostGoods_Expense.Where(x =>x.ProjectId == this.ProjectId && x.Year.ToString() == this.txtYear.Text).Max(x => x.SortIndex);
|
||||
if (index.HasValue)
|
||||
{
|
||||
this.lbSortIndex.Text = (index.Value + 1).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbSortIndex.Text = "2";
|
||||
}
|
||||
}
|
||||
|
||||
Model.CostGoods_Expense newExpense = new Model.CostGoods_Expense
|
||||
{
|
||||
ExpenseId = SQLHelper.GetNewID(),
|
||||
ProjectId = this.ProjectId,
|
||||
UnitId = this.drpUnit.SelectedValue,
|
||||
ReportDate = DateTime.Now,
|
||||
CreateDate = DateTime.Now,
|
||||
CompileMan = this.CurrUser.PersonId,
|
||||
CompileDate = DateTime.Now,
|
||||
Year = Funs.GetNewInt(this.txtYear.Text),
|
||||
SortIndex = Funs.GetNewIntOrZero(this.lbSortIndex.Text),
|
||||
};
|
||||
|
||||
ExpenseService.AddExpense(newExpense);
|
||||
this.ExpenseId = newExpense.ExpenseId;
|
||||
ExpenseDetailService.AddCostDetail(this.ExpenseId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("选择年度不在项目开始和竣工时间范围内!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.Grid1.DataSource = from x in Funs.DB.CostGoods_ExpenseDetail
|
||||
where x.ExpenseId == this.ExpenseId
|
||||
orderby x.SupSortIndex, x.SortIndex
|
||||
select x;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
@@ -157,8 +179,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
CompileDate = DateTime.Now,
|
||||
CompileMan = this.CurrUser.PersonId,
|
||||
SortIndex = Funs.GetNewInt(this.lbSortIndex.Text),
|
||||
Year =Funs.GetNewInt(this.txtYear.Text),
|
||||
|
||||
Year =Funs.GetNewInt(this.txtYear.Text),
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(this.ExpenseId))
|
||||
@@ -166,7 +187,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
expense.ExpenseId = this.ExpenseId;
|
||||
BLL.ExpenseService.UpdateExpense(expense);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, expense.ExpenseCode, expense.ExpenseId, BLL.Const.ProjectExpenseMenuId, BLL.Const.BtnModify);
|
||||
BLL.ExpenseDetailService.DeleteCostDetailByExpenseId(this.ExpenseId);
|
||||
// BLL.ExpenseDetailService.DeleteCostDetailByExpenseId(this.ExpenseId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -176,7 +197,12 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
BLL.ExpenseService.AddExpense(expense);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, expense.ExpenseCode, expense.ExpenseId, BLL.Const.ProjectExpenseMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
|
||||
|
||||
var getItem = jerqueSaveList();
|
||||
foreach (var item in getItem)
|
||||
{
|
||||
ExpenseDetailService.UpdateExpenseDetail(item);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -196,8 +222,6 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 单位变化事件
|
||||
/// <summary>
|
||||
/// 单位变化事件
|
||||
@@ -208,9 +232,33 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
{
|
||||
if (this.drpUnit.SelectedValue != Const._Null && !string.IsNullOrEmpty(this.txtYear.Text))
|
||||
{
|
||||
SetPage(Funs.DB.CostGoods_Expense.FirstOrDefault(x => x.UnitId == this.drpUnit.SelectedValue && x.Year.ToString() == this.txtYear.Text));
|
||||
SetPage(Funs.DB.CostGoods_Expense.FirstOrDefault(x =>x.ProjectId == this.ProjectId && x.UnitId == this.drpUnit.SelectedValue && x.Year.ToString() == this.txtYear.Text));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存集合
|
||||
/// <summary>
|
||||
/// 保存集合
|
||||
/// </summary>
|
||||
private List<Model.CostGoods_ExpenseDetail> jerqueSaveList()
|
||||
{
|
||||
var returnList = Funs.DB.CostGoods_ExpenseDetail.Where(x => x.ExpenseId == this.ExpenseId);
|
||||
JArray mergedData = Grid1.GetMergedData();
|
||||
foreach (JObject mergedRow in mergedData)
|
||||
{
|
||||
string status = mergedRow.Value<string>("status");
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
var item = returnList.FirstOrDefault(e => e.ExpenseDetailId == values.Value<string>("ExpenseDetailId"));
|
||||
if (item != null)
|
||||
{
|
||||
item.CostMoney = Funs.GetNewDecimalOrZero(values.Value<string>("CostMoney"));
|
||||
}
|
||||
|
||||
}
|
||||
return returnList.ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
+6
-330
@@ -78,355 +78,31 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
protected global::FineUIPro.Label lbSortIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel1 控件。
|
||||
/// txtCostMoney 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel1;
|
||||
protected global::FineUIPro.NumberBox txtCostMoney;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm2 控件。
|
||||
/// txtExpenseDetailId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm2;
|
||||
|
||||
/// <summary>
|
||||
/// txtA1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA1;
|
||||
|
||||
/// <summary>
|
||||
/// txtA2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA2;
|
||||
|
||||
/// <summary>
|
||||
/// txtA3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA3;
|
||||
|
||||
/// <summary>
|
||||
/// txtA4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA4;
|
||||
|
||||
/// <summary>
|
||||
/// txtA5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA5;
|
||||
|
||||
/// <summary>
|
||||
/// txtA6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA6;
|
||||
|
||||
/// <summary>
|
||||
/// txtA7 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA7;
|
||||
|
||||
/// <summary>
|
||||
/// txtA8 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA8;
|
||||
|
||||
/// <summary>
|
||||
/// txtA9 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA9;
|
||||
|
||||
/// <summary>
|
||||
/// txtA10 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA10;
|
||||
|
||||
/// <summary>
|
||||
/// txtA11 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA11;
|
||||
|
||||
/// <summary>
|
||||
/// txtA12 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA12;
|
||||
|
||||
/// <summary>
|
||||
/// txtA13 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA13;
|
||||
|
||||
/// <summary>
|
||||
/// txtA14 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA14;
|
||||
|
||||
/// <summary>
|
||||
/// txtA15 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA15;
|
||||
|
||||
/// <summary>
|
||||
/// txtA16 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA16;
|
||||
|
||||
/// <summary>
|
||||
/// txtA17 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA17;
|
||||
|
||||
/// <summary>
|
||||
/// txtA18 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtA18;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel2;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// txtB1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtB1;
|
||||
|
||||
/// <summary>
|
||||
/// txtB2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtB2;
|
||||
|
||||
/// <summary>
|
||||
/// txtB3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtB3;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel3;
|
||||
|
||||
/// <summary>
|
||||
/// Form3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form3;
|
||||
|
||||
/// <summary>
|
||||
/// txtC1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtC1;
|
||||
|
||||
/// <summary>
|
||||
/// txtC2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtC2;
|
||||
|
||||
/// <summary>
|
||||
/// txtC3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtC3;
|
||||
|
||||
/// <summary>
|
||||
/// txtC4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtC4;
|
||||
|
||||
/// <summary>
|
||||
/// txtC5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtC5;
|
||||
|
||||
/// <summary>
|
||||
/// txtC6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtC6;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel4;
|
||||
|
||||
/// <summary>
|
||||
/// Form4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form4;
|
||||
|
||||
/// <summary>
|
||||
/// txtD1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtD1;
|
||||
|
||||
/// <summary>
|
||||
/// txtD2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtD2;
|
||||
|
||||
/// <summary>
|
||||
/// txtD3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtD3;
|
||||
protected global::FineUIPro.TextBox txtExpenseDetailId;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
bf.DataField = "CostTypeName";
|
||||
bf.DataFormatString = "{0}";
|
||||
bf.HeaderText = "分项名称";
|
||||
bf.Width = 120;
|
||||
bf.Width = 150;
|
||||
bf.HeaderTextAlign = TextAlign.Center;
|
||||
Grid1.Columns.Add(bf);
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
bf.DataField = item.UnitId;
|
||||
bf.DataFormatString = "{0}";
|
||||
bf.HeaderText = item.UnitName;
|
||||
bf.Width = 200;
|
||||
bf.Width = 220;
|
||||
Grid1.Columns.Add(bf);
|
||||
}
|
||||
|
||||
@@ -100,6 +100,10 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
Grid1.Columns.Add(bf);
|
||||
|
||||
Grid1.DataKeyNames = new string[] { "Id", "CostTypeName" };
|
||||
if (Grid1.Columns.Count() > 9)
|
||||
{
|
||||
Grid1.ForceFit = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -163,45 +167,49 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
where y.ProjectId == this.ProjectId && y.Year == year
|
||||
orderby y.Year, x.SupSortIndex, x.SortIndex
|
||||
select new { x.ExpenseDetailId, x.ExpenseId,y.UnitId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
|
||||
|
||||
foreach (var item in getDetail)
|
||||
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
|
||||
foreach (var item in getType)
|
||||
{
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = item.ExpenseDetailId +"#" +item.ExpenseId;
|
||||
row[1] = item.SupCostTypeName;
|
||||
row[2] = item.CostTypeName;
|
||||
int r = 3;
|
||||
foreach (var uitem in getUnit)
|
||||
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
|
||||
if (getD != null)
|
||||
{
|
||||
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD1.Count() > 0)
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = getD.ExpenseDetailId + "#" + getD.ExpenseId;
|
||||
row[1] = getD.SupCostTypeName;
|
||||
row[2] = getD.CostTypeName;
|
||||
int r = 3;
|
||||
foreach (var uitem in getUnit)
|
||||
{
|
||||
row[r] = getD1.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD1.Count() > 0)
|
||||
{
|
||||
row[r] = getD1.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
|
||||
r++;
|
||||
}
|
||||
|
||||
r++;
|
||||
foreach (var suitem in getSUnit)
|
||||
{
|
||||
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD2.Count() > 0)
|
||||
{
|
||||
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
r++;
|
||||
}
|
||||
|
||||
row[r] = getDetail.Where(x => x.Year == getD.Year && x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
|
||||
foreach (var suitem in getSUnit)
|
||||
{
|
||||
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD2.Count() > 0)
|
||||
{
|
||||
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
r++;
|
||||
}
|
||||
|
||||
row[r] = getDetail.Where(x =>x.Year==item.Year && x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -212,44 +220,49 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
orderby y.Year, x.SupSortIndex, x.SortIndex
|
||||
select new { x.ExpenseDetailId, x.ExpenseId,y.UnitId, y.Year, x.SupCostTypeId, x.SupCostTypeName, x.SupSortIndex, x.CostType, x.CostTypeName, x.SortIndex, x.CostMoney };
|
||||
|
||||
foreach (var item in getDetail)
|
||||
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
|
||||
foreach (var item in getType)
|
||||
{
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = item.ExpenseDetailId + "#" + item.ExpenseId;
|
||||
row[1] = item.SupCostTypeName;
|
||||
row[2] = item.CostTypeName;
|
||||
int r = 3;
|
||||
foreach (var uitem in getUnit)
|
||||
var getD = getDetail.FirstOrDefault(x => x.CostType == item.CostType);
|
||||
if (getD != null)
|
||||
{
|
||||
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD1.Count() > 0)
|
||||
DataRow row = table.NewRow();
|
||||
row[0] = getD.ExpenseDetailId + "#" + getD.ExpenseId;
|
||||
row[1] = getD.SupCostTypeName;
|
||||
row[2] = getD.CostTypeName;
|
||||
int r = 3;
|
||||
foreach (var uitem in getUnit)
|
||||
{
|
||||
row[r] = getD1.Sum(X=>X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
|
||||
r++;
|
||||
}
|
||||
var getD1 = getDetail.Where(x => x.UnitId == uitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD1.Count() > 0)
|
||||
{
|
||||
row[r] = getD1.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
|
||||
foreach (var suitem in getSUnit)
|
||||
{
|
||||
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD2.Count() > 0)
|
||||
{
|
||||
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
r++;
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
r++;
|
||||
}
|
||||
|
||||
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
foreach (var suitem in getSUnit)
|
||||
{
|
||||
var getD2 = getDetail.Where(x => x.UnitId == suitem.UnitId && x.CostType == item.CostType);
|
||||
if (getD2.Count() > 0)
|
||||
{
|
||||
row[r] = getD2.Sum(X => X.CostMoney ?? 0).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
row[r] = 0.00;
|
||||
}
|
||||
r++;
|
||||
}
|
||||
|
||||
row[r] = getDetail.Where(x => x.CostType == item.CostType).Sum(x => x.CostMoney ?? 0);
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +284,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
this.Grid1.PageSize = this.Grid1.RecordCount;
|
||||
|
||||
Response.Write(GetTableHtml(GetDataTable()));
|
||||
Response.Write(GetGridTableHtml(this.Grid1));
|
||||
Response.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExpenseView.aspx.cs" Inherits="FineUIPro.Web.HSSE.CostGoods.ExpenseView"
|
||||
ValidateRequest="false" %>
|
||||
|
||||
<%@ Register Src="~/Controls/FlowOperateControl.ascx" TagName="FlowOperateControl"
|
||||
TagPrefix="uc1" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
@@ -19,131 +17,35 @@
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="50% 25% 20%">
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="drpUnit" Label="单位" Readonly="true">
|
||||
<f:DropDownList runat="server" ID="drpUnit" EnableEdit="true" Label="单位"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker runat="server" Required="true" DateFormatString="yyyy" Label="年度" AutoPostBack="true"
|
||||
ID="txtYear" DisplayType="Year" ShowTodayButton="false" OnTextChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DatePicker>
|
||||
<f:TextBox ID="txtReportDate" runat="server" Label="填报日期" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="年度" ID="txtYear" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtReportDate" runat="server" Label="填报日期" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:Label runat="server" ID="lbSortIndex" Hidden="true"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" IsFluid="true" BodyPadding="10" EnableCollapse="false" Title="" runat="server" ShowHeader="false">
|
||||
<Items>
|
||||
<f:GroupPanel Title="安全施工(单位:元)" BodyPadding="10" ID="GroupPanel1" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="SimpleForm2" ShowBorder="false" ShowHeader="false" runat="server" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="办公用品" ID="txtA1" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="HSE培训" ID="txtA2" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="警示标识" ID="txtA3" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="检测器具" ID="txtA4" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="安全奖励" ID="txtA5" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="安全技术" ID="txtA6" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="安全用电" ID="txtA7" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="高处作业及临边孔洞" LabelWidth="150px" ID="txtA8" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="气瓶防护" ID="txtA9" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="脚手架(防护)" LabelWidth="150px" ID="txtA10" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="木工防护棚" ID="txtA11" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="钢筋加工防护棚" LabelWidth="150px" ID="txtA12" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="受限空间" ID="txtA13" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="机械设备" ID="txtA14" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="喷砂作业" ID="txtA15" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="消防" ID="txtA16" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="应急" ID="txtA17" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="化工试车" ID="txtA18" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel Title="职业健康(单位:元)" BodyPadding="10" ID="GroupPanel2" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow ColumnWidths="50% 25% 25%">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="临时设施(饮水间、厕所、吸烟室等)" LabelWidth="250px"
|
||||
ID="txtB1" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="防护用品" ID="txtB2" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="体检费用" ID="txtB3" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel Title="环境保护(单位:元)" BodyPadding="10" ID="GroupPanel3" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="Form3" ShowBorder="false" ShowHeader="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="噪声控制"
|
||||
ID="txtC1" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="扬尘控制" ID="txtC2" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="固体废弃物清理" LabelWidth="150px" ID="txtC3" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="污水处理"
|
||||
ID="txtC4" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="高危物质控制" LabelWidth="150px" ID="txtC5" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="防辐射" ID="txtC6" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel Title="文明施工(单位:元)" BodyPadding="10" ID="GroupPanel4" EnableCollapse="true" runat="server">
|
||||
<Items>
|
||||
<f:Form ID="Form4" ShowBorder="false" ShowHeader="false" runat="server">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="场容场貌"
|
||||
ID="txtD1" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="宣传标识" ID="txtD2" Readonly="true"></f:TextBox>
|
||||
<f:TextBox runat="server" Label="智慧化工地" ID="txtD3" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="ExpenseDetailId" AllowCellEditing="true" SortField="SupSortIndex,SortIndex" AllowSorting="true"
|
||||
ClicksToEdit="1" DataIDField="ExpenseDetailId" EnableColumnLines="true" ForceFit="true"
|
||||
EnableHeaderMenu="false">
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="SupCostTypeName" DataField="SupCostTypeName" FieldType="String"
|
||||
HeaderTextAlign="Center" TextAlign="Center" HeaderText="类别名称">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="CostTypeName" DataField="CostTypeName" FieldType="String"
|
||||
HeaderTextAlign="Center" TextAlign="Center" HeaderText="分项名称">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="CostMoney" DataField="CostMoney" SortField="CostMoney"
|
||||
FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" HeaderText="计划费用" >
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
||||
@@ -22,6 +22,20 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
ViewState["ExpenseId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
@@ -34,27 +48,39 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideRefreshReference();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.ExpenseId = Request.Params["ExpenseId"];
|
||||
if (!string.IsNullOrEmpty(this.ExpenseId))
|
||||
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, false);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && !CommonService.IsSedinOrSub(this.CurrUser.UnitId))
|
||||
{
|
||||
var expense = BLL.ExpenseService.GetExpenseById(this.ExpenseId);
|
||||
if (expense != null)
|
||||
{
|
||||
if (expense != null)
|
||||
{
|
||||
this.ExpenseId = expense.ExpenseId;
|
||||
this.drpUnit.Text = UnitService.GetUnitNameByUnitId( expense.UnitId);
|
||||
this.txtYear.Text = expense.Year.ToString();
|
||||
this.lbSortIndex.Text = expense.SortIndex.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
this.drpUnit.Readonly = true;
|
||||
}
|
||||
|
||||
|
||||
SetPage(BLL.ExpenseService.GetExpenseById(this.ExpenseId));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void SetPage(Model.CostGoods_Expense expense)
|
||||
{
|
||||
if (expense != null)
|
||||
{
|
||||
this.drpUnit.SelectedValue = expense.UnitId;
|
||||
this.txtYear.Text = expense.Year.ToString();
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", expense.ReportDate);
|
||||
this.Grid1.DataSource = from x in Funs.DB.CostGoods_ExpenseDetail
|
||||
where x.ExpenseId == this.ExpenseId
|
||||
orderby x.SupSortIndex, x.SortIndex
|
||||
select x;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
@@ -69,5 +95,20 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 单位变化事件
|
||||
/// <summary>
|
||||
/// 单位变化事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpUnit.SelectedValue != Const._Null && !string.IsNullOrEmpty(this.txtYear.Text))
|
||||
{
|
||||
SetPage(Funs.DB.CostGoods_Expense.FirstOrDefault(x => x.ProjectId == this.ProjectId && x.UnitId == this.drpUnit.SelectedValue && x.Year.ToString() == this.txtYear.Text));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+4
-355
@@ -48,7 +48,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox drpUnit;
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtYear 控件。
|
||||
@@ -57,7 +57,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtYear;
|
||||
protected global::FineUIPro.DatePicker txtYear;
|
||||
|
||||
/// <summary>
|
||||
/// txtReportDate 控件。
|
||||
@@ -69,364 +69,13 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
protected global::FineUIPro.TextBox txtReportDate;
|
||||
|
||||
/// <summary>
|
||||
/// lbSortIndex 控件。
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbSortIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm2;
|
||||
|
||||
/// <summary>
|
||||
/// txtA1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA1;
|
||||
|
||||
/// <summary>
|
||||
/// txtA2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA2;
|
||||
|
||||
/// <summary>
|
||||
/// txtA3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA3;
|
||||
|
||||
/// <summary>
|
||||
/// txtA4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA4;
|
||||
|
||||
/// <summary>
|
||||
/// txtA5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA5;
|
||||
|
||||
/// <summary>
|
||||
/// txtA6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA6;
|
||||
|
||||
/// <summary>
|
||||
/// txtA7 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA7;
|
||||
|
||||
/// <summary>
|
||||
/// txtA8 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA8;
|
||||
|
||||
/// <summary>
|
||||
/// txtA9 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA9;
|
||||
|
||||
/// <summary>
|
||||
/// txtA10 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA10;
|
||||
|
||||
/// <summary>
|
||||
/// txtA11 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA11;
|
||||
|
||||
/// <summary>
|
||||
/// txtA12 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA12;
|
||||
|
||||
/// <summary>
|
||||
/// txtA13 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA13;
|
||||
|
||||
/// <summary>
|
||||
/// txtA14 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA14;
|
||||
|
||||
/// <summary>
|
||||
/// txtA15 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA15;
|
||||
|
||||
/// <summary>
|
||||
/// txtA16 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA16;
|
||||
|
||||
/// <summary>
|
||||
/// txtA17 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA17;
|
||||
|
||||
/// <summary>
|
||||
/// txtA18 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtA18;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel2;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// txtB1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtB1;
|
||||
|
||||
/// <summary>
|
||||
/// txtB2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtB2;
|
||||
|
||||
/// <summary>
|
||||
/// txtB3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtB3;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel3;
|
||||
|
||||
/// <summary>
|
||||
/// Form3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form3;
|
||||
|
||||
/// <summary>
|
||||
/// txtC1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtC1;
|
||||
|
||||
/// <summary>
|
||||
/// txtC2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtC2;
|
||||
|
||||
/// <summary>
|
||||
/// txtC3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtC3;
|
||||
|
||||
/// <summary>
|
||||
/// txtC4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtC4;
|
||||
|
||||
/// <summary>
|
||||
/// txtC5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtC5;
|
||||
|
||||
/// <summary>
|
||||
/// txtC6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtC6;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel4;
|
||||
|
||||
/// <summary>
|
||||
/// Form4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form4;
|
||||
|
||||
/// <summary>
|
||||
/// txtD1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtD1;
|
||||
|
||||
/// <summary>
|
||||
/// txtD2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtD2;
|
||||
|
||||
/// <summary>
|
||||
/// txtD3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtD3;
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
DataIDField="TestPlanId" AllowSorting="true" SortField="TestStartTime" ForceFit="true"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True" EnableDelayRender="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
SortField="JobNum" ForceFit="true" EnableColumnLines="true" BoxFlex="1" PageSize="10"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True" EnableDelayRender="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
|
||||
Reference in New Issue
Block a user