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
+8 -2
View File
@@ -99,6 +99,9 @@
<f:RenderField Width="120px" ColumnID="BYCRU" DataField="BYCRU"
FieldType="String" HeaderText="BYC Resp. Dept." HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="BYCRULeader" DataField="BYCRULeader"
FieldType="String" HeaderText="BYC Resp Manager" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="Violation_Inspector_Name" DataField="Violation_Inspector_Name"
FieldType="String" HeaderText="Violation </br>Inspector" HeaderTextAlign="Center">
</f:RenderField>
@@ -112,9 +115,12 @@
<f:RenderField Width="130px" ColumnID="CompletionDate" DataField="CompletionDate"
FieldType="Date" Renderer="Date" HeaderText="Backcharge</br>Completion Date" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="ViolationRelatedSes" DataField="ViolationRelatedSes"
<f:RenderField Width="120px" ColumnID="ViolationRelatedSes" DataField="ViolationRelatedSes"
FieldType="String" HeaderText="Violation Related SES" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="EmailIsSend" DataField="EmailIsSend"
FieldType="String" HeaderText="If send mail" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -138,7 +144,7 @@
</f:Panel>
<f:Window ID="Window1" Title="Contractor Safety Punishment Edit" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="960px" Height="630px">
Width="960px" Height="660px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
+31 -11
View File
@@ -180,7 +180,7 @@ namespace FineUIPro.Web.SES
protected void btnEmail_Click(object sender, EventArgs e)
{
List<Model.View_EMC_Punishment> pList = (from x in Funs.DB.View_EMC_Punishment
where x.Flag == "1"
where x.Flag == "1" && x.EmailIsSend == "否" && x.BYCRU != null && x.BYCRU.ToLower() != "none"
&& (x.PunishDate.Value.Year + x.PunishDate.Value.Month) == (DateTime.Now.Year + DateTime.Now.Month)
select x).ToList();
if (pList.Count()>0)
@@ -255,10 +255,16 @@ namespace FineUIPro.Web.SES
string mailSubject = TemplateHelper.BulidByFile2(EmailName, myCol1);
result = MailHelper.SendPunishMail(pops, pops.EmailYx, mailTo, mailSubject, mailBody, mailAttch, mailCode, mailPriority, mailCC, pList, out resultMessage);
// 发送成功后写入表中
if (result == true)
{
//p.EmailIsSend = true;
//Funs.DB.SubmitChanges();
foreach (var p in pList)
{
var punish = BLL.PunishmentService.GetPunishmentById(p.PunishmentId);
punish.EmailIsSend = true;
Funs.DB.SubmitChanges();
}
ShowNotify("Email sent successfully!", MessageBoxIcon.Success);
}
else
@@ -494,26 +500,40 @@ namespace FineUIPro.Web.SES
if (reportModel.GetRow(i).GetCell(15) == null) reportModel.GetRow(i).CreateCell(15);
reportModel.GetRow(i).GetCell(15).SetCellValue(Grid1.Rows[i - 1].Values[16].ToString());
reportModel.GetRow(i).GetCell(15).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Violation Inspector
// BYC Resp Manager
if (reportModel.GetRow(i).GetCell(16) == null) reportModel.GetRow(i).CreateCell(16);
reportModel.GetRow(i).GetCell(16).SetCellValue(Grid1.Rows[i - 1].Values[17].ToString());
reportModel.GetRow(i).GetCell(16).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Inspection Department
// Violation Inspector
if (reportModel.GetRow(i).GetCell(17) == null) reportModel.GetRow(i).CreateCell(17);
reportModel.GetRow(i).GetCell(17).SetCellValue(Grid1.Rows[i - 1].Values[18].ToString());
reportModel.GetRow(i).GetCell(17).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Backcharge SES No.
// Inspection Department
if (reportModel.GetRow(i).GetCell(18) == null) reportModel.GetRow(i).CreateCell(18);
reportModel.GetRow(i).GetCell(18).SetCellValue(Grid1.Rows[i - 1].Values[19].ToString());
reportModel.GetRow(i).GetCell(18).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Backcharge Completion Date
// Backcharge SES No.
if (reportModel.GetRow(i).GetCell(19) == null) reportModel.GetRow(i).CreateCell(19);
if (Grid1.Rows[i - 1].Values[20] != null && Grid1.Rows[i - 1].Values[20].ToString() != "")
reportModel.GetRow(i).GetCell(19).SetCellValue(Grid1.Rows[i - 1].Values[20].ToString());
reportModel.GetRow(i).GetCell(19).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// Backcharge Completion Date
if (reportModel.GetRow(i).GetCell(20) == null) reportModel.GetRow(i).CreateCell(20);
if (Grid1.Rows[i - 1].Values[21] != null && Grid1.Rows[i - 1].Values[21].ToString() != "")
{
DateTime cdate = Convert.ToDateTime(Grid1.Rows[i - 1].Values[20]);
reportModel.GetRow(i).GetCell(19).SetCellValue(cdate.ToString("yyyy/MM/dd"));
reportModel.GetRow(i).GetCell(19).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
DateTime cdate = Convert.ToDateTime(Grid1.Rows[i - 1].Values[21]);
reportModel.GetRow(i).GetCell(20).SetCellValue(cdate.ToString("yyyy/MM/dd"));
reportModel.GetRow(i).GetCell(20).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
}
// Violation Related SES
if (reportModel.GetRow(i).GetCell(21) == null) reportModel.GetRow(i).CreateCell(21);
reportModel.GetRow(i).GetCell(21).SetCellValue(Grid1.Rows[i - 1].Values[22].ToString());
reportModel.GetRow(i).GetCell(21).CellStyle.SetFont(cs_content_Font);//将字体绑定到样式
// If send mail
if (reportModel.GetRow(i).GetCell(22) == null) reportModel.GetRow(i).CreateCell(22);
reportModel.GetRow(i).GetCell(22).SetCellValue(Grid1.Rows[i - 1].Values[23].ToString());
reportModel.GetRow(i).GetCell(22).CellStyle.SetFont(cs_content_Font);
#endregion
}
+8 -9
View File
@@ -13,7 +13,7 @@
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<f:FormRow >
<Items>
<f:DatePicker ID="txtPunishDate" runat="server" Label="Date" LabelAlign="Right" LabelWidth="160px" DateFormatString="yyyy-MM-dd" Required="true" ShowRedStar="true"></f:DatePicker>
<f:DatePicker ID="txtPunishTime" runat="server" Label="Time" LabelAlign="Right" LabelWidth="160px" DateFormatString="HH:mm" DisplayType="Time"></f:DatePicker>
@@ -95,25 +95,24 @@
</f:FormRow>
<f:FormRow >
<Items>
<f:GroupPanel ID="GPDep" Title="End UserBYC Resp. Dept.部门)填写" Layout="Table" runat="server">
<f:GroupPanel ID="GPDep" Title="End UserBYC Resp. Dept.部门)填写" Layout="Anchor" runat="server" >
<Items>
<f:Form ShowBorder="false" ShowHeader="false" runat="server" LabelAlign="Right" >
<f:Form ShowBorder="false" ShowHeader="false" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="50% 50%">
<f:FormRow ColumnWidths="45% 55%">
<Items>
<f:DropDownList ID="SelectYesNo" runat="server" LabelAlign="Right" Label="是否有关联SES" LabelWidth="170px" ShowRedStar="true">
<f:DropDownList ID="drpSelectYesNo" runat="server" LabelAlign="Right" Label="是否有关联SES" LabelWidth="160px" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="drpSelectYesNo_SelectedIndexChanged" ShowRedStar="true">
<f:ListItem Value="" Text="-请选择-" />
<f:ListItem Value="True" Text="是" />
<f:ListItem Value="False" Text="否" />
</f:DropDownList>
<f:TextBox ID="txtViolationRelatedSes" runat="server" Label="Violation Related SES" LabelAlign="Right" LabelWidth="230px" ShowRedStar="true">
<f:TextBox ID="txtViolationRelatedSes" runat="server" Label="Violation Related SES" LabelAlign="Right" LabelWidth="230px" Width="500px" >
</f:TextBox>
</Items>
</f:FormRow>
</Rows>
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="Def" runat="server" Label="描述" LabelWidth="170px" ></f:TextBox>
<f:TextBox ID="txtDef" runat="server" Label="描述" LabelWidth="160px"></f:TextBox>
</Items>
</f:FormRow>
</Rows>
+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;
+41 -39
View File
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.SES {
public partial class CSafePunishEdit {
namespace FineUIPro.Web.SES
{
public partial class CSafePunishEdit
{
/// <summary>
/// form1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtPunishDate 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPunishDate;
/// <summary>
/// txtPunishTime 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPunishTime;
/// <summary>
/// drpContractor 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpContractor;
/// <summary>
/// drpFO_No 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpFO_No;
/// <summary>
/// txtDiscispline 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDiscispline;
/// <summary>
/// txtLocation 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtLocation;
/// <summary>
/// txtDescription 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDescription;
/// <summary>
/// txtCompany 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtCompany;
/// <summary>
/// txtIndividual 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtIndividual;
/// <summary>
/// txtBackcharge 控件。
/// </summary>
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtBackcharge;
/// <summary>
/// drpViolationDegree 控件。
/// </summary>
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpViolationDegree;
/// <summary>
/// txtContractAdmin 控件。
/// </summary>
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtContractAdmin;
/// <summary>
/// txtMainCoordinator 控件。
/// </summary>
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMainCoordinator;
/// <summary>
/// txtMCDept 控件。
/// </summary>
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMCDept;
/// <summary>
/// txtUserRepresentative 控件。
/// </summary>
@@ -173,7 +175,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUserRepresentative;
/// <summary>
/// drpBYC_RU 控件。
/// </summary>
@@ -182,7 +184,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpBYC_RU;
/// <summary>
/// drpViolationInspector 控件。
/// </summary>
@@ -191,7 +193,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpViolationInspector;
/// <summary>
/// txtInspectionDep 控件。
/// </summary>
@@ -200,7 +202,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionDep;
/// <summary>
/// GPRole 控件。
/// </summary>
@@ -209,7 +211,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GPRole;
/// <summary>
/// txtSESNo 控件。
/// </summary>
@@ -218,7 +220,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSESNo;
/// <summary>
/// txtCompletionDate 控件。
/// </summary>
@@ -227,7 +229,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCompletionDate;
/// <summary>
/// GPDep 控件。
/// </summary>
@@ -236,16 +238,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GPDep;
/// <summary>
/// SelectYesNo 控件。
/// drpSelectYesNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList SelectYesNo;
protected global::FineUIPro.DropDownList drpSelectYesNo;
/// <summary>
/// txtViolationRelatedSes 控件。
/// </summary>
@@ -254,16 +256,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtViolationRelatedSes;
/// <summary>
/// Def 控件。
/// txtDef 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox Def;
protected global::FineUIPro.TextBox txtDef;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -272,7 +274,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -281,7 +283,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>