2024-11-18 14:29:07 +08:00
|
|
|
|
using BLL;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
using BLL.Common;
|
|
|
|
|
using Org.BouncyCastle.Bcpg.OpenPgp;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
using System;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
using System.Collections.Specialized;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.ContractorQuality
|
|
|
|
|
{
|
|
|
|
|
public partial class IncidentInvestigationEdit : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 定义项
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 主键
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string PunishmentId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["PunishmentId"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["PunishmentId"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 加载页面
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
//GetButtonPower();//按钮权限
|
2024-11-18 14:29:07 +08:00
|
|
|
|
GroupPanel2.Hidden = true;
|
|
|
|
|
GroupPanel3.Hidden = true;
|
|
|
|
|
GroupPanel4.Hidden = true;
|
|
|
|
|
GroupPanel5.Hidden = true;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
GroupPanel6.Hidden = true;
|
|
|
|
|
GroupPanel7.Hidden = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
BLL.ViolationClauseService.InitViolationClause(this.drpViolationClause, true);//违章条款
|
2024-12-01 23:34:47 +08:00
|
|
|
|
BLL.ViolationClauseService.InitViolationClause(this.drpViolationClause2, true);//违章条款
|
|
|
|
|
BLL.DepartService.InitDropDownList(this.drpUserDep, true);//用户部门
|
|
|
|
|
//BLL.Sys_UserService.InitUserDropDownList(this.drpContractAdmin, true);
|
|
|
|
|
//合同管理员
|
|
|
|
|
this.drpContractAdmin.DataTextField = "UserName";
|
|
|
|
|
this.drpContractAdmin.DataValueField = "UserId";
|
|
|
|
|
this.drpContractAdmin.DataSource = BLL.Sys_UserService.getUserListByRoleId(BLL.Const.Role_ContractAdministratorId, true);
|
|
|
|
|
this.drpContractAdmin.DataBind();
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpContractAdmin);
|
|
|
|
|
//BLL.Sys_UserService.InitUserDropDownList(this.drpNoFrameContractAdmin, true);//非框架合同管理员
|
|
|
|
|
this.drpNoFrameContractAdmin.DataTextField = "UserName";
|
|
|
|
|
this.drpNoFrameContractAdmin.DataValueField = "UserId";
|
|
|
|
|
this.drpNoFrameContractAdmin.DataSource = BLL.Sys_UserService.getUserListByRoleId(BLL.Const.Role_ContractAdministratorId, true);
|
|
|
|
|
this.drpNoFrameContractAdmin.DataBind();
|
|
|
|
|
Funs.FineUIPleaseSelect(this.drpNoFrameContractAdmin);
|
|
|
|
|
BLL.Sys_UserService.InitUserDropDownList(this.drpContractRequester, true);//合同需求人
|
|
|
|
|
BLL.Sys_UserService.InitUserDropDownList(this.drpBuyer, true);//采购员
|
|
|
|
|
BLL.Sys_UserService.InitUserDropDownList(this.drpBuyer2, true);//采购员
|
|
|
|
|
BLL.Sys_UserService.InitUserDropDownList(this.drpPVTRequester, true);//PVT小组组长/请购人
|
|
|
|
|
//BLL.Sys_UserService.InitUserDropDownList(this.drpPVTRequester2, true);//PVT小组组长/请购人
|
2024-11-18 14:29:07 +08:00
|
|
|
|
|
|
|
|
|
this.PunishmentId = Request.Params["punishmentId"];
|
|
|
|
|
if (!string.IsNullOrEmpty(this.PunishmentId))
|
2024-12-01 23:34:47 +08:00
|
|
|
|
{
|
2024-12-19 10:34:50 +08:00
|
|
|
|
|
|
|
|
|
var att1 = from x in Funs.DB.AttachFile where x.ToKeyId == this.PunishmentId + "#1" select x;
|
|
|
|
|
if (att1.Count() == 0)
|
|
|
|
|
{
|
|
|
|
|
lbtnViewAttach.Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var att2 = from x in Funs.DB.AttachFile where x.ToKeyId == this.PunishmentId + "#2" select x;
|
|
|
|
|
if (att2.Count() == 0)
|
|
|
|
|
{
|
|
|
|
|
lbtnViewAttach2.Hidden = true;
|
|
|
|
|
lbtnAttach3.Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-18 14:29:07 +08:00
|
|
|
|
Model.EMC_Punishment pun = BLL.PunishmentService.GetPunishmentById(this.PunishmentId);
|
|
|
|
|
if (pun != null)
|
|
|
|
|
{
|
|
|
|
|
string view = Request.Params["view"];
|
|
|
|
|
if (view == "1")
|
|
|
|
|
{
|
|
|
|
|
#region 查看显示
|
2024-12-01 23:34:47 +08:00
|
|
|
|
btnSave.Hidden = true;
|
|
|
|
|
GroupPanel1.Hidden = false;
|
|
|
|
|
GroupPanel2.Hidden = false;
|
|
|
|
|
if (pun.SeType == "1")//服务
|
|
|
|
|
{
|
|
|
|
|
if (pun.IsFrame == true)//框架合同
|
|
|
|
|
{
|
|
|
|
|
fr1.Hidden = false;
|
|
|
|
|
fr2.Hidden = false;
|
|
|
|
|
fr3.Hidden = false;
|
|
|
|
|
fr4.Hidden = false;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
GroupPanel3.Hidden = false;
|
|
|
|
|
GroupPanel4.Hidden = false;
|
|
|
|
|
GroupPanel5.Hidden = false;
|
|
|
|
|
|
2024-12-03 09:56:50 +08:00
|
|
|
|
var audit = BLL.PunishmentAuditService.GetAuditBypunishmentIdAndAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.IsPass == false && audit != null)
|
|
|
|
|
{
|
|
|
|
|
frMCNoPass.Hidden = false;
|
|
|
|
|
this.txtMCNoPassReason.Text = pun.AuditResult;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else//非框架合同
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
fr1.Hidden = true;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = false;
|
|
|
|
|
frNoFrame2.Hidden = false;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
GroupPanel3.Hidden = false;
|
|
|
|
|
drpUserDep.Hidden = true;
|
|
|
|
|
GroupPanel6.Hidden = false;
|
|
|
|
|
|
|
|
|
|
var audit = BLL.PunishmentAuditService.GetAuditBypunishmentIdAndAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (pun.IsPass == false && audit != null)
|
|
|
|
|
{
|
|
|
|
|
frMCNoPass.Hidden = false;
|
|
|
|
|
this.txtMCNoPassReason.Text = pun.AuditResult;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-03 09:56:50 +08:00
|
|
|
|
else if (pun.SeType == "2")//物资
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
fr1.Hidden = true;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
frWz.Hidden = false;
|
|
|
|
|
GroupPanel7.Hidden = false;
|
|
|
|
|
GroupPanel6.Hidden = false;
|
|
|
|
|
|
|
|
|
|
var audit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (pun.IsPass == false && audit != null)
|
|
|
|
|
{
|
|
|
|
|
frPVTNoPass.Hidden = false;
|
|
|
|
|
this.txtPVTNoPassReason.Text = pun.AuditResult;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
fr1.Hidden = false;
|
|
|
|
|
fr2.Hidden = false;
|
|
|
|
|
fr3.Hidden = false;
|
|
|
|
|
fr4.Hidden = false;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
GroupPanel3.Hidden = false;
|
|
|
|
|
GroupPanel4.Hidden = false;
|
|
|
|
|
GroupPanel5.Hidden = false;
|
|
|
|
|
var audit = BLL.PunishmentAuditService.GetAuditBypunishmentIdAndAuditMan(this.PunishmentId, "SSR");
|
|
|
|
|
if (pun.IsPass == false && audit != null)
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
frRRSNoPass.Hidden = false;
|
|
|
|
|
this.txtRRSNoPassReson.Text = pun.AuditResult;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
#region 操作显示
|
2024-11-18 14:29:07 +08:00
|
|
|
|
if (pun.States == "1")
|
|
|
|
|
{
|
|
|
|
|
var role = BLL.Sys_RoleService.GetRole(CurrUser.RoleId);
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if ((role != null && role.RoleName.Trim() == "SSRC") || this.CurrUser.UserId == BLL.Const.GlyId)
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.btnSave.Hidden = false;
|
|
|
|
|
this.btnSbumit.Hidden = false;
|
|
|
|
|
this.btnNoPass.Hidden = false;//拒绝按钮
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel1.Enabled = false;
|
|
|
|
|
GroupPanel1Enabled();
|
2024-12-01 23:34:47 +08:00
|
|
|
|
GroupPanel2.Hidden = false;
|
|
|
|
|
if (pun.SeType == "1")//服务
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
fr1.Hidden = false;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
this.txtFO_No.Required = true;
|
|
|
|
|
this.txtFO_No.ShowRedStar = true;
|
|
|
|
|
if (pun.IsFrame == true)//框架合同
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
fr2.Hidden = false;
|
|
|
|
|
fr3.Hidden = false;
|
|
|
|
|
fr4.Hidden = false;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
|
|
|
|
|
this.txtContractor.Required = true;
|
|
|
|
|
this.txtContractor.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
this.txtMainCoordinator.Required = true;
|
|
|
|
|
this.txtMainCoordinator.ShowRedStar = true;
|
|
|
|
|
this.txtMCDept.Required = true;
|
|
|
|
|
this.txtMCDept.ShowRedStar = true;
|
|
|
|
|
this.txtUserRepresentative.Required = true;
|
|
|
|
|
this.txtUserRepresentative.ShowRedStar = true;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.drpContractAdmin.Required = true;
|
|
|
|
|
this.drpContractAdmin.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else //非框架合同
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = false;
|
|
|
|
|
frNoFrame2.Hidden = false;
|
|
|
|
|
|
|
|
|
|
txtFO_No.Required = true;
|
|
|
|
|
txtFO_No.ShowRedStar = true;
|
|
|
|
|
txtContractor.Required = true;
|
|
|
|
|
txtContractor.ShowRedStar = true;
|
|
|
|
|
drpContractRequester.Required = true;
|
|
|
|
|
drpContractRequester.ShowRedStar = true;
|
|
|
|
|
txtContractRequesterDep.Required = true;
|
|
|
|
|
txtContractRequesterDep.ShowRedStar = true;
|
|
|
|
|
drpBuyer.Required = true;
|
|
|
|
|
drpBuyer.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else if (pun.SeType == "2") //物资
|
|
|
|
|
{
|
|
|
|
|
fr1.Hidden = true;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
this.frWz.Hidden = false;
|
|
|
|
|
this.txtContractor2.Required = true;
|
|
|
|
|
this.txtContractor2.ShowRedStar = true;
|
|
|
|
|
this.drpPVTRequester.Required = true;
|
|
|
|
|
this.drpPVTRequester.ShowRedStar = true;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (pun.States == "2") //框架合同:主协调员办理,非框架合同:需求人办理
|
|
|
|
|
{
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel1.Enabled = false;
|
|
|
|
|
GroupPanel1Enabled();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
GroupPanel2.Hidden = false;
|
|
|
|
|
GroupPanel2.Enabled = false;
|
|
|
|
|
GroupPanel3.Hidden = false;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.btnReturn.Hidden = false;
|
|
|
|
|
this.btnNoPass.Hidden = false;
|
|
|
|
|
this.btnSbumit.Hidden = false;
|
|
|
|
|
if (pun.SeType == "1")//服务
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.drpViolationClause.Required = true;
|
|
|
|
|
this.drpViolationClause.ShowRedStar = true;
|
|
|
|
|
this.drpViolationDegree.Required = true;
|
|
|
|
|
this.drpViolationDegree.ShowRedStar = true;
|
|
|
|
|
this.txtCompany.Required = true;
|
|
|
|
|
this.txtCompany.ShowRedStar = true;
|
|
|
|
|
this.txtIndividual.Required = true;
|
|
|
|
|
this.txtIndividual.ShowRedStar = true;
|
|
|
|
|
if (pun.IsFrame == true)//框架合同
|
|
|
|
|
{
|
|
|
|
|
this.drpUserDep.Required = true;
|
|
|
|
|
this.drpUserDep.ShowRedStar = true;
|
|
|
|
|
GroupPanel3.Title = "主协调员填写";
|
|
|
|
|
}
|
|
|
|
|
else //非框架合同
|
|
|
|
|
{
|
|
|
|
|
fr1.Hidden = false;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = false;
|
|
|
|
|
frNoFrame2.Hidden = false;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
GroupPanel3.Title = "合同需求人填写";
|
|
|
|
|
this.drpUserDep.Hidden = true;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else//物资
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
fr1.Hidden = true;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
frWz.Hidden = false;
|
|
|
|
|
GroupPanel3.Hidden = true;
|
|
|
|
|
GroupPanel7.Hidden = false;
|
|
|
|
|
drpBuyer2.Required = true;
|
|
|
|
|
drpBuyer2.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else if (pun.States == "3" && pun.IsFrame == true)//用户部门填写
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel1.Enabled = false;
|
|
|
|
|
GroupPanel1Enabled();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
GroupPanel2.Hidden = false;
|
|
|
|
|
GroupPanel2.Enabled = false;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel3.Enabled = false;
|
|
|
|
|
GroupPanel3Enabled();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
GroupPanel3.Hidden = false;
|
|
|
|
|
GroupPanel4.Hidden = false;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.btnSbumit.Hidden = false;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else if (pun.States == "4" && pun.IsFrame == true)//合同管理员填写
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel1.Enabled = false;
|
|
|
|
|
GroupPanel1Enabled();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
GroupPanel2.Hidden = false;
|
|
|
|
|
GroupPanel2.Enabled = false;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel3.Enabled = false;
|
|
|
|
|
GroupPanel3Enabled();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
GroupPanel3.Hidden = false;
|
|
|
|
|
GroupPanel4.Hidden = false;
|
|
|
|
|
GroupPanel4.Enabled = false;
|
|
|
|
|
GroupPanel5.Hidden = false;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.btnClose.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
else if (pun.States == "5")//采购员填写
|
|
|
|
|
{
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel1.Enabled = false;
|
|
|
|
|
GroupPanel1Enabled();
|
2024-12-01 23:34:47 +08:00
|
|
|
|
GroupPanel2.Hidden = false;
|
|
|
|
|
GroupPanel2.Enabled = false;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
this.btnClose.Hidden = false;
|
|
|
|
|
this.drpUserDep.Hidden = true;
|
|
|
|
|
if (pun.SeType == "1")
|
|
|
|
|
{
|
|
|
|
|
GroupPanel3.Hidden = false;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel3.Enabled = false;
|
|
|
|
|
GroupPanel3Enabled();
|
2024-12-01 23:34:47 +08:00
|
|
|
|
GroupPanel6.Hidden = false;
|
|
|
|
|
fr1.Hidden = false;
|
|
|
|
|
frNoFrame1.Hidden = false;
|
|
|
|
|
frNoFrame2.Hidden = false;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fr1.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
frWz.Hidden = false;
|
|
|
|
|
GroupPanel7.Hidden = false;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
//GroupPanel7.Enabled = false;
|
|
|
|
|
GroupPanel7Enabled();
|
2024-12-01 23:34:47 +08:00
|
|
|
|
GroupPanel6.Hidden = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.btnSbumit.Hidden = false;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
#region 赋值
|
|
|
|
|
this.hdId.Text = this.PunishmentId;
|
|
|
|
|
this.txtPunishDate.Text = pun.PunishDate.HasValue ? string.Format("{0:yyyy-MM-dd}", pun.PunishDate) : "";
|
|
|
|
|
this.txtLocation.Text = pun.Location;
|
|
|
|
|
this.txtDescription.Text = pun.Description;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(pun.Violation_Inspector))
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
var user = BLL.Sys_UserService.GetUsersByUserId(pun.Violation_Inspector);
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtViolation_Inspector.Text = user.UserName;
|
|
|
|
|
if (!string.IsNullOrEmpty(user.DepartId))
|
|
|
|
|
{
|
|
|
|
|
this.txtViolation_InspectorDep.Text = BLL.DepartService.GetDepartNameById(user.DepartId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.txtMIContractor.Text = pun.MIContractor;
|
|
|
|
|
if (pun.SeType == "1")
|
|
|
|
|
{
|
|
|
|
|
this.txtFO_No.Text = pun.FO_NO;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.txtFo.Text = pun.FO_NO;
|
|
|
|
|
}
|
|
|
|
|
if (pun.IsFrame == true)
|
|
|
|
|
{
|
|
|
|
|
Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(pun.FO_NO);
|
|
|
|
|
if (fc != null)
|
|
|
|
|
{
|
|
|
|
|
txtMainCoordinator.Text = fc.Main_Coordinator;
|
|
|
|
|
txtMCDept.Text = fc.MCDept;
|
|
|
|
|
txtUserRepresentative.Text = fc.User_Representative;
|
|
|
|
|
this.txtContractor.Text = BLL.ContractorService.GetContractorById(fc.ContractorId).ContractorCN;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.txtContractor.Text = pun.Contractor;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.SeType == "2")
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-03 09:56:50 +08:00
|
|
|
|
this.txtContractor2.Text = pun.Contractor;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
//this.txtContractor3.Text = pun.Contractor;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(pun.ContractAdmin))
|
|
|
|
|
{
|
|
|
|
|
this.drpContractAdmin.SelectedValue = pun.ContractAdmin;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.drpNoFrameContractAdmin.SelectedValue = pun.ContractAdmin;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
this.txtItemNo.Text = pun.ItemNo;
|
|
|
|
|
if (!string.IsNullOrEmpty(pun.ContractRequester))
|
|
|
|
|
{
|
|
|
|
|
this.drpContractRequester.SelectedValue = pun.ContractRequester;
|
|
|
|
|
}
|
|
|
|
|
this.txtContractRequesterDep.Text = pun.ContractRequesterDep;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
|
2024-11-18 14:29:07 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(pun.ViolationClauseId))
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.SeType == "1")
|
|
|
|
|
{
|
|
|
|
|
this.drpViolationClause.SelectedValue = pun.ViolationClauseId;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.drpViolationClause2.SelectedValue = pun.ViolationClauseId;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(pun.ViolationDegree))
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.SeType == "1")
|
|
|
|
|
{
|
|
|
|
|
this.drpViolationDegree.SelectedValue = pun.ViolationDegree;
|
|
|
|
|
this.txtCompany.Text = pun.Company.HasValue ? pun.Company.ToString() : "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.drpViolationDegree2.SelectedValue = pun.ViolationDegree;
|
|
|
|
|
this.txtCompany2.Text = pun.Company.HasValue ? pun.Company.ToString() : "";
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-03 09:56:50 +08:00
|
|
|
|
|
2024-11-18 14:29:07 +08:00
|
|
|
|
this.txtIndividualPerson.Text = pun.IndividualPerson;
|
|
|
|
|
this.txtIndividual.Text = pun.Individual.HasValue ? pun.Individual.ToString() : "";
|
|
|
|
|
if (!string.IsNullOrEmpty(pun.UserDep))
|
|
|
|
|
{
|
|
|
|
|
this.drpUserDep.SelectedValue = pun.UserDep;
|
|
|
|
|
}
|
|
|
|
|
this.txtIndividualSES.Text = pun.ViolationRelatedSes;
|
|
|
|
|
this.txtSES_No.Text = pun.SES_No;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.IsFrame == true)
|
|
|
|
|
{
|
|
|
|
|
this.txtCompletionDate.Text = pun.CompletionDate.HasValue ? string.Format("{0:yyyy-MM-dd}", pun.CompletionDate) : "";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.txtNoFrameCompletionDate.Text = pun.CompletionDate.HasValue ? string.Format("{0:yyyy-MM-dd}", pun.CompletionDate) : "";
|
|
|
|
|
}
|
2024-12-03 09:56:50 +08:00
|
|
|
|
rblSeType.SelectedValue = pun.SeType == "2" ? "2" : "1";
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(pun.PVTRequester))
|
|
|
|
|
{
|
|
|
|
|
this.drpPVTRequester.SelectedValue = pun.PVTRequester;
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(pun.Buyer))
|
|
|
|
|
{
|
|
|
|
|
if (pun.SeType == "1")
|
|
|
|
|
{
|
|
|
|
|
this.drpBuyer.SelectedValue = pun.Buyer;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.drpBuyer2.SelectedValue = pun.Buyer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.txtIndividualSESReason.Text = pun.IndividualSESReason;
|
|
|
|
|
this.txtSESReson.Text = pun.SESReason;
|
|
|
|
|
this.txtBuyerReson.Text = pun.BuyerReson;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.txtPunishDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.btnSbumit.Hidden = false;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-03 09:56:50 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 申报人填写不可编辑
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected void GroupPanel1Enabled()
|
|
|
|
|
{
|
|
|
|
|
txtPunishDate.Enabled = false;
|
|
|
|
|
txtLocation.Enabled = false;
|
|
|
|
|
txtDescription.Enabled = false;
|
|
|
|
|
txtViolation_Inspector.Enabled = false;
|
|
|
|
|
txtViolation_InspectorDep.Enabled = false;
|
|
|
|
|
txtMIContractor.Enabled = false;
|
|
|
|
|
Label3.Enabled = false;
|
|
|
|
|
lblAttach.Enabled = false;
|
|
|
|
|
btnAttach.Enabled = false;
|
|
|
|
|
lblTips.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 主协调员填写不可编辑
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected void GroupPanel3Enabled()
|
|
|
|
|
{
|
|
|
|
|
drpViolationClause.Enabled = false;
|
|
|
|
|
drpViolationDegree.Enabled = false;
|
|
|
|
|
txtCompany.Enabled = false;
|
|
|
|
|
txtIndividualPerson.Enabled = false;
|
|
|
|
|
txtIndividual.Enabled = false;
|
|
|
|
|
drpUserDep.Enabled = false;
|
2024-12-03 11:23:18 +08:00
|
|
|
|
Label9.Enabled = false;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
Label2.Enabled = false;
|
|
|
|
|
btnAttach2.Enabled = false;
|
|
|
|
|
Label6.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// PVT组长或请购人填写
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected void GroupPanel7Enabled()
|
|
|
|
|
{
|
|
|
|
|
drpBuyer2.Enabled = false;
|
|
|
|
|
drpViolationClause2.Enabled = false;
|
|
|
|
|
drpViolationDegree2.Enabled = false;
|
|
|
|
|
txtCompany2.Enabled = false;
|
|
|
|
|
txtFo.Enabled = false;
|
|
|
|
|
Label7.Enabled = false;
|
|
|
|
|
btnAttach3.Enabled = false;
|
|
|
|
|
Label8.Enabled = false;
|
2024-12-03 11:23:18 +08:00
|
|
|
|
Label10.Enabled = false;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 保存、提交
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveMethod(BLL.Const.BtnSave);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 提交
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnSbumit_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveMethod(BLL.Const.BtnSubmit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SaveMethod(string type)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.PunishmentId))
|
|
|
|
|
{
|
|
|
|
|
var pun = BLL.PunishmentService.GetPunishmentById(this.PunishmentId);
|
|
|
|
|
if (pun != null)
|
|
|
|
|
{
|
|
|
|
|
if (pun.States == "1")//SSR办理
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.SeType = rblSeType.SelectedValue;
|
|
|
|
|
if (rblSeType.SelectedValue == "1")//服务
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.Contractor = this.txtContractor.Text.Trim();
|
|
|
|
|
pun.FO_NO = this.txtFO_No.Text.Trim();
|
|
|
|
|
Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(pun.FO_NO);
|
|
|
|
|
if (fc != null)
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.ItemNo = this.txtItemNo.Text.Trim();
|
|
|
|
|
pun.IsFrame = true;
|
|
|
|
|
if (this.drpContractAdmin.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
pun.ContractAdmin = this.drpContractAdmin.SelectedValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//非框架合同
|
|
|
|
|
pun.IsFrame = false;
|
|
|
|
|
if (this.drpContractRequester.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
pun.ContractRequester = this.drpContractRequester.SelectedValue;
|
|
|
|
|
}
|
|
|
|
|
pun.ContractRequesterDep = this.txtContractRequesterDep.Text.Trim();
|
|
|
|
|
if (this.drpBuyer.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
pun.Buyer = this.drpBuyer.SelectedValue;
|
|
|
|
|
}
|
|
|
|
|
if (this.drpNoFrameContractAdmin.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
pun.ContractAdmin = this.drpNoFrameContractAdmin.SelectedValue;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else //物资
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.Contractor = this.txtContractor2.Text.Trim();
|
|
|
|
|
if (this.drpPVTRequester.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpPVTRequester.SelectedValue))
|
|
|
|
|
{
|
|
|
|
|
pun.PVTRequester = this.drpPVTRequester.SelectedValue;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "2";//SSR已提交
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, "SSR");
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
if (this.rblSeType.SelectedValue == "1")
|
|
|
|
|
{
|
|
|
|
|
Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(pun.FO_NO);
|
|
|
|
|
if (fc != null)
|
|
|
|
|
{
|
|
|
|
|
audit.AuditMan = fc.Main_CoordinatorId;//框架合同:主协调员
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
audit.AuditMan = pun.ContractRequester;//非框架合同:合同需求人
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
audit.AuditMan = pun.PVTRequester;
|
|
|
|
|
}
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
|
|
|
|
|
#region SSR审批通过发送邮件
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("SSR管理员填写完成后审批通过通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
string userId = string.Empty;
|
|
|
|
|
if (pun.SeType == "1")
|
|
|
|
|
{
|
|
|
|
|
if (pun.IsFrame == true)
|
|
|
|
|
{
|
|
|
|
|
Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(pun.FO_NO);
|
|
|
|
|
if (fc != null)
|
|
|
|
|
{
|
|
|
|
|
userId = fc.Main_CoordinatorId;//框架内合同:发送给主协调员
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
userId = pun.ContractRequester;//非框架合同:发送给主协调合同需求人
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
userId = pun.PVTRequester;//物资:发送给PVT小组组长
|
|
|
|
|
}
|
2024-12-03 09:56:50 +08:00
|
|
|
|
|
2024-12-01 23:34:47 +08:00
|
|
|
|
var userTo = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.UserId.Contains(userId)
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
//抄送给流程经办人:SSR流程经办人-发起人
|
|
|
|
|
var userCC = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null)
|
|
|
|
|
|| x.UserId.Contains(pun.Violation_Inspector))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCC != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCC.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "SSR管理员填写完成后审批通过通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pun.States = "1";//SSR保存未提交
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (pun.States == "2")
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.SeType == "1")
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.ViolationClauseId = this.drpViolationClause.SelectedValue;
|
|
|
|
|
pun.ViolationDegree = this.drpViolationDegree.SelectedValue;
|
|
|
|
|
pun.Company = Funs.GetNewDecimal(this.txtCompany.Text.Trim());
|
|
|
|
|
pun.IndividualPerson = this.txtIndividualPerson.Text.Trim();
|
|
|
|
|
pun.Individual = Funs.GetNewDecimal(this.txtIndividual.Text.Trim());
|
|
|
|
|
if (pun.IsFrame == true)//框架合同
|
|
|
|
|
{
|
2024-12-03 11:23:18 +08:00
|
|
|
|
var att2 = from x in Funs.DB.AttachFile where x.ToKeyId == this.PunishmentId + "#2" select x;
|
|
|
|
|
if (att2.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
//punishment.AttachUrl = att.First().AttachUrl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("请上传质量调查相关附件!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (this.drpUserDep.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
pun.UserDep = this.drpUserDep.SelectedValue;
|
|
|
|
|
}
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "3";//主协调员提交
|
|
|
|
|
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
//updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
audit.AuditMan = pun.UserDep;
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
|
|
|
|
|
#region 主协调员审批通过邮件:发送给部门经理,抄送流程经办人
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主协调员填写完成后审批通过通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
string departLeader = string.Empty;
|
|
|
|
|
var depart = BLL.DepartService.GetDepartById(drpUserDep.SelectedValue);
|
|
|
|
|
if (depart != null)
|
|
|
|
|
{
|
|
|
|
|
departLeader = depart.DepartLeader;
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(departLeader))
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.UserId.Contains(departLeader) && x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userCc = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
2024-12-03 09:56:50 +08:00
|
|
|
|
if (userCc != null)
|
2024-12-01 23:34:47 +08:00
|
|
|
|
{
|
|
|
|
|
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "主协调员填写完成后审批通过通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else //非框架合同
|
|
|
|
|
{
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "5";//合同需求人已提交
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
//updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
audit.AuditMan = pun.Buyer;
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
|
|
|
|
|
#region 合同需求人填写完成后邮件:发送给采购员,抄送流程经办人
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("合同需求人填写完成后通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
2024-12-03 09:56:50 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
var userTo = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.UserId.Contains(pun.Buyer) && x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userCc = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCc != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "合同需求人填写完成后通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-03 11:23:18 +08:00
|
|
|
|
var att2 = from x in Funs.DB.AttachFile where x.ToKeyId == this.PunishmentId + "#2" select x;
|
|
|
|
|
if (att2.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
//punishment.AttachUrl = att.First().AttachUrl;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("请上传质量调查相关附件!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (this.drpBuyer2.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpBuyer2.SelectedValue))
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.Buyer = this.drpBuyer2.SelectedValue;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (this.drpViolationClause2.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpViolationClause2.SelectedValue))
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.ViolationClauseId = this.drpViolationClause2.SelectedValue;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.ViolationDegree = this.drpViolationDegree2.SelectedValue;
|
|
|
|
|
pun.Company = Funs.GetNewDecimal(this.txtCompany2.Text.Trim());
|
|
|
|
|
pun.FO_NO = this.txtFo.Text.Trim();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.States = "5";//提交到采购员
|
|
|
|
|
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
audit.AuditMan = pun.Buyer;
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
|
|
|
|
|
#region PVT小组组长/请购人填写完成后邮件:发送给采购员,抄送流程经办人
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("PVT小组组长请购人填写完成后通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.UserId.Contains(pun.Buyer) && x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userCc = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCc != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "PVT小组组长请购人填写完成后通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (pun.States == "3")//用户部门提交
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(this.txtIndividualSES.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
pun.ViolationRelatedSes = this.txtIndividualSES.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtIndividualSESReason.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
pun.IndividualSESReason = this.txtIndividualSESReason.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("如不填写请描述原因!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "4";//用户部门提交
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|
|
|
|
|
var u = BLL.Sys_UserService.GetUsersByUserId(this.CurrUser.UserId);
|
|
|
|
|
if (u != null)
|
|
|
|
|
{
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, u.DepartId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
audit.AuditMan = pun.ContractAdmin;
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
|
|
|
|
|
#region 用户部门填写后审批邮件:发送给合同管理员,抄送给流程经办人
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("用户部门填写后审核通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.UserId.Contains(this.drpContractAdmin.SelectedValue)
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userCc = from x in Funs.DB.View_EMail_UserTo
|
2024-12-03 09:56:50 +08:00
|
|
|
|
where (x.PunishmentId == this.PunishmentId && x.AuditDate != null)
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|| (x.UserId.Contains(pun.Violation_Inspector))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCc != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "用户部门填写后审核通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (pun.States == "4")//合同管理员
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(this.txtSES_No.Text.Trim()) && !string.IsNullOrEmpty(this.txtCompletionDate.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
pun.SES_No = this.txtSES_No.Text.Trim();
|
|
|
|
|
pun.CompletionDate = Funs.GetNewDateTime(this.txtCompletionDate.Text);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtSESReson.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
pun.SESReason = this.txtSESReson.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("如不填写请描述原因!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
if (pun.SeType == "1" && pun.IsFrame == true)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "6";//合同管理员已提交
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
#region 用户部门填写后审批邮件:发送给合同管理员,抄送给流程经办人
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("合同管理员SES完成后通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
string departLeader = string.Empty;
|
|
|
|
|
var user = BLL.Sys_UserService.GetUsersByUserId(pun.Violation_Inspector);
|
2024-12-03 09:56:50 +08:00
|
|
|
|
if (user != null)
|
2024-12-01 23:34:47 +08:00
|
|
|
|
{
|
|
|
|
|
var depart = BLL.DepartService.GetDepartById(user.DepartId);
|
2024-12-03 09:56:50 +08:00
|
|
|
|
if (depart != null)
|
2024-12-01 23:34:47 +08:00
|
|
|
|
{
|
|
|
|
|
departLeader = depart.DepartLeader;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(departLeader))
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where (x.PunishmentId == this.PunishmentId && x.AuditDate != null)
|
|
|
|
|
|| x.UserId.Contains(pun.Violation_Inspector) || x.UserId.Contains(departLeader) || x.ChineseName.Contains("王志高")
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where (x.PunishmentId == this.PunishmentId && x.AuditDate != null)
|
|
|
|
|
|| x.UserId.Contains(pun.Violation_Inspector) || x.ChineseName.Contains("王志高")
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "合同管理员SES完成后通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pun.States = "5";//合同管理员已提交
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
updateAudit.AuditMan = this.CurrUser.UserId;
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
audit.AuditMan = pun.Buyer;
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (pun.States == "5")
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtNoFrameCompletionDate.Text))
|
|
|
|
|
{
|
|
|
|
|
pun.CompletionDate = Funs.GetNewDateTime(this.txtNoFrameCompletionDate.Text.Trim());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtBuyerReson.Text))
|
|
|
|
|
{
|
|
|
|
|
pun.BuyerReson = this.txtBuyerReson.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("如不填写请描述原因!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "6";//采购员已提交,流程结束
|
|
|
|
|
|
|
|
|
|
var updateAudit = BLL.PunishmentAuditService.GetAuditByAuditMan(this.PunishmentId, this.CurrUser.UserId);
|
|
|
|
|
if (updateAudit != null)
|
|
|
|
|
{
|
|
|
|
|
updateAudit.AuditDate = DateTime.Now;
|
|
|
|
|
updateAudit.IsPass = true;
|
|
|
|
|
BLL.PunishmentAuditService.UpdatePunishmentAudit(updateAudit);
|
|
|
|
|
if (pun.SeType == "2")//物资
|
|
|
|
|
{
|
|
|
|
|
#region 采购员填写完成后邮件:发送给流程经办人、发起人经理,王志高
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("物资采购员填写完成后通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string departLeader = string.Empty;
|
|
|
|
|
var user = BLL.Sys_UserService.GetUsersByUserId(pun.Violation_Inspector);
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(user.DepartId))
|
|
|
|
|
{
|
|
|
|
|
var depart = BLL.DepartService.GetDepartById(user.DepartId);
|
|
|
|
|
if (depart != null)
|
|
|
|
|
{
|
|
|
|
|
departLeader = depart.DepartLeader;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(departLeader))
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.ChineseName.Contains("王志高") || x.UserId.Contains(departLeader))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where ((x.PunishmentId == this.PunishmentId && x.AuditDate != null) || x.ChineseName.Contains("王志高"))
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "物资采购员填写完成后通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#region 采购员填写完成后邮件:发送给流程经办人,抄送发起人经理、王志高
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("采购员填写完成后通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.View_EMail_UserTo
|
|
|
|
|
where (x.PunishmentId == this.PunishmentId && x.AuditDate != null)
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
string departLeader = string.Empty;
|
|
|
|
|
var user = BLL.Sys_UserService.GetUsersByUserId(pun.Violation_Inspector);
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(user.DepartId))
|
|
|
|
|
{
|
|
|
|
|
var depart = BLL.DepartService.GetDepartById(user.DepartId);
|
|
|
|
|
if (depart != null)
|
|
|
|
|
{
|
|
|
|
|
departLeader = depart.DepartLeader;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(departLeader))
|
|
|
|
|
{
|
|
|
|
|
var userCc = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.ChineseName.Contains("王志高")
|
|
|
|
|
|| x.UserId.Contains(departLeader)
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCc != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var userCc = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.ChineseName.Contains("王志高")
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCc != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", pun.Location);
|
|
|
|
|
myPram.Add("质量事件描述", pun.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "采购员填写完成后通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pun.PunishDate = Funs.GetNewDateTime(this.txtPunishDate.Text);
|
|
|
|
|
pun.Location = this.txtLocation.Text.Trim();
|
|
|
|
|
pun.Description = this.txtDescription.Text.Trim();
|
2024-12-01 23:34:47 +08:00
|
|
|
|
pun.MIContractor = this.txtMIContractor.Text.Trim();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
pun.Flag = "2";//质量
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
pun.States = "1";//申请人已提交
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.PunishmentId;
|
|
|
|
|
audit.AuditMan = "SSR";
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pun.States = "0";//申请人未提交
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pun.PunishmentId = this.PunishmentId;
|
|
|
|
|
var att = from x in Funs.DB.AttachFile where x.ToKeyId == this.PunishmentId select x;
|
|
|
|
|
if (att.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
pun.AttachUrl = att.First().AttachUrl;
|
|
|
|
|
}
|
|
|
|
|
BLL.PunishmentService.UpdatePunishment(pun);
|
2024-12-01 23:34:47 +08:00
|
|
|
|
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "修改承包商及供应商质量事件报告");
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Model.EMC_Punishment punishment = new Model.EMC_Punishment();
|
|
|
|
|
punishment.PunishDate = Funs.GetNewDateTime(this.txtPunishDate.Text);
|
|
|
|
|
punishment.Location = this.txtLocation.Text.Trim();
|
|
|
|
|
punishment.Description = this.txtDescription.Text.Trim();
|
2024-12-01 23:34:47 +08:00
|
|
|
|
punishment.MIContractor = this.txtMIContractor.Text.Trim();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
punishment.Flag = "2";//质量
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(this.hdId.Text))
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
punishment.PunishmentId = this.hdId.Text.Trim();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
punishment.PunishmentId = SQLHelper.GetNewID(typeof(Model.EMC_Punishment));
|
|
|
|
|
this.hdId.Text = punishment.PunishmentId;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
punishment.States = "1";//申请人已提交
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
punishment.States = "0";//申请人未提交
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
2024-12-03 09:56:50 +08:00
|
|
|
|
var att = from x in Funs.DB.AttachFile where x.ToKeyId == punishment.PunishmentId + "#1" select x;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
if (att.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
punishment.AttachUrl = att.First().AttachUrl;
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("请上传相关附件!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
punishment.Violation_Inspector = this.CurrUser.UserId;//发起人
|
|
|
|
|
punishment.CreateDate = DateTime.Now;
|
|
|
|
|
BLL.PunishmentService.AddPunishment(punishment);
|
2024-12-01 23:34:47 +08:00
|
|
|
|
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "增加承包商及供应商质量事件报告");
|
|
|
|
|
|
|
|
|
|
if (type == BLL.Const.BtnSubmit)
|
|
|
|
|
{
|
|
|
|
|
Model.EMC_PunishmentAudit audit = new Model.EMC_PunishmentAudit();
|
|
|
|
|
audit.AuditId = SQLHelper.GetNewID(typeof(Model.EMC_PunishmentAudit));
|
|
|
|
|
audit.PunishmentId = this.hdId.Text;
|
|
|
|
|
audit.AuditMan = "SSR";
|
|
|
|
|
BLL.PunishmentAuditService.AddPunishmentAudit(audit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 发起人发送邮件
|
|
|
|
|
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
|
|
|
|
|
if (pops == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string[] mailTo = null;
|
|
|
|
|
string[] mailCC = null;
|
|
|
|
|
string resultMessage = "";
|
|
|
|
|
|
|
|
|
|
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("申报人填写完成后通知"));
|
|
|
|
|
if (emailTemplate.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
var userTo = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.ChineseName.Contains("周海霄") || x.ChineseName.Contains("林敏")
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userTo != null)
|
|
|
|
|
{
|
|
|
|
|
mailTo = userTo.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
var userCC = from x in Funs.DB.Sys_User
|
|
|
|
|
where x.ChineseName.Contains("王志高")
|
|
|
|
|
&& x.Email != null && x.Email != ""
|
|
|
|
|
select x;
|
|
|
|
|
if (userCC != null)
|
|
|
|
|
{
|
|
|
|
|
mailCC = userCC.Select(x => x.Email).ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mailTo.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
NameValueCollection myPram = new NameValueCollection();
|
|
|
|
|
myPram.Add("发现日期", punishment.PunishDate != null ? punishment.PunishDate.Value.ToString("yyyy-MM-dd") : "");
|
|
|
|
|
myPram.Add("位置", punishment.Location);
|
|
|
|
|
myPram.Add("质量事件描述", punishment.Description);
|
|
|
|
|
MailHelper.SendPunishSesMail(pops, myPram, "申报人填写完成后通知", mailTo, mailCC, out resultMessage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 文本框、下拉框事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 合同号改变事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void txtText_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(txtFO_No.Text))
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.fr1.Hidden = false;
|
|
|
|
|
this.frWz.Hidden = true;
|
|
|
|
|
this.txtFO_No.Required = true;
|
|
|
|
|
this.txtFO_No.ShowRedStar = true;
|
|
|
|
|
this.txtContractor.Required = true;
|
|
|
|
|
this.txtContractor.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
string foNO = txtFO_No.Text.Trim();
|
|
|
|
|
Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(foNO);
|
|
|
|
|
if (fc != null)
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.fr2.Hidden = false;
|
|
|
|
|
this.fr3.Hidden = false;
|
|
|
|
|
this.fr4.Hidden = false;
|
|
|
|
|
this.frNoFrame1.Hidden = true;
|
|
|
|
|
this.frNoFrame2.Hidden = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
|
|
|
|
|
this.txtMainCoordinator.Required = true;
|
|
|
|
|
this.txtMainCoordinator.ShowRedStar = true;
|
|
|
|
|
this.txtMCDept.Required = true;
|
|
|
|
|
this.txtMCDept.ShowRedStar = true;
|
|
|
|
|
this.txtUserRepresentative.Required = true;
|
|
|
|
|
this.txtUserRepresentative.ShowRedStar = true;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.drpContractAdmin.Required = true;
|
|
|
|
|
this.drpContractAdmin.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.txtContractor.Text = BLL.ContractorService.GetContractorById(fc.ContractorId).ContractorCN;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
txtMainCoordinator.Text = fc.Main_Coordinator;
|
|
|
|
|
txtMCDept.Text = fc.MCDept;
|
|
|
|
|
txtUserRepresentative.Text = fc.User_Representative;
|
|
|
|
|
this.drpContractAdmin.SelectedValue = fc.Contract_AdminId;
|
|
|
|
|
|
|
|
|
|
// 序号
|
|
|
|
|
var pun = from x in Funs.DB.EMC_Punishment where x.FO_NO == foNO && x.Flag == "2" select x;
|
|
|
|
|
if (pun.Count() == 0)
|
|
|
|
|
{
|
|
|
|
|
txtItemNo.Text = "001";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var max = pun.Max(x => x.ItemNo);
|
|
|
|
|
if (!string.IsNullOrEmpty(max))
|
|
|
|
|
{
|
|
|
|
|
int maxNo = Convert.ToInt32(max) + 1;
|
|
|
|
|
txtItemNo.Text = "00" + maxNo.ToString();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
txtItemNo.Text = "001";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.fr2.Hidden = true;
|
|
|
|
|
this.fr3.Hidden = true;
|
|
|
|
|
this.fr4.Hidden = true;
|
|
|
|
|
this.frNoFrame1.Hidden = false;
|
|
|
|
|
this.frNoFrame2.Hidden = false;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
|
|
|
|
|
this.drpContractRequester.Required = true;
|
|
|
|
|
this.drpContractRequester.ShowRedStar = true;
|
|
|
|
|
this.txtContractRequesterDep.Required = true;
|
|
|
|
|
this.txtContractRequesterDep.ShowRedStar = true;
|
2024-12-01 23:34:47 +08:00
|
|
|
|
this.drpBuyer.Required = true;
|
|
|
|
|
this.drpBuyer.ShowRedStar = true;
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 违章条款下拉选择事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void drpViolationClause_OnSelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (drpViolationClause.SelectedValue != Const._Null)
|
|
|
|
|
{
|
|
|
|
|
var vio = BLL.ViolationClauseService.GetViolationClause(drpViolationClause.SelectedValue);
|
|
|
|
|
if (vio.DeductionComPany1 != 0)
|
|
|
|
|
{
|
|
|
|
|
drpViolationDegree.SelectedValue = "1";
|
2024-12-01 23:34:47 +08:00
|
|
|
|
txtCompany.Text = vio.DeductionIndividual1.ToString();
|
|
|
|
|
txtIndividual.Text = vio.DeductionComPany1.ToString();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
if (vio.DeductionComPany2 != 0)
|
|
|
|
|
{
|
|
|
|
|
drpViolationDegree.SelectedValue = "2";
|
2024-12-01 23:34:47 +08:00
|
|
|
|
txtCompany.Text = vio.DeductionIndividual2.ToString();
|
|
|
|
|
txtIndividual.Text = vio.DeductionComPany2.ToString();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
if (vio.DeductionComPany3 != 0)
|
|
|
|
|
{
|
|
|
|
|
drpViolationDegree.SelectedValue = "3";
|
2024-12-01 23:34:47 +08:00
|
|
|
|
txtCompany.Text = vio.DeductionIndividual3.ToString();
|
|
|
|
|
txtIndividual.Text = vio.DeductionComPany3.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 违章条款下拉选择事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void drpViolationClause2_OnSelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (drpViolationClause2.SelectedValue != Const._Null)
|
|
|
|
|
{
|
|
|
|
|
var vio = BLL.ViolationClauseService.GetViolationClause(drpViolationClause2.SelectedValue);
|
|
|
|
|
if (vio.DeductionComPany1 != 0)
|
|
|
|
|
{
|
|
|
|
|
drpViolationDegree2.SelectedValue = "1";
|
|
|
|
|
txtCompany2.Text = vio.DeductionIndividual1.ToString();
|
|
|
|
|
////txtIndividual.Text = vio.DeductionComPany1.ToString();
|
|
|
|
|
}
|
|
|
|
|
if (vio.DeductionComPany2 != 0)
|
|
|
|
|
{
|
|
|
|
|
drpViolationDegree2.SelectedValue = "2";
|
|
|
|
|
txtCompany2.Text = vio.DeductionIndividual2.ToString();
|
|
|
|
|
//txtIndividual.Text = vio.DeductionComPany2.ToString();
|
|
|
|
|
}
|
|
|
|
|
if (vio.DeductionComPany3 != 0)
|
|
|
|
|
{
|
|
|
|
|
drpViolationDegree2.SelectedValue = "3";
|
|
|
|
|
txtCompany2.Text = vio.DeductionIndividual3.ToString();
|
|
|
|
|
//txtIndividual.Text = vio.DeductionComPany3.ToString();
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-01 23:34:47 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 合同需求人下拉选择事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void drpContractRequester_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.txtContractRequesterDep.Text = string.Empty;
|
|
|
|
|
if (!string.IsNullOrEmpty(this.drpContractRequester.SelectedValue) && this.drpContractRequester.SelectedValue != BLL.Const._Null)
|
|
|
|
|
{
|
|
|
|
|
var user = BLL.Sys_UserService.GetUsersByUserId(this.drpContractRequester.SelectedValue);
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(user.DepartId))
|
|
|
|
|
{
|
|
|
|
|
this.txtContractRequesterDep.Text = BLL.DepartService.GetDepartNameById(user.DepartId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 物资/服务选项
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void rblSeType_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.rblSeType.SelectedValue == "1")
|
|
|
|
|
{
|
|
|
|
|
fr1.Hidden = false;
|
|
|
|
|
var fc = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(this.txtFO_No.Text.Trim());
|
|
|
|
|
if (fc != null)
|
|
|
|
|
{
|
|
|
|
|
fr2.Hidden = false;
|
|
|
|
|
fr3.Hidden = false;
|
|
|
|
|
fr4.Hidden = false;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = false;
|
|
|
|
|
frNoFrame2.Hidden = false;
|
|
|
|
|
frWz.Hidden = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
frWz.Hidden = false;
|
|
|
|
|
fr1.Hidden = true;
|
|
|
|
|
fr2.Hidden = true;
|
|
|
|
|
fr3.Hidden = true;
|
|
|
|
|
fr4.Hidden = true;
|
|
|
|
|
frNoFrame1.Hidden = true;
|
|
|
|
|
frNoFrame2.Hidden = true;
|
|
|
|
|
this.txtContractor2.Required = true;
|
|
|
|
|
this.txtContractor2.ShowRedStar = true;
|
|
|
|
|
this.drpPVTRequester.Required = true;
|
|
|
|
|
this.drpPVTRequester.ShowRedStar = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-18 14:29:07 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
2024-12-03 09:56:50 +08:00
|
|
|
|
#region 附件上传、查看
|
2024-11-18 14:29:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 相关附件上传
|
|
|
|
|
/// </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.EMC_Punishment));
|
|
|
|
|
}
|
2025-04-02 09:11:50 +08:00
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=edit&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=1", this.hdId.Text, BLL.Const.IncidentInvestigationMenuId)));
|
2024-12-03 09:56:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 附件查看
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void lbtnViewAttach_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2025-04-02 09:11:50 +08:00
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=view&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=1", this.hdId.Text, BLL.Const.IncidentInvestigationMenuId)));
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-02 09:11:50 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 质量调查相关附件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnAttach2_Click(object sender, EventArgs e)
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
|
|
|
|
|
{
|
|
|
|
|
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.EMC_Punishment));
|
|
|
|
|
}
|
2025-04-02 09:11:50 +08:00
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=edit&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=2", this.PunishmentId, BLL.Const.IncidentInvestigationMenuId)));
|
2024-12-03 09:56:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 附件查看
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void lbtnViewAttach2_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2025-04-02 09:11:50 +08:00
|
|
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=view&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}&strParam=2", this.PunishmentId, BLL.Const.IncidentInvestigationMenuId)));
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-12-01 23:34:47 +08:00
|
|
|
|
#region 拒绝
|
2024-11-18 14:29:07 +08:00
|
|
|
|
/// <summary>
|
2024-12-01 23:34:47 +08:00
|
|
|
|
/// 拒绝按钮
|
2024-11-18 14:29:07 +08:00
|
|
|
|
/// </summary>
|
2024-12-01 23:34:47 +08:00
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnNoPass_Click(object sender, EventArgs e)
|
2024-11-18 14:29:07 +08:00
|
|
|
|
{
|
2024-12-01 23:34:47 +08:00
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("NoPassEdit.aspx?punishmentId={0}", this.PunishmentId, "编辑 - ")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 退回到上一流程
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 退回到上一流程
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnReturn_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReturnReason.aspx?punishmentId={0}", this.PunishmentId, "编辑 - ")));
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 流程结束
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 流程结束
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnClose_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveMethod(BLL.Const.BtnSubmit);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 关闭弹出框
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 关闭弹出框
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-12-03 09:56:50 +08:00
|
|
|
|
|
|
|
|
|
|
2024-11-18 14:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|