20260317 交工资料

This commit is contained in:
毕文静 2026-03-17 16:35:36 +08:00
parent 93be33cb2f
commit 929cba4d17
7 changed files with 384 additions and 254 deletions

View File

@ -88,5 +88,16 @@ namespace BLL
db.SubmitChanges();
}
}
public static void DeleteListByProjectId(string projectId)
{
SGGLDB db = Funs.DB;
var q = (from x in db.JGZL_MaterialQualityCertificateDoc where x.ProjectId == projectId select x).ToList();
if (q.Count>0)
{
db.JGZL_MaterialQualityCertificateDoc.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/26/2026 15:12:38" ReportInfo.Modified="02/24/2026 15:01:12" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/26/2026 15:12:38" ReportInfo.Modified="03/17/2026 14:54:57" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@ -63,7 +63,7 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QF6lFUWtpabAHntLrf3vsy+g==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFmsU4j1CDjBlyO5m7ygS6qQ==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="Num" DataType="System.String" PropName="attach_image_id"/>
<Column Name="MaterialName" DataType="System.String" PropName="image_series"/>

View File

@ -40,6 +40,7 @@
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAdd" runat="server" Icon="Add" Text="增加" OnClick="btnAdd_Click"></f:Button>
<f:Button ID="btnSave" Text="保存" ToolTip="保存" Icon="SystemSave" runat="server" OnClick="btnSave_Click"></f:Button>
<f:Button ID="btnPrint" Text="材料质量证明文件一览表打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
</Items>
@ -49,52 +50,84 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料质量证明文件一览表" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="MaterialId" AllowCellEditing="true"
EnableColumnLines="true" ClicksToEdit="1" DataIDField="MaterialId" AllowSorting="true"
SortField="MaterialCode" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
SortField="CompileDate" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
EnableTextSelection="True" AutoScroll="true" OnPreDataBound="Grid1_PreDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField HeaderText="材料名称" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px">
<Editor>
<f:TextBox ID="txtMaterialName" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="证件自编号" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtMaterialCode" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="证件出厂编号" ColumnID="SerialCode" DataField="SerialCode" SortField="SerialCode"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="140px">
<Editor>
<f:TextBox ID="txtSerialCode" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="材质" ColumnID="Material" DataField="Material" SortField="Material"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="160px">
<Editor>
<f:TextBox ID="txtMaterial" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="规格型号" ColumnID="Specification" DataField="Specification" SortField="Specification"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="140px">
<Editor>
<f:TextBox ID="txtSpecification" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="制造厂家" ColumnID="Manufacturer" DataField="Manufacturer" SortField="Manufacturer"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="160px">
<Editor>
<f:TextBox ID="txtManufacturer" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="单位" ColumnID="Unit" DataField="Unit" SortField="Unit"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
<Editor>
<f:TextBox ID="txtUnit" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="总量" ColumnID="TotalNum" DataField="TotalNum" SortField="TotalNum"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtTotalNum" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="复验报告编号" ColumnID="ReInspectionReportCode" DataField="ReInspectionReportCode" SortField="ReInspectionReportCode"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="130px">
<Editor>
<f:TextBox ID="txtReInspectionReportCode" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="领用单位" ColumnID="ReceivingUnit" DataField="ReceivingUnit" SortField="ReceivingUnit"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="160px">
<Editor>
<f:TextBox ID="txtReceivingUnit" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="领用量" ColumnID="DrawNum" DataField="DrawNum" SortField="DrawNum"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtDrawNum" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="备注" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px">
<f:LinkButtonField ColumnID="Delete3" Width="50px" EnablePostBack="false" Icon="Delete"
HeaderTextAlign="Center" HeaderText="删除" />
<f:RenderField HeaderText="主键" ColumnID="MaterialId" DataField="MaterialId" SortField="MaterialId"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="140px" Hidden="true">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
@ -113,30 +146,10 @@
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="材料质量证明文件一览表" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="top" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="900px" Height="600px">
</f:Window>
<f:Window ID="WindowPrint" Title="打印材料质量证明文件一览表" Hidden="true" EnableIFrame="true" EnableMaximize="false"
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="600px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除" Icon="Delete">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
</script>
</body>
</html>

View File

@ -1,18 +1,52 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace FineUIPro.Web.JGZL
{
public partial class MaterialQualityCertificateDoc : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string MaterialId
{
get
{
return (string)ViewState["MaterialId"];
}
set
{
ViewState["MaterialId"] = value;
}
}
/// <summary>
/// 项目Id
/// </summary>
private string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -35,6 +69,7 @@ namespace FineUIPro.Web.JGZL
this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId;
this.InitTreeMenu();//加载树
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -83,6 +118,7 @@ namespace FineUIPro.Web.JGZL
{
if (this.tvControlItem.SelectedNodeID != "0")
{
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -94,19 +130,9 @@ namespace FineUIPro.Web.JGZL
/// </summary>
private void BindGrid()
{
//string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1");
string strSql = @"SELECT * from JGZL_MaterialQualityCertificateDoc where 1=1";
string strSql = @"SELECT * from JGZL_MaterialQualityCertificateDoc where ProjectId = @ProjectId order by CompileDate asc";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
strSql += " AND ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID));
}
//else
//{
// strSql += " AND CHARINDEX(ProjectId,@ProjectId)>0 ";
// listStr.Add(new SqlParameter("@ProjectId", projectIds));
//}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
@ -165,7 +191,9 @@ namespace FineUIPro.Web.JGZL
///<param name="e"></param>
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
{
this.ProjectId = this.drpProjectId.SelectedValue;
this.InitTreeMenu();
this.tvControlItem.SelectedNodeID = this.ProjectId;
this.BindGrid();
}
@ -196,7 +224,7 @@ namespace FineUIPro.Web.JGZL
string rootPath = Server.MapPath("~/");
BLL.Common.FastReportService.ResetData();
string strSql = @"SELECT * from JGZL_MaterialQualityCertificateDoc where ProjectId = @ProjectId order by MaterialCode desc";
string strSql = @"SELECT * from JGZL_MaterialQualityCertificateDoc where ProjectId = @ProjectId order by CompileDate asc";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", projectId));
SqlParameter[] parameter = listStr.ToArray();
@ -267,7 +295,36 @@ namespace FineUIPro.Web.JGZL
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialQualityCertificateDocEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - ")));
JArray teamGroupData = Grid1.GetMergedData();
List<JObject> list = new List<JObject>();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
list.Add(values);
}
JObject defaultObj = new JObject
{
{ "MaterialId", Guid.NewGuid() },
{ "MaterialName", ""},
{ "MaterialCode", "" },
{ "SerialCode", "" },
{ "Material", "" },
{ "Specification", "" },
{ "Manufacturer", "" },
{ "Unit", "" },
{ "TotalNum", "" },
{ "ReInspectionReportCode", "" },
{ "ReceivingUnit", "" },
{ "DrawNum", "" },
{
"Delete3",
String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",
GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete))
}
};
list.Add(defaultObj);
Grid1.DataSource = list;
Grid1.DataBind();
}
else
{
@ -276,139 +333,83 @@ namespace FineUIPro.Web.JGZL
}
}
/// <summary>
/// 双击编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
protected void Grid1_PreDataBound(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_MaterialQualityCertificateDocMenuId, BLL.Const.BtnModify))
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialQualityCertificateDocEdit.aspx?materialId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
}
else
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
// 设置LinkButtonField的点击客户端事件
LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField;
deleteField.OnClientClick = GetDeleteScriptGrid1();
}
/// <summary>
/// 右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_MaterialQualityCertificateDocMenuId, BLL.Const.BtnModify))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialQualityCertificateDocEdit.aspx?materialId={0}", Grid1.SelectedRowID, "维护 - ")));
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_MaterialQualityCertificateDocMenuId, Const.BtnDelete))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
bool isShow = true;
if (Grid1.SelectedRowIndexArray.Length > 1)
{
isShow = false;
}
bool isDelete = false;
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
if (judgementDelete(rowID, isShow))
{
isDelete = true;
BLL.MaterialQualityCertificateDocService.DeleteMaterialQualityCertificateDocById(rowID);
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除材料质量证明文件一览表");
}
}
if (isDelete)
{
ShowNotify("删除成功!", MessageBoxIcon.Success);
}
this.BindGrid();
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
#region
/// <summary>
/// 判断是否可以删除
/// 删除提示
/// </summary>
/// <returns></returns>
private bool judgementDelete(string id, bool isShow)
private string GetDeleteScriptGrid1()
{
string content = string.Empty;
if (string.IsNullOrEmpty(content))
{
return true;
}
else
{
if (isShow)
{
Alert.ShowInTop(content, MessageBoxIcon.Error);
}
return false;
}
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question,
Grid1.GetDeleteSelectedRowsReference(), String.Empty);
}
#endregion
#endregion
#region
#region
/// <summary>
/// 关闭弹出窗口
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
protected void btnSave_Click(object sender, EventArgs e)
{
this.InitTreeMenu();//加载树
this.BindGrid();
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId,
Const.JGZL_MaterialQualityCertificateDocMenuId, Const.BtnSave))
{
BLL.MaterialQualityCertificateDocService.DeleteListByProjectId(this.ProjectId);
List<Model.JGZL_MaterialQualityCertificateDoc> lists = new List<JGZL_MaterialQualityCertificateDoc>();
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
int rowIndex = teamGroupRow.Value<int>("index");
Model.JGZL_MaterialQualityCertificateDoc newDetail = new Model.JGZL_MaterialQualityCertificateDoc
{
MaterialId = values.Value<string>("MaterialId"),
ProjectId = this.ProjectId,
MaterialName = values.Value<string>("MaterialName"),
MaterialCode = values.Value<string>("MaterialCode"),
SerialCode = values.Value<string>("SerialCode"),
Material = values.Value<string>("Material"),
Specification = values.Value<string>("Specification"),
Manufacturer = values.Value<string>("Manufacturer"),
Unit = values.Value<string>("Unit"),
TotalNum = Funs.GetNewInt(values.Value<string>("TotalNum")),
ReInspectionReportCode = values.Value<string>("ReInspectionReportCode"),
ReceivingUnit = values.Value<string>("ReceivingUnit"),
DrawNum = Funs.GetNewInt(values.Value<string>("DrawNum")),
CompileMan = this.CurrUser.UserId,
CompileDate = DateTime.Now,
Reviewer = this.CurrUser.UserId,
RevieweDate = DateTime.Now
};
lists.Add(newDetail);
}
try
{
if (lists.Count > 0)
{
Funs.DB.JGZL_MaterialQualityCertificateDoc.InsertAllOnSubmit(lists);
ShowNotify("保存成功!", MessageBoxIcon.Success);
}
Funs.DB.SubmitChanges();
}
catch (Exception)
{
return;
}
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}

