2022-09-05 16:36:31 +08:00
|
|
|
|
using BLL;
|
2025-05-12 19:05:13 +08:00
|
|
|
|
using Model;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
|
using System.IO;
|
2025-05-12 19:05:13 +08:00
|
|
|
|
using System.Linq;
|
2022-09-05 16:36:31 +08:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
using AspNet = System.Web.UI.WebControls;
|
|
|
|
|
|
namespace FineUIPro.Web.HJGL.PreDesign
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class PackagingManageView : PageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public string PackagingManageId
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return (string)ViewState["PackagingManageId"];
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewState["PackagingManageId"] = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#region 加载页面
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 加载页面
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
|
{
|
|
|
|
|
|
PackagingManageId = Request.Params["PackagingManageId"];
|
|
|
|
|
|
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
|
|
|
|
|
// 绑定表格
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 绑定数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
|
{
|
2025-05-12 19:05:13 +08:00
|
|
|
|
var pack = HJGL_PackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
|
|
|
|
|
|
if (pack == null) return;
|
2025-08-28 15:41:32 +08:00
|
|
|
|
var detailList= HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
|
|
|
|
|
|
Grid1.RecordCount = detailList.Count();
|
|
|
|
|
|
Grid1.DataSource = detailList;
|
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
|
|
|
|
|
|
|
/* if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制组件)
|
2025-05-12 19:05:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
|
|
|
|
|
|
|
|
|
|
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
|
|
|
|
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
|
|
|
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
|
|
|
|
Grid1.DataSource = table;
|
|
|
|
|
|
Grid1.DataBind();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var result = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
|
|
|
|
|
|
var detailList = from x in result
|
|
|
|
|
|
select new
|
|
|
|
|
|
{
|
|
|
|
|
|
PipelineComponentId = x.Id,
|
|
|
|
|
|
PipelineComponentCode = x.MaterialCode,
|
|
|
|
|
|
num = x.Number,
|
|
|
|
|
|
CU = x.MaterialUnit,
|
2025-07-23 13:27:58 +08:00
|
|
|
|
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
|
|
|
|
|
|
x.FlowingSection,
|
2025-05-12 19:05:13 +08:00
|
|
|
|
};
|
|
|
|
|
|
Grid1.RecordCount = detailList.Count();
|
|
|
|
|
|
Grid1.DataSource = detailList;
|
|
|
|
|
|
Grid1.DataBind();
|
2025-08-28 15:41:32 +08:00
|
|
|
|
}*/
|
2025-05-12 19:05:13 +08:00
|
|
|
|
|
2025-08-28 15:41:32 +08:00
|
|
|
|
|
2022-09-05 16:36:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 表头过滤
|
|
|
|
|
|
protected void Grid1_FilterChange(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 页索引改变事件
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 页索引改变事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Grid1.PageIndex = e.NewPageIndex;
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 排序
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 排序
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Grid1.SortDirection = e.SortDirection;
|
|
|
|
|
|
Grid1.SortField = e.SortField;
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 分页选择下拉改变事件
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 分页选择下拉改变事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
|
|
|
|
|
BindGrid();
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|