This commit is contained in:
2024-05-09 16:19:20 +08:00
parent 662829cff8
commit 42cb326102
17 changed files with 367 additions and 2024 deletions
+60 -16
View File
@@ -36,17 +36,8 @@ namespace FineUIPro.Web.SES
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string view = Request.Params["view"];
if (view == "1")
{
this.btnSave.Hidden = true;
}
else
{
GetButtonPower();//按钮权限
}
var role = BLL.Sys_RoleService.GetRole(CurrUser.RoleId);
if (role != null && role.RoleName == "Contract Administrator")
{
txtSESNo.Required = true;
@@ -64,7 +55,7 @@ namespace FineUIPro.Web.SES
// BLL.SESRelatedDataService.InitFONoDropDownList(this.drpFO_No, true);//合同号
BLL.ContractorService.InitDropDownList(drpContractor, true); //承包商;
BLL.DepartService.InitDropDownList(this.drpBYC_RU, true);//BYC负责部门
BLL.DepartService.InitDepartToWhere(this.drpBYC_RU, true);//BYC负责部门
BLL.Sys_UserService.InitUserDropDownList(this.drpViolationInspector, true);//违章检查人
txtViolationRelatedSes.Enabled = false;
@@ -102,6 +93,16 @@ namespace FineUIPro.Web.SES
txtMainCoordinator.Text = punishment.Main_Coordinator;
txtMCDept.Text = punishment.MCDept;
txtUserRepresentative.Text = punishment.User_Representative;
if (punishment.SelectYesNo != null)
{
drpSelectYesNo.SelectedValue = punishment.SelectYesNo == true ? "True" : "False";
}
else
{
drpSelectYesNo.SelectedValue = "";
}
txtDef.Text= punishment.Def;
if (!string.IsNullOrEmpty(punishment.BYC_RU))
{
@@ -119,18 +120,17 @@ namespace FineUIPro.Web.SES
{
btnSave.Hidden = false;
txtViolationRelatedSes.Enabled = true;
drpSelectYesNo.Enabled = true;
txtDef.Enabled = true;
}
else
{
btnSave.Hidden = true;
txtViolationRelatedSes.Enabled = false;
drpSelectYesNo.Enabled = false;
txtDef.Enabled = false;
}
//if (!string.IsNullOrEmpty(punishment.ViolationRelatedSes))
//{
// SetReadonly(false);
//}
this.txtCompletionDate.Text = punishment.CompletionDate != null ? string.Format("{0:yyyy-MM-dd}", punishment.CompletionDate) : "";
this.txtSESNo.Text = punishment.SES_No;
txtViolationRelatedSes.Text = punishment.ViolationRelatedSes;
@@ -140,6 +140,15 @@ namespace FineUIPro.Web.SES
{
}
if (view == "1")
{
this.btnSave.Hidden = true;
}
else
{
GetButtonPower();//按钮权限
}
}
}
#endregion
@@ -186,6 +195,15 @@ namespace FineUIPro.Web.SES
return;
}
if (!string.IsNullOrEmpty(PunishmentId))
{
var punishment = BLL.PunishmentService.GetPunishmentById(PunishmentId);
if ((this.CurrUser.DepartId == punishment.BYC_RU || this.CurrUser.Account == Const.Gly) && this.drpSelectYesNo.SelectedValue == "")
{
Alert.ShowInTop("请选择是否有关联SES!", MessageBoxIcon.Warning);
return;
}
}
if (PunishmentId == null)
{
PunishmentId = string.Empty;
@@ -260,6 +278,14 @@ namespace FineUIPro.Web.SES
{
punishment.Violation_Inspector = drpViolationInspector.SelectedValue;
}
if (drpSelectYesNo.SelectedValue != "")
{
punishment.SelectYesNo = Convert.ToBoolean(drpSelectYesNo.SelectedValue);
}
if (txtDef.Text != "")
{
punishment.Def = txtDef.Text.Trim();
}
punishment.ViolationRelatedSes = txtViolationRelatedSes.Text.Trim();
punishment.CompletionDate = Funs.GetNewDateTime(this.txtCompletionDate.Text.Trim());
punishment.Flag = "1";
@@ -370,6 +396,24 @@ namespace FineUIPro.Web.SES
}
}
protected void drpSelectYesNo_SelectedIndexChanged(object sender, EventArgs e)
{
if (drpSelectYesNo.SelectedValue == "True")
{
txtViolationRelatedSes.Readonly = false;
txtViolationRelatedSes.ShowRedStar = true;
txtViolationRelatedSes.Required = true;
}
else
{
txtViolationRelatedSes.Readonly = true;
txtViolationRelatedSes.ShowRedStar = false;
txtViolationRelatedSes.Required = false;
txtDef.ShowRedStar = true;
txtDef.Required = true;
}
}
protected void txtPunish_OnTextChanged(object sender, EventArgs e)
{
decimal? numCompany = 0;