修改员工考核
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
<Items>
|
||||
<f:HiddenField runat="server" ID="hdWorkPostId"></f:HiddenField>
|
||||
<f:HiddenField runat="server" ID="hdMachineId"></f:HiddenField>
|
||||
<f:HiddenField runat="server" ID="hdConstructionLogId"></f:HiddenField>
|
||||
<f:Button ID="btnSave" Text="保存" ToolTip="保存施工日志" Icon="SystemSave" runat="server" OnClick="btnSave_Click" ValidateForms="SimpleForm1">
|
||||
</f:Button>
|
||||
</Items>
|
||||
@@ -80,9 +81,11 @@
|
||||
<f:DropDownList ID="drpProfessional" runat="server" Label="专业工程" LabelAlign="Right" EnableEdit="true" EnableCheckBoxSelect="true" EnableMultiSelect="true" Required="true" ShowRedStar="true" LabelWidth="120px"></f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="33% 67%">
|
||||
<f:FormRow ColumnWidths="13% 20% 67%">
|
||||
<Items>
|
||||
<f:TextBox ID="txtState" Label="填报状态" runat="server" LabelAlign="Right" LabelWidth="120px" Readonly="true"></f:TextBox>
|
||||
<f:Label runat="server" Text="填报状态:" EncodeText="false" ShowRedStar="true" Label="附件:" CssStyle="padding-left:42px" Width="110px" CssClass="marginr" ShowLabel="false" ></f:Label>
|
||||
<f:Button ID="btnWorkEfficiency" Text="未填报" ToolTip="填报工效数据" Icon="TableCell" OnClick="btnWorkEfficiency_Click" runat="server">
|
||||
</f:Button>
|
||||
<f:TextBox ID="txtRemark" Label="备注" runat="server" LabelAlign="Right" LabelWidth="120px"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
@@ -350,7 +353,7 @@
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="编辑" Hidden="true" EnableIFrame="true" EnableMaximize="false"
|
||||
Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="1300px" Height="680px">
|
||||
Width="1300px" Height="650px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
|
||||
@@ -228,6 +228,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
this.hdWorkPostId.Text = log.WorkPostId;
|
||||
this.hdMachineId.Text = log.MachineId;
|
||||
this.hdConstructionLogId.Text = log.ConstructionLogId;
|
||||
this.txtFileCode.Text = log.FileCode;
|
||||
if (log.CompileDate != null)
|
||||
{
|
||||
@@ -513,6 +514,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
this.Grid5.DataSource = records;
|
||||
this.Grid5.DataBind();
|
||||
}
|
||||
ChangeText();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,6 +539,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
private void TextNew()
|
||||
{
|
||||
this.ConstructionLogId = string.Empty;
|
||||
this.hdConstructionLogId.Text = string.Empty;
|
||||
DateTime today = DateTime.Now.Date;
|
||||
if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim()))
|
||||
{
|
||||
@@ -589,7 +592,6 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
}
|
||||
}
|
||||
}
|
||||
this.txtState.Text = string.Empty;
|
||||
this.txtRemark.Text = string.Empty;
|
||||
this.txtHSETodaySummary.Text = string.Empty;
|
||||
this.txtHSETodaySummaryRemark.Text = string.Empty;
|
||||
@@ -610,6 +612,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
this.Grid5.DataSource = null;
|
||||
this.Grid5.DataBind();
|
||||
drpUnitWork_SelectedIndexChanged(null, null);
|
||||
ChangeText();
|
||||
}
|
||||
|
||||
private void TextEmpty()
|
||||
@@ -624,7 +627,6 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
this.drpContractNo.SelectedIndex = 0;
|
||||
this.drpUnitWork.SelectedIndex = 0;
|
||||
this.drpProfessional.SelectedIndex = 0;
|
||||
this.txtState.Text = string.Empty;
|
||||
this.txtRemark.Text = string.Empty;
|
||||
this.txtHSETodaySummary.Text = string.Empty;
|
||||
this.txtHSETodaySummaryRemark.Text = string.Empty;
|
||||
@@ -792,7 +794,14 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
select x).FirstOrDefault();
|
||||
if (personLog == null)
|
||||
{
|
||||
log.ConstructionLogId = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionLog));
|
||||
if (!string.IsNullOrEmpty(hdConstructionLogId.Text))
|
||||
{
|
||||
log.ConstructionLogId = hdConstructionLogId.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.ConstructionLogId = SQLHelper.GetNewID(typeof(Model.ZHGL_ConstructionLog));
|
||||
}
|
||||
this.ConstructionLogId = log.ConstructionLogId;
|
||||
BLL.ConstructionLogService.AddConstructionLog(log);
|
||||
}
|
||||
@@ -893,10 +902,26 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
ChangeText();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void ChangeText()
|
||||
{
|
||||
var workEfficiencys = from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiency
|
||||
where x.ConstructionLogId == this.hdConstructionLogId.Text
|
||||
select x;
|
||||
if (workEfficiencys.Count() > 0)
|
||||
{
|
||||
this.btnWorkEfficiency.Text = "已填报";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnWorkEfficiency.Text = "未填报";
|
||||
}
|
||||
}
|
||||
|
||||
#region 右键删除焊口
|
||||
/// <summary>
|
||||
/// 右键删除焊口
|
||||
@@ -911,6 +936,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
var log = BLL.ConstructionLogService.GetConstructionLogById(ConstructionLogId);
|
||||
if (log != null)
|
||||
{
|
||||
BLL.ConstructionLogWorkEfficiencyService.DeleteConstructionLogWorkEfficiencysByConstructionLogId(ConstructionLogId);
|
||||
BLL.ConstructionLogPersonService.DeleteConstructionLogPersonsByConstructionLogId(ConstructionLogId);
|
||||
BLL.ConstructionLogMachineService.DeleteConstructionLogMachinesByConstructionLogId(ConstructionLogId);
|
||||
BLL.ConstructionLogManagementService.DeleteConstructionLogManagementsByConstructionLogId(ConstructionLogId);
|
||||
@@ -923,7 +949,7 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择要删除的试压记录!", MessageBoxIcon.Warning);
|
||||
Alert.ShowInTop("请选择要删除的记录!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1216,5 +1242,45 @@ namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
TextNew();
|
||||
}
|
||||
|
||||
protected void btnWorkEfficiency_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(hdConstructionLogId.Text)) //新增记录
|
||||
{
|
||||
hdConstructionLogId.Text = SQLHelper.GetNewID();
|
||||
}
|
||||
string contractNo = string.Empty;
|
||||
foreach (var item in this.drpContractNo.SelectedValueArray)
|
||||
{
|
||||
if (item != BLL.Const._Null)
|
||||
{
|
||||
contractNo += item + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(contractNo))
|
||||
{
|
||||
contractNo = contractNo.Substring(0, contractNo.Length - 1);
|
||||
}
|
||||
string professional = string.Empty;
|
||||
foreach (var item in this.drpProfessional.SelectedValueArray)
|
||||
{
|
||||
if (item != BLL.Const._Null)
|
||||
{
|
||||
professional += item + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(professional))
|
||||
{
|
||||
professional = professional.Substring(0, professional.Length - 1);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(contractNo) && !string.IsNullOrEmpty(professional))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConstructionLogWorkEfficiency.aspx?ConstructionLogId={0}&contractNo={1}&professional={2}&WorkPostId={3}&MachineId={4}", this.hdConstructionLogId.Text, contractNo, professional, hdWorkPostId.Text, hdMachineId.Text, "导入 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请选择合同编号和专业工程!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
-2
@@ -111,6 +111,15 @@ namespace FineUIPro.Web.PZHGL.InformationProject {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdMachineId;
|
||||
|
||||
/// <summary>
|
||||
/// hdConstructionLogId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdConstructionLogId;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
@@ -238,13 +247,13 @@ namespace FineUIPro.Web.PZHGL.InformationProject {
|
||||
protected global::FineUIPro.DropDownList drpProfessional;
|
||||
|
||||
/// <summary>
|
||||
/// txtState 控件。
|
||||
/// btnWorkEfficiency 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtState;
|
||||
protected global::FineUIPro.Button btnWorkEfficiency;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConstructionLogWorkEfficiency.aspx.cs" Inherits="FineUIPro.Web.PZHGL.InformationProject.ConstructionLogWorkEfficiency" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>工效录入</title>
|
||||
<style type="text/css">
|
||||
.f-grid-row.noEdit {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</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" ShowHeader="false" Title="工效情况" BoxFlex="1" AllowColumnLocking="true"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="Id,ProjectName,ShowId" EnableTree="true" EnableColumnLines="true" ClicksToEdit="1" AllowCellEditing="true"
|
||||
DataIDField="Id">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="hdId" Hidden="true"></f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="60px" ColumnID="Code" DataField="Code" FieldType="String" EnableLock="true" Locked="true"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectCode" DataField="ProjectCode" SortField="ProjectCode" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="项目编码" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectName" DataField="ProjectName" SortField="ProjectName" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="项目名称" TextAlign="Left" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="UnitOfMeasurement" DataField="UnitOfMeasurement" SortField="UnitOfMeasurement" EnableLock="true" Locked="true"
|
||||
FieldType="String" HeaderText="单位" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PhysicalCompletionQuantity" DataField="PhysicalCompletionQuantity" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="实物完成量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbPhysicalCompletionQuantity" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="MaterialConsumption" DataField="MaterialConsumption" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="材料消耗量(净量+损耗量)" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbMaterialConsumption" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var hdIdClientID = '<%= hdId.ClientID %>';
|
||||
|
||||
function onGridAfterEdit(event, value, params) {
|
||||
var me = this, columnId = params.columnId, rowId = params.rowId;
|
||||
if (columnId.indexOf('ConsumeHours') != -1) {
|
||||
var physicalCompletionQuantity = me.getCellValue(rowId, 'PhysicalCompletionQuantity');
|
||||
var hours = me.getCellValue(rowId, columnId);
|
||||
var workEfficiencyId = columnId.replace('ConsumeHours', 'WorkEfficiency');
|
||||
if (physicalCompletionQuantity.toString() != "" && hours.toString() != "") {
|
||||
me.updateCellValue(rowId, workEfficiencyId, (physicalCompletionQuantity / hours).toFixed(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,230 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.PZHGL.InformationProject
|
||||
{
|
||||
public partial class ConstructionLogWorkEfficiency : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 列数量
|
||||
/// </summary>
|
||||
public int ColumnNum
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)ViewState["ColumnNum"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ColumnNum"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 加载表头
|
||||
/// </summary>
|
||||
protected void Page_Init(object sender, EventArgs e)
|
||||
{
|
||||
InitGrid();
|
||||
}
|
||||
|
||||
#region 表头
|
||||
/// <summary>
|
||||
/// 表头
|
||||
/// </summary>
|
||||
private void InitGrid()
|
||||
{
|
||||
ColumnNum = 0;
|
||||
List<string> workPostIds = Funs.GetStrListByStr(Request.Params["WorkPostId"], ',');
|
||||
List<string> machineIds = Funs.GetStrListByStr(Request.Params["MachineId"], ',');
|
||||
GroupField gf1 = new GroupField();
|
||||
gf1.ColumnID = "Person";
|
||||
gf1.HeaderText = "人工消耗(工·h)";
|
||||
gf1.HeaderTextAlign = TextAlign.Center;
|
||||
for (int i = 0; i < workPostIds.Count; i++)
|
||||
{
|
||||
GroupField gf = new GroupField();
|
||||
gf.ColumnID = "Person" + i.ToString();
|
||||
gf.HeaderText = BLL.WorkPostService.getWorkPostNameById(workPostIds[i]);
|
||||
gf.HeaderTextAlign = TextAlign.Center;
|
||||
RenderField rd1 = new RenderField();
|
||||
rd1.ColumnID = "PersonConsumeHours" + i.ToString();
|
||||
rd1.Width = Unit.Pixel(100);
|
||||
rd1.DataField = "PersonConsumeHours" + i.ToString();
|
||||
rd1.FieldType = FieldType.Double;
|
||||
rd1.HeaderText = "消耗工时";
|
||||
rd1.HeaderTextAlign = TextAlign.Center;
|
||||
NumberBox numPlan = new NumberBox();
|
||||
numPlan.NoNegative = true;
|
||||
numPlan.NoDecimal = false;
|
||||
rd1.Editor.Add(numPlan);
|
||||
gf.Columns.Add(rd1);
|
||||
RenderField rd2 = new RenderField();
|
||||
rd2.ColumnID = "PersonWorkEfficiency" + i.ToString();
|
||||
rd2.Width = Unit.Pixel(100);
|
||||
rd2.DataField = "PersonWorkEfficiency" + i.ToString();
|
||||
rd2.FieldType = FieldType.Double;
|
||||
rd2.HeaderText = "工效";
|
||||
rd2.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd2);
|
||||
gf1.Columns.Add(gf);
|
||||
}
|
||||
Grid1.Columns.Add(gf1);
|
||||
GroupField gf2 = new GroupField();
|
||||
gf2.ColumnID = "Machine";
|
||||
gf2.HeaderText = "机械消耗(台·h)";
|
||||
gf2.HeaderTextAlign = TextAlign.Center;
|
||||
for (int i = 0; i < machineIds.Count; i++)
|
||||
{
|
||||
GroupField gf = new GroupField();
|
||||
gf.ColumnID = "Machine" + i.ToString();
|
||||
gf.HeaderText = BLL.SpecialEquipmentService.GetSpecialEquipmentNameById(machineIds[i]);
|
||||
gf.HeaderTextAlign = TextAlign.Center;
|
||||
RenderField rd1 = new RenderField();
|
||||
rd1.ColumnID = "MachineConsumeHours" + i.ToString();
|
||||
rd1.Width = Unit.Pixel(100);
|
||||
rd1.DataField = "MachineConsumeHours" + i.ToString();
|
||||
rd1.FieldType = FieldType.Double;
|
||||
rd1.HeaderText = "消耗台时";
|
||||
rd1.HeaderTextAlign = TextAlign.Center;
|
||||
NumberBox numPlan = new NumberBox();
|
||||
numPlan.NoNegative = true;
|
||||
numPlan.NoDecimal = false;
|
||||
rd1.Editor.Add(numPlan);
|
||||
gf.Columns.Add(rd1);
|
||||
RenderField rd2 = new RenderField();
|
||||
rd2.ColumnID = "MachineWorkEfficiency" + i.ToString();
|
||||
rd2.Width = Unit.Pixel(100);
|
||||
rd2.DataField = "MachineWorkEfficiency" + i.ToString();
|
||||
rd2.FieldType = FieldType.Double;
|
||||
rd2.HeaderText = "工效";
|
||||
rd2.HeaderTextAlign = TextAlign.Center;
|
||||
gf.Columns.Add(rd2);
|
||||
gf2.Columns.Add(gf);
|
||||
}
|
||||
Grid1.Columns.Add(gf2);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
string contractNo = Request.Params["contractNo"];
|
||||
string professional = Request.Params["professional"];
|
||||
string constructionLogId = Request.Params["ConstructionLogId"];
|
||||
List<string> contractNoList = Funs.GetStrListByStr(contractNo, ',');
|
||||
List<string> professionalList = Funs.GetStrListByStr(professional, ',');
|
||||
List<string> workPostIds = Funs.GetStrListByStr(Request.Params["WorkPostId"], ',');
|
||||
List<string> machineIds = Funs.GetStrListByStr(Request.Params["MachineId"], ',');
|
||||
DataTable table = BLL.PhtglContractTrackService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, constructionLogId);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString()))
|
||||
{
|
||||
foreach (GridColumn column in Grid1.Columns)
|
||||
{
|
||||
if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2)
|
||||
{
|
||||
if (column.ColumnIndex > 5)
|
||||
{
|
||||
GroupField gf1 = column as GroupField;
|
||||
foreach (var column1 in gf1.Columns)
|
||||
{
|
||||
GroupField gf2 = column1 as GroupField;
|
||||
foreach (var column2 in gf2.Columns)
|
||||
{
|
||||
this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
string constructionLogId = Request.Params["ConstructionLogId"];
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var oldViewInfos = from x in db.ZHGL_ConstructionLogWorkEfficiency
|
||||
where x.ConstructionLogId == constructionLogId
|
||||
select x;
|
||||
BLL.ConstructionLogWorkEfficiencyService.DeleteConstructionLogWorkEfficiencysByConstructionLogId(constructionLogId);
|
||||
List<string> workPostIds = Funs.GetStrListByStr(Request.Params["WorkPostId"], ',');
|
||||
List<string> machineIds = Funs.GetStrListByStr(Request.Params["MachineId"], ',');
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
int a = mergedRow.Value<int>("index");
|
||||
if (this.Grid1.Rows[a].DataKeys[2] != null)
|
||||
{
|
||||
string physicalCompletionQuantity = values.Value<string>("PhysicalCompletionQuantity");
|
||||
string materialConsumption = values.Value<string>("MaterialConsumption");
|
||||
for (int i = 0; i < workPostIds.Count; i++)
|
||||
{
|
||||
Model.ZHGL_ConstructionLogWorkEfficiency workEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiency();
|
||||
workEfficiency.ConstructionLogWorkEfficiencyId = SQLHelper.GetNewID();
|
||||
workEfficiency.ConstructionLogId = constructionLogId;
|
||||
workEfficiency.ContractTrackId = this.Grid1.Rows[a].DataKeys[2].ToString();
|
||||
workEfficiency.PhysicalCompletionQuantity = Funs.GetNewDecimal(physicalCompletionQuantity);
|
||||
workEfficiency.MaterialConsumption = Funs.GetNewDecimal(materialConsumption);
|
||||
workEfficiency.Type = "Person";
|
||||
workEfficiency.TypeId = workPostIds[i];
|
||||
workEfficiency.ConsumeHours = Funs.GetNewDecimal(values.Value<string>("PersonConsumeHours" + i.ToString()));
|
||||
BLL.ConstructionLogWorkEfficiencyService.AddConstructionLogWorkEfficiency(workEfficiency);
|
||||
}
|
||||
for (int i = 0; i < machineIds.Count; i++)
|
||||
{
|
||||
Model.ZHGL_ConstructionLogWorkEfficiency workEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiency();
|
||||
workEfficiency.ConstructionLogWorkEfficiencyId = SQLHelper.GetNewID();
|
||||
workEfficiency.ConstructionLogId = constructionLogId;
|
||||
workEfficiency.ContractTrackId = this.Grid1.Rows[a].DataKeys[2].ToString();
|
||||
workEfficiency.PhysicalCompletionQuantity = Funs.GetNewDecimal(physicalCompletionQuantity);
|
||||
workEfficiency.MaterialConsumption = Funs.GetNewDecimal(materialConsumption);
|
||||
workEfficiency.Type = "Machine";
|
||||
workEfficiency.TypeId = machineIds[i];
|
||||
workEfficiency.ConsumeHours = Funs.GetNewDecimal(values.Value<string>("MachineConsumeHours" + i.ToString()));
|
||||
BLL.ConstructionLogWorkEfficiencyService.AddConstructionLogWorkEfficiency(workEfficiency);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Generated
+96
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.PZHGL.InformationProject {
|
||||
|
||||
|
||||
public partial class ConstructionLogWorkEfficiency {
|
||||
|
||||
/// <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>
|
||||
/// hdId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox hdId;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// nbPhysicalCompletionQuantity 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbPhysicalCompletionQuantity;
|
||||
|
||||
/// <summary>
|
||||
/// nbMaterialConsumption 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbMaterialConsumption;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user