View File

@ -113,6 +113,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnAdd;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnPrint 控件。
/// </summary>
@ -131,6 +140,105 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtMaterialName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMaterialName;
/// <summary>
/// txtMaterialCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMaterialCode;
/// <summary>
/// txtSerialCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSerialCode;
/// <summary>
/// txtMaterial 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMaterial;
/// <summary>
/// txtSpecification 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSpecification;
/// <summary>
/// txtManufacturer 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtManufacturer;
/// <summary>
/// txtUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUnit;
/// <summary>
/// txtTotalNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTotalNum;
/// <summary>
/// txtReInspectionReportCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtReInspectionReportCode;
/// <summary>
/// txtReceivingUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtReceivingUnit;
/// <summary>
/// txtDrawNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDrawNum;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -158,15 +266,6 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// WindowPrint 控件。
/// </summary>
@ -175,32 +274,5 @@ namespace FineUIPro.Web.JGZL
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowPrint;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}

View File

@ -50,7 +50,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="管件宏观检查记录表" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="RecordId" AllowCellEditing="true"
EnableColumnLines="true" ClicksToEdit="1" DataIDField="RecordId" AllowSorting="true"
SortField="ContractNo" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
SortField="CompileDate" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" AutoScroll="true" OnPreDataBound="Grid1_PreDataBound">
<Columns>
@ -180,12 +180,12 @@
Height="600px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnCopy" OnClick="btnCopy_Click" EnablePostBack="true"
runat="server" Text="复制" Icon="PageWhitePaste">
<f:MenuButton ID="btnCopy" EnablePostBack="true" OnClick="btnCopy_Click" runat="server" Text="复制" Icon="PageWhitePaste">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var selectedRowData = null;
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
@ -193,5 +193,6 @@
return false;
}
</script>
</body>
</html>

