20240305 开车HSE管理

This commit is contained in:
2024-03-05 09:52:53 +08:00
parent f227bbeba2
commit 8fec129c11
32 changed files with 2334 additions and 2283 deletions
@@ -15,34 +15,31 @@ namespace FineUIPro.Web.TestRun.DriverHse
{
if (!IsPostBack)
{
BLL.UnitWorkService.InitUnitWorkDropDownList(this.drpUnitWorkId, this.CurrUser.LoginProjectId, true);
string id = Request.Params["id"];
if (!string.IsNullOrEmpty(id))
string licenseTypeId = Request.Params["licenseTypeId"];
string hseLicenseId = Request.Params["hseLicenseId"];
if (!string.IsNullOrEmpty(hseLicenseId))
{
Model.DriverHse_HseLicense data = BLL.HseLicenseService.GetHseLicenseById(id);
Model.DriverHse_HseLicense data = BLL.HseLicenseService.GetHseLicenseById(hseLicenseId);
if (data != null)
{
this.hdId.Text = id;
this.hdId.Text = hseLicenseId;
this.txtCode.Text = data.Code;
if (!string.IsNullOrEmpty(data.UnitWorkId))
if (!string.IsNullOrEmpty(data.LicenseTypeId))
{
this.drpUnitWorkId.SelectedValue = data.UnitWorkId;
this.txtLicenseTypeName.Text = BLL.TestRunLicenseTypeService.GetLicenseTypeById(data.LicenseTypeId).LicenseTypeName;
}
this.txtWorkContents.Text = data.WorkContents;
this.txtWorkArea.Text = data.WorkArea;
this.txtWorkDate.Text = data.WorkDate.HasValue ? string.Format("{0:yyyy-MM-dd}", data.WorkDate) : "";
this.txtUnitHead.Text = data.UnitHead;
this.txtApplyMan.Text = data.ApplyMan;
this.txtApplyUnit.Text = data.ApplyUnit;
this.txtWorkTicket.Text = data.WorkTicket;
this.txtWorkTicketCode.Text = data.WorkTicketCode;
this.txtDetection.Text = data.Detection;
this.txtGuardian.Text = data.Guardian;
this.txtWorkEnd.Text = data.WorkEnd;
this.txtApplyMan.Text = data.ApplyMan;
this.txtHeaderMan.Text = data.HeaderMan;
this.txtWorkAddress.Text = data.WorkAddress;
this.txtWorkContents.Text = data.WorkContents;
this.txtRemark.Text = data.Remark;
}
}
else
{
this.txtLicenseTypeName.Text = BLL.TestRunLicenseTypeService.GetLicenseTypeById(licenseTypeId).LicenseTypeName;
}
}
}
#endregion
@@ -53,14 +50,14 @@ namespace FineUIPro.Web.TestRun.DriverHse
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//protected void btnAttach_Click(object sender, EventArgs e)
//{
// if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
// {
// this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverHse_HseLicense));
// }
// PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverHse/HseLicense&menuId={1}", this.hdId.Text, BLL.Const.HseLicenseMenuId)));
//}
protected void btnAttach_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
{
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverHse_HseLicense));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverHse/HseLicense&menuId={1}", this.hdId.Text, BLL.Const.HseLicenseMenuId)));
}
#endregion
#region
@@ -71,35 +68,25 @@ namespace FineUIPro.Web.TestRun.DriverHse
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.drpUnitWorkId.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("请选择装置/工序!", MessageBoxIcon.Warning);
return;
}
string id = Request.Params["id"];
string licenseTypeId = Request.Params["licenseTypeId"];
string hseLicenseId = Request.Params["hseLicenseId"];
Model.DriverHse_HseLicense newData = new Model.DriverHse_HseLicense();
newData.Code = this.txtCode.Text.Trim();
newData.WorkArea = this.txtWorkArea.Text.Trim();
newData.WorkContents = this.txtWorkContents.Text.Trim();
newData.WorkDate = Funs.GetNewDateTime(this.txtWorkDate.Text.Trim());
newData.UnitHead = this.txtUnitHead.Text.Trim();
newData.UnitWorkId = this.drpUnitWorkId.SelectedValue;
newData.ApplyMan = this.txtApplyMan.Text.Trim();
newData.ApplyUnit = this.txtApplyUnit.Text.Trim();
newData.WorkTicket = this.txtWorkTicket.Text.Trim();
newData.WorkTicketCode = this.txtWorkTicketCode.Text.Trim();
newData.Detection = this.txtDetection.Text.Trim();
newData.Guardian = this.txtGuardian.Text.Trim();
newData.WorkEnd = this.txtWorkEnd.Text.Trim();
newData.ApplyMan = this.txtApplyMan.Text.Trim();
newData.HeaderMan = this.txtHeaderMan.Text.Trim();
newData.WorkAddress = this.txtWorkAddress.Text.Trim();
newData.WorkContents = this.txtWorkContents.Text.Trim();
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(id))
if (!string.IsNullOrEmpty(hseLicenseId))
{
newData.HseLicenseId = id;
newData.HseLicenseId = hseLicenseId;
BLL.HseLicenseService.UpdateHseLicense(newData);
}
else
{
newData.LicenseTypeId = licenseTypeId;
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.HseLicenseId = this.hdId.Text.Trim();