焊接修改

This commit is contained in:
2025-09-24 17:31:28 +08:00
parent cb92dcb730
commit 0f70405339
64 changed files with 2492 additions and 2040 deletions
@@ -29,7 +29,7 @@
</f:ToolbarFill>
<f:Button ID="btnNew" Text="新建包装" Icon="Add" runat="server" OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnOutPrint" runat="server" Icon="Printer" EnableAjax="false" Text="生成出库单" ToolTip="打印" OnClick="btnOutPrint_Click"></f:Button>
<f:Button ID="btnOutPrint" runat="server" Icon="Printer" EnableAjax="false" Text="生成装箱单" ToolTip="打印" OnClick="btnOutPrint_Click"></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -33,7 +33,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </summary>
private void BindGrid()
{
var list = BLL.HJGL_PackagingmanageService.GetPackagingManageList(this.CurrUser.LoginProjectId, this.txtPackagingCode.Text.Trim(), this.Grid1.PageIndex, this.Grid1.PageSize);
var list = BLL.HJGLPackagingmanageService.GetPackagingManageList(this.CurrUser.LoginProjectId, this.txtPackagingCode.Text.Trim(), this.Grid1.PageIndex, this.Grid1.PageSize);
Grid1.RecordCount = list.Total;
Grid1.DataSource = list.Data;
Grid1.DataBind();
@@ -110,20 +110,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
BindGrid();
}
#endregion
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "cmd_detail")
{
string id = Grid1.SelectedRowID;
string url = "PackagingManageView.aspx?PackagingManageId={0}";
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format(url, id, "操作 - ")));
}
else if (e.CommandName == "cmd_print")
{
string Id = this.Grid1.SelectedRowID;
Pring(Id);
}
}
#region
/// <summary>
/// 增加按钮
@@ -184,7 +171,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
string id = Grid1.SelectedRowID;
string url = string.Empty;
var wpq = BLL.HJGL_PackagingmanageService.GetHJGL_PackagingManageById(id);
var wpq = BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(id);
if (wpq != null)
{
url = "PackagingManageEdit.aspx?PackagingManageId={0}";
@@ -192,6 +179,22 @@ namespace FineUIPro.Web.HJGL.PreDesign
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(url, id, "操作 - ")));
}
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "cmd_detail")
{
string id = Grid1.SelectedRowID;
string url = "PackagingManageView.aspx?PackagingManageId={0}";
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format(url, id, "操作 - ")));
}
else if (e.CommandName == "cmd_print")
{
string Id = this.Grid1.SelectedRowID;
Pring(Id);
}
}
#endregion
#region
@@ -224,7 +227,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
if (this.judgementDelete(rowID, isShow))
{
BLL.HJGL_PackagingmanageService.DeleteHJGL_PackagingManageById(rowID);
BLL.HJGLPackagingmanageService.DeleteHJGL_PackagingManageById(rowID);
//BLL.Sys_LogService.AddLog(BLL.Const.System_2, this.CurrUser.LoginProjectId, this.CurrUser.PersonId, "删除焊接工艺评定台账");
}
}
@@ -262,6 +265,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
}
#endregion
#region
/// <summary>
/// 打印
@@ -278,7 +282,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
{
string Id = this.Grid1.SelectedRowID;
var model = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(Id);
var model = HJGLPackagingmanageService.GetHJGL_PackagingManageById(Id);
if (model != null)
{
if (!string.IsNullOrEmpty(model.PipelineComponentId))
@@ -289,7 +293,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
HJGL_PipelineComponentService.UpdateOutState(item, model.PackagingCode);
}
}
HJGL_PackagingmanageService.PutOutOrder(Id);
HJGLPackagingmanageService.PutOutOrder(Id);
Pring(Id);
}
}
@@ -308,10 +312,10 @@ namespace FineUIPro.Web.HJGL.PreDesign
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
DataTable tb = LINQToDataTable(BLL.HJGL_PackagingmanageService.GetPackagingDetailById(Id));
DataTable tb = LINQToDataTable(BLL.HJGLPackagingmanageService.GetPackagingDetailById(Id));
if (tb.Rows.Count > 0)
{
var model = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(Id);
var model = HJGLPackagingmanageService.GetHJGL_PackagingManageById(Id);
var dtTable = tb.AsEnumerable().OrderBy(o => o["PlanStartDate"]).CopyToDataTable();
string PlanStartDate = "";
@@ -347,6 +351,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
}
#endregion
#region
/// 导出按钮
/// </summary>
@@ -412,7 +417,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (state != null)
{
string txt = HJGL_PackagingmanageService.GetState().FirstOrDefault(x => x.Value == state.ToString()).Text;
string txt = HJGLPackagingmanageService.GetState().FirstOrDefault(x => x.Value == state.ToString()).Text;
return txt;
}
@@ -93,15 +93,15 @@
<f:Button ID="btnSelect" Icon="ShapeSquareSelect" Text="选择" runat="server" ToolTip="选择"
OnClick="btnSelect_Click">
</f:Button>
<f:Button ID="btnSelectStock" Icon="ShapeSquareSelect" Text="选择" runat="server" ToolTip="选择"
<%--<f:Button ID="btnSelectStock" Icon="ShapeSquareSelect" Text="选择" runat="server" ToolTip="选择"
OnClick="btnSelectStock_Click">
</f:Button>
</f:Button>--%>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="150px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="150px" ColumnID="CusBillCode" DataField="CusBillCode" SortField="CusBillCode"
FieldType="String" HeaderText="出库单" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
@@ -32,21 +32,21 @@ namespace FineUIPro.Web.HJGL.PreDesign
drpTypeInt.DataTextField = "Key";
drpTypeInt.DataValueField = "Value";
drpTypeInt.DataSource = HJGL_PackagingmanageService.TypeIntMap;
drpTypeInt.DataSource = HJGLPackagingmanageService.TypeIntMap;
drpTypeInt.DataBind();
btnClose.OnClientClick = ActiveWindow.GetHideReference();
if (!string.IsNullOrEmpty(PackagingManageId))
{
var model = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
var model = HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
drpTypeInt.Enabled = false;
txtPackagingCode.Text = model.PackagingCode;
dropPipelineComponentCode.Values = model.PipelineComponentId?.Split(',');
txtStackingPosition.Text = model.StackingPosition;
drpTrainNumber.SelectedValue = model.TrainNumberId;
drpTypeInt.SelectedValue = model.TypeInt.ToString();
if (model.State== HJGL_PackagingmanageService.state_0)
if (model.State== HJGLPackagingmanageService.state_0)
{
btnSave.Hidden = false;
}
@@ -55,7 +55,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
drpTypeInt.Enabled = true;
btnSave.Hidden = false;
txtPackagingCode.Text = HJGL_PackagingmanageService.GetNewPackagingCode(this.CurrUser.LoginProjectId);
txtPackagingCode.Text = HJGLPackagingmanageService.GetNewPackagingCode(this.CurrUser.LoginProjectId);
}
drpTypeInt_SelectedIndexChanged(null, null);
}
@@ -99,17 +99,17 @@ namespace FineUIPro.Web.HJGL.PreDesign
table.TypeInt = int.Parse(drpTypeInt.SelectedValue);
table.CompileMan = this.CurrUser.PersonId;
table.CompileDate = DateTime.Now;
if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.).ToString())
if (drpTypeInt.SelectedValue == ((int)HJGLPackagingmanageService.TypeInt.).ToString())
{
table.PipelineComponentId = string.Join(",", dropPipelineComponentCode.Values);
}
BLL.HJGL_PackagingmanageService.AddHJGL_PackagingManage(table);
BLL.HJGLPackagingmanageService.AddHJGL_PackagingManage(table);
PackagingManageId= table.PackagingManageId;
}
else
{
Model.HJGL_PackagingManage table = BLL.HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
Model.HJGL_PackagingManage table = BLL.HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
if (table != null)
{
table.PackagingCode = txtPackagingCode.Text;
@@ -120,7 +120,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
//table.ContactPhone =txtContactPhone.Text;
table.TrainNumberId = drpTrainNumber.SelectedValue;
table.TypeInt = int.Parse(drpTypeInt.SelectedValue);
if (drpTypeInt.SelectedValue ==((int)HJGL_PackagingmanageService.TypeInt.).ToString())
if (drpTypeInt.SelectedValue ==((int)HJGLPackagingmanageService.TypeInt.).ToString())
{
table.PipelineComponentId = string.Join(",", dropPipelineComponentCode.Values);
@@ -147,7 +147,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
}
BLL.HJGL_PackagingmanageService.UpdateHJGL_PackagingManage(table);
BLL.HJGLPackagingmanageService.UpdateHJGL_PackagingManage(table);
}
SaveDetail();
}
@@ -188,7 +188,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void btnSelect_Click(object sender, EventArgs e)
{
Save();
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PackagingManageSelect.aspx?PackagingManageId={0}", PackagingManageId, "选择- ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PackagingManageSelect.aspx?PackagingManageId={0}&TypeInt={1}", PackagingManageId, drpTypeInt.SelectedValue, "选择- ")));
}
protected void btnSelectStock_Click(object sender, EventArgs e)
@@ -201,31 +201,22 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void drpTypeInt_SelectedIndexChanged(object sender, EventArgs e)
{
if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.).ToString())
if (drpTypeInt.SelectedValue == ((int)HJGLPackagingmanageService.TypeInt.).ToString())
{
dropPipelineComponentCode.Hidden=false;
Grid2.Hidden=true;
BindGrid();
}
else if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.).ToString())
else
{
dropPipelineComponentCode.Hidden = true;
Grid2.Hidden = false;
btnSelect.Hidden = false;
btnSelectStock.Hidden = true;
BindGrid2(this.PackagingManageId);
//btnSelectStock.Hidden = true;
BindGrid2(this.PackagingManageId);
}
else if (drpTypeInt.SelectedValue == ((int)HJGL_PackagingmanageService.TypeInt.).ToString())
{
dropPipelineComponentCode.Hidden = true;
Grid2.Hidden = false;
btnSelect.Hidden = true;
btnSelectStock.Hidden = false;
BindGrid2(this.PackagingManageId);
}
}
protected void Grid2_RowCommand(object sender, GridCommandEventArgs e)
{
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.PreDesign {
public partial class PackagingManageEdit {
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class PackagingManageEdit
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Form2 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form Form2;
/// <summary>
/// txtPackagingCode 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPackagingCode;
/// <summary>
/// drpTypeInt 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpTypeInt;
/// <summary>
/// dropPipelineComponentCode 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox dropPipelineComponentCode;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Label1 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// Label3 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// txtpipelineCode 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtpipelineCode;
/// <summary>
/// txtpipelineComponentCode 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtpipelineComponentCode;
/// <summary>
/// txtflowingSection 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtflowingSection;
/// <summary>
/// btnFind 控件。
/// </summary>
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnFind;
/// <summary>
/// txtStackingPosition 控件。
/// </summary>
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtStackingPosition;
/// <summary>
/// drpTrainNumber 控件。
/// </summary>
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpTrainNumber;
/// <summary>
/// Grid2 控件。
/// </summary>
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid2;
/// <summary>
/// Toolbar3 控件。
/// </summary>
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// btnSelect 控件。
/// </summary>
@@ -173,16 +175,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSelect;
/// <summary>
/// btnSelectStock 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSelectStock;
/// <summary>
/// tbNumber 控件。
/// </summary>
@@ -191,7 +184,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox tbNumber;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@@ -200,7 +193,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -209,7 +202,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
@@ -218,7 +211,7 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// Window1 控件。
/// </summary>
@@ -49,7 +49,7 @@
<f:Tree ID="tvControlItem" ShowHeader="false" Height="560px" Title="单位工程"
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
AutoLeafIdentification="true"
EnableTextSelection="true" OnNodeExpand="tvControlItem_TreeNodeExpanded">
EnableTextSelection="true" >
</f:Tree>
</Items>
</f:Panel>
@@ -68,7 +68,7 @@
DataKeyNames="Id" EnableColumnLines="true"
DataIDField="Id" EnableTextSelection="True" AllowSorting="true" SortField="MaterialCode"
SortDirection="ASC" AllowPaging="false" IsDatabasePaging="true"
PageSize="1000" EnableCheckBoxSelect="true">
PageSize="1000" EnableCheckBoxSelect="true" OnRowDataBound="Grid1_RowDataBound">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
@@ -85,6 +85,9 @@
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="150px" ColumnID="CusBillCode" DataField="CusBillCode" SortField="CusBillCode"
FieldType="String" HeaderText="出库单编号" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -97,8 +100,8 @@
<f:RenderField Width="150px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PlanNum" DataField="PlanNum" SortField="PlanNum"
FieldType="String" HeaderText="计划数量" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="150px" ColumnID="ActNum" DataField="ActNum" SortField="ActNum"
FieldType="String" HeaderText="数量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
</f:Grid>
@@ -1,15 +1,8 @@
using BLL;
using FastReport.DevComponents.DotNetBar;
using FineUIPro.Web.HJGL.WeldingManage;
using Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.HJGL.PreDesign
@@ -32,6 +25,20 @@ namespace FineUIPro.Web.HJGL.PreDesign
ViewState["PackagingManageId"] = value;
}
}
/// <summary>
/// 0是散件 1 是其他
/// </summary>
public string TypeInt
{
get
{
return (string)ViewState["TypeInt"];
}
set
{
ViewState["TypeInt"] = value;
}
}
#endregion
@@ -46,7 +53,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (!IsPostBack)
{
PackagingManageId = Request.QueryString["PackagingManageId"];
PackagingManageId = Request.Params["PackagingManageId"];
TypeInt = Request.Params["TypeInt"];
this.InitTreeMenu();//加载树
InitDropList();
}
@@ -55,12 +63,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
#endregion
#region
private void BindNodes(TreeNode node)
{
BLL.PipelineService.BindTreeNodes(node, this.tvPipeCode.Text.Trim(), txtMaterialCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize);
}
/// <summary>
/// 加载树
/// </summary>
@@ -86,141 +88,46 @@ namespace FineUIPro.Web.HJGL.PreDesign
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
// 获取当前用户所在单位
var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId);
//获取主项
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
select x).ToList();
//获取当前项目出库单
Model.Tw_InOutMasterOutput querytable = new Model.Tw_InOutMasterOutput();
querytable.ProjectId = this.CurrUser.LoginProjectId;
querytable.InOutType = (int?)TwConst.InOutType.;
querytable.TypeInt = TypeInt == ((int)HJGLPackagingmanageService.TypeInt.).ToString() ? (int)TwConst.TypeInt. : (int)TwConst.TypeInt.;
var outMasterOutputs = BLL.TwOutputmasterService.GetListData(querytable);
List<Model.WBS_UnitWork> unitWork1 = null;
List<Model.WBS_UnitWork> unitWork2 = null;
//// 当前为施工单位,只能操作本单位的数据
//if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2)
//{
// unitWork1 = (from x in unitWorkList
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1"
// select x).ToList();
// unitWork2 = (from x in unitWorkList
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2"
// select x).ToList();
//}
//else
//{
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
//}
//var dbpipeLineMat = from x in Funs.DB.HJGL_PipeLineMat select x;
//var DBpipeline = from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId select x;
if (unitWork1.Count() > 0)
{
foreach (var q in unitWork1)
{
string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]";
strSql += "where [t0].[UnitWorkId] =@UnitWorkId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
{
strSql += " and [t1].[MaterialCode] like @MaterialCode";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim()))
{
strSql += " and [t0].[PipelineCode] like @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
var a = dt.Rows.Count;
//int a = (from x in DBpipeline
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
// where x.PipelineCode.Contains(tvPipeCode.Text.Trim()) && x.UnitWorkId == q.UnitWorkId
// && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
// select x.PipelineId).Distinct().Count();
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn1 = new TreeNode();
tn1.NodeID = q.UnitWorkId;
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn1.EnableExpandEvent = true;
rootNode1.Nodes.Add(tn1);
if (a > 0)
{
// BindNodes(tn1);
TreeNode newNode = new TreeNode();
newNode.Text = "加载管线...";
newNode.NodeID = "加载管线...";
tn1.Nodes.Add(newNode);
}
}
}
if (unitWork2.Count() > 0)
{
foreach (var q in unitWork2)
{
string strSql = " SELECT DISTINCT [t0].[PipelineId] FROM [dbo].[HJGL_Pipeline] AS [t0]\r\nleft JOIN [dbo].[HJGL_PipeLineMat] AS [t1] ON [t0].[PipelineId] = [t1].[PipelineId]";
strSql += "where [t0].[UnitWorkId] =@UnitWorkId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
{
strSql += " and [t1].[MaterialCode] like @MaterialCode";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(tvPipeCode.Text.Trim()))
{
strSql += " and [t0].[PipelineCode] like @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + tvPipeCode.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
var a = dt.Rows.Count;
//var b = (from x in Funs.DB.HJGL_Pipeline
// join y in Funs.DB.HJGL_PipeLineMat on x.PipelineId equals y.PipelineId
// where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
// select x).Distinct();
//var b = (from x in DBpipeline
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
// where x.PipelineCode.Contains(tvPipeCode.Text.Trim()) && x.UnitWorkId == q.UnitWorkId
// && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
// select x.PipelineId).Distinct();
//int a = (from x in DBpipeline
// join y in dbpipeLineMat on x.PipelineId equals y.PipelineId
// where x.PipelineCode.Contains(tvPipeCode.Text.Trim()) && x.UnitWorkId == q.UnitWorkId
// && y.MaterialCode.Contains(txtMaterialCode.Text.Trim())
// select x.PipelineId).Distinct().Count();
var unitworkOutMasterOutputs = outMasterOutputs.Where(x => x.UnitWorkId == q.UnitWorkId);
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
TreeNode tn2 = new TreeNode();
tn2.NodeID = q.UnitWorkId;
tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
//if (q.UnitWorkId == this.hdUnitWorkId.Text)
//{
// tn2.Expanded = true;
//}
tn2.Text = q.UnitWorkName;
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
//tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
tn2.EnableExpandEvent = true;
tn2.EnableClickEvent = true;
rootNode2.Nodes.Add(tn2);
if (a > 0)
foreach (var item in unitworkOutMasterOutputs)
{
// BindNodes(tn2);
TreeNode newNode = new TreeNode();
newNode.Text = "加载管线...";
newNode.NodeID = "加载管线...";
FineUIPro.TreeNode newNode = new FineUIPro.TreeNode();
newNode.Text = item.CusBillCode;
newNode.NodeID = item.Id;
newNode.CommandName = "出库单";
newNode.EnableClickEvent = true;
tn2.Nodes.Add(newNode);
}
}
@@ -234,20 +141,6 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void btnTreeFind_Click(object sender, EventArgs e)
{
this.InitTreeMenu();
//this.BindGrid3(this.tvControlItem.SelectedNodeID);
}
#endregion Methods
#region Methods
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
if (e.Node.Nodes[0].NodeID == "加载管线...")
{
e.Node.Nodes.Clear();
BindNodes(e.Node);
}
}
#endregion Methods
@@ -267,20 +160,14 @@ namespace FineUIPro.Web.HJGL.PreDesign
e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]);
TreeNode treeNode = e.Node.ParentNode;
treeNode.Nodes.Remove(e.Node);
BindNodes(e.Node.ParentNode);
}
else
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
this.hdUnitWorkId.Text = string.Empty;
if (pipeline != null)
{
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
{
this.BindGrid(this.tvControlItem.SelectedNodeID);
this.BindGrid(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
}
}
}
}
@@ -288,23 +175,44 @@ namespace FineUIPro.Web.HJGL.PreDesign
#endregion TreeView
#region
private void BindGrid(string pipelineId, string unitworkid)
/// <summary>
/// 行绑定事件(没有焊接方法无法选择)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
var Prelist = HJGL_PipelineComponentService.GetPipelinePrefabricatedComponent(unitworkid, pipelineId);
DataRowView row = e.DataItem as DataRowView;
string id = e.RowID;
if (Funs.DB.HJGL_PackagingManageDetail.Any(x=>x.TwOutputDetailId==id))
{
e.RowSelectable = false;
}
;
}
private void BindGrid(string outputMasterId)
{
////var Prelist = HJGL_PipelineComponentService.GetPipelinePrefabricatedComponent(unitworkid, pipelineId);
var inoutplandetail = (from x in Funs.DB.HJGL_PackagingManageDetail
where x.PipelineId == pipelineId
&& (x.PipelineComponentId == null || x.PipelineComponentId == "")
select x).ToList();
var queryList = Prelist;
// 优化 Linq 过滤条件,过滤已经进入包装的预制散件
var result = (from x in queryList
join y in inoutplandetail on x.MaterialCode equals y.MaterialCode into yy
from y in yy.DefaultIfEmpty()
where y == null
select x).ToList();
Grid1.DataSource = result;
////var inoutplandetail = (from x in Funs.DB.HJGL_PackagingManageDetail
//// where x.PipelineId == pipelineId
//// && (x.PipelineComponentId == null || x.PipelineComponentId == "")
//// select x).ToList();
////var queryList = Prelist;
////// 优化 Linq 过滤条件,过滤已经进入包装的预制散件
////var result = (from x in queryList
//// join y in inoutplandetail on x.MaterialCode equals y.MaterialCode into yy
//// from y in yy.DefaultIfEmpty()
//// where y == null
//// select x).ToList();
////Grid1.DataSource = result;
////Grid1.DataBind();
Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput();
table.OutputMasterId = outputMasterId;
var tb = BLL.TwOutputdetailService.GetByModle(table).ToList();
Grid1.DataSource = tb;
Grid1.DataBind();
}
@@ -338,26 +246,27 @@ namespace FineUIPro.Web.HJGL.PreDesign
protected void btnSave_Click(object sender, EventArgs e)
{
Save();
this.BindGrid(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid(this.tvControlItem.SelectedNodeID);
}
private void Save()
{
var List_Id = Grid1.SelectedRowIDArray;
if (List_Id != null)
var SelectIDArry = Grid1.SelectedRowIDArray;
if (SelectIDArry != null)
{
foreach (var id in List_Id)
foreach (var id in SelectIDArry)
{
var hJGL_PipeLineMat = BLL.PipelineMatService.GetPipeLineMat(id);
if (hJGL_PipeLineMat != null)
var twoutputdetailModel = BLL.TwOutputdetailService.GetById(id);
if (twoutputdetailModel != null)
{
var model = new Model.HJGL_PackagingManageDetail()
{
Id = SQLHelper.GetNewID(),
PackagingManageId = this.PackagingManageId,
PipelineId = hJGL_PipeLineMat.PipelineId,
MaterialCode = hJGL_PipeLineMat.MaterialCode,
Number = hJGL_PipeLineMat.Number,
//PipelineId = hJGL_PipeLineMat.PipelineId,
MaterialCode = twoutputdetailModel.MaterialCode,
Number = twoutputdetailModel.ActNum,
TwOutputDetailId = twoutputdetailModel.Id,
CreateTime = DateTime.Now,
CreateUser = this.CurrUser.PersonId,
};
@@ -45,9 +45,9 @@ namespace FineUIPro.Web.HJGL.PreDesign
/// </summary>
private void BindGrid()
{
var pack = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
var pack = HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
if (pack == null) return;
var detailList= HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
var detailList= HJGLPackagingmanageService.GetPackagingDetailById(PackagingManageId);
Grid1.RecordCount = detailList.Count();
Grid1.DataSource = detailList;
Grid1.DataBind();
@@ -366,6 +366,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
// List<SqlParameter> listStr = new List<SqlParameter>();
// listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
// if (!string.IsNullOrEmpty(this.hdUnitWorkId.Text))
// {
// listStr.Add(new SqlParameter("@unitWorkId", this.hdUnitWorkId.Text));
// }
@@ -43,7 +43,7 @@
OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
</f:Button>
<f:Button ID="btnPrint" runat="server" Icon="Printer" EnableAjax="false" Text="打印" ToolTip="打印" OnClick="btnPrint_Click"></f:Button>
</Items>
@@ -296,7 +296,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
DataTable tb = LINQToDataTable(HJGL_PackagingmanageService.GetPackagingManage(Id));
DataTable tb = LINQToDataTable(HJGLPackagingmanageService.GetPackagingManage(Id));
if (tb.Rows.Count > 0)
{
var model = TrainNumberManageService.GetModelById(Id);
@@ -44,7 +44,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
private void BindGrid()
{
var result = HJGL_PackagingmanageService.GetPackagingManage(TrainNumberId);
var result = HJGLPackagingmanageService.GetPackagingManage(TrainNumberId);
Grid1.RecordCount = result.Count();
Grid1.DataSource = result;
Grid1.DataBind();