View File

@ -1,15 +1,12 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.UserModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.JGZL
@ -46,6 +43,11 @@ namespace FineUIPro.Web.JGZL
ViewState["ProjectId"] = value;
}
}
/// <summary>
/// 定义集合
/// </summary>
private static List<Model.JGZL_PipeFittingInspectionRecord> list = new List<JGZL_PipeFittingInspectionRecord>();
#endregion
#region
@ -130,7 +132,7 @@ namespace FineUIPro.Web.JGZL
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT * from JGZL_PipeFittingInspectionRecord where ProjectId=@projectId";
string strSql = @"SELECT * from JGZL_PipeFittingInspectionRecord where ProjectId=@projectId order by CompileDate ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.ProjectId));
SqlParameter[] parameter = listStr.ToArray();
@ -301,7 +303,6 @@ namespace FineUIPro.Web.JGZL
JObject values = teamGroupRow.Value<JObject>("values");
list.Add(values);
}
JObject defaultObj = new JObject
{
{ "RecordId", Guid.NewGuid() },
@ -399,6 +400,8 @@ namespace FineUIPro.Web.JGZL
{
Funs.DB.JGZL_PipeFittingInspectionRecord.InsertAllOnSubmit(lists);
ShowNotify("保存成功!", MessageBoxIcon.Success);
this.Grid1.DataSource = lists;
this.Grid1.DataBind();
}
Funs.DB.SubmitChanges();
}
@ -415,6 +418,12 @@ namespace FineUIPro.Web.JGZL
}
#endregion
#region
/// <summary>
/// 复制
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCopy_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
@ -426,24 +435,49 @@ namespace FineUIPro.Web.JGZL
JObject values = teamGroupRow.Value<JObject>("values");
list.Add(values);
}
// 1. 获取选中行索引并校验
int index = Grid1.SelectedRowIndex;
if (index < 0 || index >= Grid1.Rows.Count)
{
Alert.ShowInTop("请选中要复制的数据行!", MessageBoxIcon.Warning);
return;
}
string name = Grid1.Rows[index].Values[1].ToString() ?? "";
string contractNo = Grid1.Rows[index].Values[2].ToString() ?? "";
string arrivalUnit = Grid1.Rows[index].Values[4].ToString() ?? "";
string arrivalNum = Grid1.Rows[index].Values[5].ToString() ?? "";
string materialCertificateNumber = Grid1.Rows[index].Values[6].ToString() ?? "";
string material = Grid1.Rows[index].Values[7].ToString() ?? "";
string specifications = Grid1.Rows[index].Values[8].ToString() ?? "";
string inspectionNum = Grid1.Rows[index].Values[9].ToString() ?? "";
string oDVariation = Grid1.Rows[index].Values[11].ToString() ?? "";
string iDVariation = Grid1.Rows[index].Values[12].ToString() ?? "";
string wallVariation = Grid1.Rows[index].Values[13].ToString() ?? "";
string otherVariation = Grid1.Rows[index].Values[14].ToString() ?? "";
string appearanceQuality = Grid1.Rows[index].Values[15].ToString() ?? "";
string result = Grid1.Rows[index].Values[16].ToString() ?? "";
if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(contractNo) && string.IsNullOrEmpty(arrivalUnit) && string.IsNullOrEmpty(arrivalNum) && string.IsNullOrEmpty(materialCertificateNumber) && string.IsNullOrEmpty(material) && string.IsNullOrEmpty(specifications) && string.IsNullOrEmpty(inspectionNum) && string.IsNullOrEmpty(oDVariation) && string.IsNullOrEmpty(iDVariation) && string.IsNullOrEmpty(wallVariation) && string.IsNullOrEmpty(otherVariation) && string.IsNullOrEmpty(appearanceQuality) && string.IsNullOrEmpty(result))
{
Alert.ShowInTop("请先保存数据!", MessageBoxIcon.Warning);
return;
}
JObject defaultObj = new JObject
{
{ "RecordId", Guid.NewGuid() },
{ "Name", Grid1.Rows[index].Values[1].ToString()},
{ "ContractNo", Grid1.Rows[index].Values[2].ToString()},
{ "ArrivalUnit", Grid1.Rows[index].Values[4].ToString() },
{ "ArrivalNum", Grid1.Rows[index].Values[5].ToString() },
{ "MaterialCertificateNumber", Grid1.Rows[index].Values[6].ToString() },
{ "Material", Grid1.Rows[index].Values[7].ToString() },
{ "Specifications", Grid1.Rows[index].Values[8].ToString() },
{ "InspectionNum", Grid1.Rows[index].Values[9].ToString()},
{ "ODVariation", Grid1.Rows[index].Values[11].ToString() },
{ "IDVariation", Grid1.Rows[index].Values[12].ToString() },
{ "WallVariation", Grid1.Rows[index].Values[13].ToString() },
{ "OtherVariation", Grid1.Rows[index].Values[14].ToString() },
{ "AppearanceQuality", Grid1.Rows[index].Values[15].ToString() },
{ "Result", Grid1.Rows[index].Values[16].ToString()},
{ "Name",name},
{ "ContractNo",contractNo},
{ "ArrivalUnit",arrivalUnit },
{ "ArrivalNum",arrivalNum },
{ "MaterialCertificateNumber", materialCertificateNumber},
{ "Material",material },
{ "Specifications", specifications },
{ "InspectionNum",inspectionNum },
{ "ODVariation",oDVariation},
{ "IDVariation",iDVariation },
{ "WallVariation",wallVariation },
{ "OtherVariation", otherVariation},
{ "AppearanceQuality", appearanceQuality },
{ "Result",result },
{
"Delete3",
String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",
@ -460,8 +494,6 @@ namespace FineUIPro.Web.JGZL
return;
}
}
#endregion
}
}