d35ff80f3e
移除 APIPackagingManageService,功能迁移至 HJGLPackagingmanageService 并进行重构,新增方法支持包装与组件关联管理、分页查询、状态描述等功能。 更新 PackagingManageController,替换旧服务调用,新增接口方法。 调整数据库结构,新增子表 HJGL_PackagingManageDetail,优化包装与组件的关联存储。 更新前端页面逻辑,适配新数据结构,新增 StackingPosition 字段显示。 优化 Model 层字段定义,调整长度限制,提升性能与一致性。 更新报表模板与项目文件,移除冗余代码,提升代码可维护性。
98 lines
2.8 KiB
C#
98 lines
2.8 KiB
C#
using BLL;
|
|
using System;
|
|
using System.Linq;
|
|
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()
|
|
{
|
|
var pack = HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
|
|
if (pack == null) return;
|
|
var detailList = HJGLPackagingmanageService.GetPackagingDetailById(PackagingManageId);
|
|
Grid1.RecordCount = detailList.Count();
|
|
Grid1.DataSource = detailList;
|
|
Grid1.DataBind();
|
|
}
|
|
#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
|
|
}
|
|
} |