Files
SGGL_SHJ/SGGL/FineUIPro.Web/HJGL/PreDesign/TrainNumberManageEdit.aspx.cs
T
lpf c23d113eae 新增管道颜色标识导入功能及API控制器
更新了多个服务和页面,增加了导入管道颜色标识数据的功能,并实现了包装管理、车次管理、管道组件和焊口信息的API控制器。修正了文件路径错误,优化了分页和排序逻辑,删除了不再使用的API方法。
2025-10-24 10:04:03 +08:00

109 lines
3.6 KiB
C#

using BLL;
using System;
using System.Linq;
namespace FineUIPro.Web.HJGL.PreDesign
{
public partial class TrainNumberManageEdit
: PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string Id
{
get
{
return (string)ViewState["Id"];
}
set
{
ViewState["Id"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
////权限按钮方法
this.GetButtonPower();
this.Id = Request.Params["Id"];
if (!string.IsNullOrEmpty(this.Id))
{
Model.HJGL_TrainNumberManage model = BLL.TrainNumberManageService.GetModelById(this.Id);
if (model != null)
{
this.txtTrainNumber.Text = model.TrainNumber;
this.txtDriverName.Text = model.DriverName;
this.txtDriverPhone.Text = model.DriverPhone;
this.txtLicensePlateNumber.Text = model.LicensePlateNumber;
this.txtContactName.Text = model.ContactName;
this.txtContactPhone.Text = model.ContactPhone;
this.txtRemark.Text = model.Remark;
}
}
else
{
this.txtTrainNumber.Text = TrainNumberManageService.GetNewTrainNumber(this.CurrUser.LoginProjectId);
}
}
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
Model.HJGL_TrainNumberManage table = new Model.HJGL_TrainNumberManage();
table.TrainNumber = this.txtTrainNumber.Text;
table.ProjectId = this.CurrUser.LoginProjectId;
table.State = 0;
table.DriverName = this.txtDriverName.Text;
table.DriverPhone = this.txtDriverPhone.Text;
table.LicensePlateNumber = this.txtLicensePlateNumber.Text;
table.ContactName = this.txtContactName.Text;
table.ContactPhone = this.txtContactPhone.Text;
table.Remark = this.txtRemark.Text;
if (string.IsNullOrEmpty(this.Id))
{
table.Id = SQLHelper.GetNewID(typeof(Model.HJGL_TrainNumberManage));
BLL.TrainNumberManageService.Add(table);
}
else
{
table.Id = this.Id;
BLL.TrainNumberManageService.Update(table);
}
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.HJGL_TrainNumberManageMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}