This commit is contained in:
2024-09-18 10:36:26 +08:00
parent 1ec4f71825
commit cba8e9e2f7
36 changed files with 4132 additions and 476 deletions
+21 -3
View File
@@ -33,6 +33,8 @@
</f:Button>
<f:Button ID="btnEdit" ToolTip="Modify" Text="Modify" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
</f:Button>
<f:Button ID="btnAudit" ToolTip="Audit" Text="Audit" Icon="Pencil" runat="server" OnClick="btnAudit_Click" >
</f:Button>
<f:Button ID="btnDelete" ToolTip="Delete" Text="Delete" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
runat="server" Hidden="true">
</f:Button>
@@ -56,6 +58,8 @@
<f:RenderField Width="130px" ColumnID="FO_NO" DataField="FO_NO"
SortField="FO_NO" FieldType="String" HeaderText="Contract No." HeaderTextAlign="Center">
</f:RenderField>
<f:RenderCheckField Width="80px" ColumnID="IsFrame" DataField="IsFrame" HeaderText="是否框架合同">
</f:RenderCheckField>
<f:RenderField Width="360px" ColumnID="Discipline" DataField="Discipline"
HeaderText="Discipline" HeaderTextAlign="Center" FieldType="String">
</f:RenderField>
@@ -65,9 +69,15 @@
<f:RenderField Width="180px" ColumnID="Location" DataField="Location"
FieldType="String" HeaderText="Location" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="ViolationPerson" DataField="ViolationPerson"
FieldType="String" HeaderText="Violation Person" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="Description" DataField="Description"
HeaderText="Violation Description" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="ClauseDef" DataField="ClauseDef"
HeaderText="Violation Clause" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="Company" DataField="Company"
FieldType="Float" HeaderText="Company</br>(RMB)" HeaderTextAlign="Center" RendererFunction="renderSalary">
</f:RenderField>
@@ -93,21 +103,29 @@
FieldType="String" HeaderText="User </br>Representative" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="BYCRU" DataField="BYCRU"
FieldType="String" HeaderText="BYC RU" HeaderTextAlign="Center">
FieldType="String" HeaderText="BYC Resp. Dept" 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>
<f:RenderField Width="100px" ColumnID="InspectionDep" DataField="InspectionDep"
FieldType="String" HeaderText="Inspection </br>Department" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="RequisitionerName" DataField="RequisitionerName"
FieldType="String" HeaderText="Requisitioner" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="SES_No" DataField="SES_No"
FieldType="String" HeaderText="Backcharge </br>SES No." HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="CompletionDate" DataField="CompletionDate"
FieldType="Date" Renderer="Date" HeaderText="Backcharge</br>Completion Date" HeaderTextAlign="Center">
</f:RenderField>
<f:TemplateField ColumnID="tfAttachUrl" HeaderText="附件查看" Width="300px" HeaderTextAlign="Center" TextAlign="Left">
<ItemTemplate>
<asp:LinkButton ID="lbtnUrl" runat="server" CommandArgument='<%# Bind("AttachUrl") %>'
ToolTip="附件查看" EnableAjax="false" Height="20px"></asp:LinkButton>
</ItemTemplate>
</f:TemplateField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -129,7 +147,7 @@
</f:Panel>
<f:Window ID="Window1" Title="Contractor Quality Punishment Edit" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="960px" Height="600px">
Width="1080px" Height="800px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
+238 -16
View File
@@ -9,6 +9,7 @@ using System.IO;
using System.Linq;
using System.Text;
using AspNet = System.Web.UI.WebControls;
using System.Web.UI.DataVisualization.Charting;
namespace FineUIPro.Web.SES
{
@@ -42,7 +43,7 @@ namespace FineUIPro.Web.SES
private void BindGrid()
{
string strSql = @"SELECT * FROM dbo.View_EMC_Punishment WHERE Flag='2' ";
string strSql = @"SELECT * FROM dbo.View_EMC_Que_Punishment WHERE Flag='2' ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtFO_NO.Text.Trim()))
@@ -50,7 +51,7 @@ namespace FineUIPro.Web.SES
strSql += " AND FO_NO LIKE @FO_NO";
listStr.Add(new SqlParameter("@FO_NO", "%" + this.txtFO_NO.Text.Trim() + "%"));
}
if (drpContractAdmin.SelectedValue != Const._Null)
if (drpContractAdmin.SelectedValue != Const._Null && drpContractAdmin.SelectedValue != null)
{
strSql += " AND Contract_AdminId = @Contract_AdminId";
listStr.Add(new SqlParameter("@Contract_AdminId", drpContractAdmin.SelectedValue));
@@ -73,6 +74,17 @@ namespace FineUIPro.Web.SES
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
System.Web.UI.WebControls.LinkButton lbtnUrl = ((System.Web.UI.WebControls.LinkButton)(Grid1.Rows[i].FindControl("lbtnUrl")));
string url = lbtnUrl.CommandArgument.ToString();
if (!string.IsNullOrEmpty(url))
{
url = url.Replace('\\', '/');
lbtnUrl.Text = BLL.UploadAttachmentService.ShowAttachment("../", url);
}
}
}
#region
@@ -88,8 +100,157 @@ namespace FineUIPro.Web.SES
Alert.ShowInParent("Please select at least one record!");
return;
}
string Id = Grid1.SelectedRowID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CQualityPunishEdit.aspx?punishmentId={0}", Id, "编辑 - ")));
string rowID = Grid1.SelectedRowID;
var pun = BLL.PunishmentService.GetPunishmentById(rowID);
if (pun != null)
{
if (pun.IsAudit == true)
{
if (CurrUser.UserId == pun.AuditMan)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CQualityPunishEdit.aspx?punishmentId={0}", rowID, "编辑 - ")));
}
else
{
ShowNotify("已批准!只有批准人有修改权限!", MessageBoxIcon.Warning);
}
}
else
{
if (pun.IsFrame == true)
{
var datas = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO);
if (CurrUser.UserId == datas.Main_Coordinator || CurrUser.UserId == pun.Violation_Inspector || CurrUser.UserId == Const.GlyId)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CQualityPunishEdit.aspx?punishmentId={0}", rowID, "编辑 - ")));
}
else
{
ShowNotify("只有主协调员,发起人(违章检查人)有修改权限!", MessageBoxIcon.Warning);
}
}
else
{
if (CurrUser.UserId == pun.Requisitioner || CurrUser.UserId == pun.Violation_Inspector || CurrUser.UserId == Const.GlyId)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CQualityPunishEdit.aspx?punishmentId={0}", rowID, "编辑 - ")));
}
else
{
ShowNotify("只有合同请购人,发起人(违章检查人)有修改权限!", MessageBoxIcon.Warning);
}
}
}
}
}
protected void btnAudit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInParent("Please select at least one record!");
return;
}
string rowID = Grid1.SelectedRowID;
var pun = BLL.PunishmentService.GetPunishmentById(rowID);
string auditMan=string.Empty;
if (pun != null)
{
if (pun.IsFrame == true)
{
var fc = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO);
string curUser = this.CurrUser.UserId; // 当前用户
string violationInspector = pun.Violation_Inspector; // 发起人
string leader = string.Empty; // 主协调员部门领导
string mainCoordinator = fc.Main_Coordinator;
var userInfo = BLL.Sys_UserService.GetUsersByUserId(fc.Main_Coordinator);
if (userInfo != null)
{
var dep = BLL.DepartService.GetDepartById(userInfo.DepartId);
if (dep != null)
{
leader = dep.DepartLeader;
}
}
// 当前用户不是主调协员
if (curUser != mainCoordinator)
{
// 当前用户是主调协员部门领导 不发邮件
if (curUser == leader)
{
auditMan = leader;
}
else if(curUser==Const.GlyId)
{
auditMan = Const.GlyId;
}
else
{
ShowNotify("您没有审核权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
else // 当前用户是主调协员
{
auditMan = mainCoordinator;
// 发邮件给主调协员部门领导
}
}
// 非框架合同
else
{
string curUser = this.CurrUser.UserId; // 当前用户
string violationInspector = pun.Violation_Inspector; // 发起人
string leader = string.Empty; // 请购人部门领导
string requisitioner = pun.Requisitioner; // 请购人
var userInfo = BLL.Sys_UserService.GetUsersByUserId(pun.Requisitioner);
if (userInfo != null)
{
var dep = BLL.DepartService.GetDepartById(userInfo.DepartId);
if (dep != null)
{
leader = dep.DepartLeader;
}
}
// 当前用户不是请购人
if (curUser != requisitioner)
{
// 当前用户是请购人部门领导 不发邮件
if (curUser == leader)
{
auditMan = leader;
}
else if (curUser == Const.GlyId)
{
auditMan = Const.GlyId;
}
else
{
ShowNotify("您没有审核权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
else // 当前用户是请购人
{
auditMan = requisitioner;
// 发邮件给请购人部门领导
}
}
if (auditMan != string.Empty)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CQualityPunishEdit.aspx?punishmentId={0}&auditMan={1}&audit=audit", rowID, auditMan, "编辑 - ")));
}
else
{
ShowNotify("您没有审核权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
}
@@ -140,20 +301,85 @@ namespace FineUIPro.Web.SES
/// </summary>
private void DeleteData()
{
if (Grid1.SelectedRowIndexArray.Length > 0)
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
string rowID = Grid1.SelectedRowID;
var pun = BLL.PunishmentService.GetPunishmentById(rowID);
if (pun != null)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var pun = BLL.PunishmentService.GetPunishmentById(rowID);
if (pun != null)
if (pun.IsFrame == true)
{
if (judgementDelete(rowID, false))
var datas = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO);
if (pun.IsAudit == true) // 审核后只有批准人可删除
{
BLL.PunishmentService.DeletePunishmentById(rowID);
if (CurrUser.UserId == pun.AuditMan)
{
if (judgementDelete(rowID, false))
{
BLL.PunishmentService.DeletePunishmentById(rowID);
}
}
else
{
ShowNotify("已批准!只有批准人有删除权限!", MessageBoxIcon.Warning);
return;
}
}
else
{
if (CurrUser.UserId == datas.Main_Coordinator || CurrUser.UserId == pun.Violation_Inspector || CurrUser.UserId == Const.GlyId)
{
if (judgementDelete(rowID, false))
{
BLL.PunishmentService.DeletePunishmentById(rowID);
}
}
else
{
ShowNotify("只有主协调员,发起人(违章检查人)有删除权限!", MessageBoxIcon.Warning);
return;
}
}
}
else
{
if (pun.IsAudit == true)
{
if (CurrUser.UserId == pun.AuditMan)
{
if (judgementDelete(rowID, false))
{
BLL.PunishmentService.DeletePunishmentById(rowID);
}
}
else
{
ShowNotify("已批准!只有批准人有删除权限!", MessageBoxIcon.Warning);
return;
}
}
else
{
if (CurrUser.UserId == pun.Requisitioner || CurrUser.UserId == pun.Violation_Inspector || CurrUser.UserId == Const.GlyId)
{
if (judgementDelete(rowID, false))
{
BLL.PunishmentService.DeletePunishmentById(rowID);
}
}
else
{
ShowNotify("只有合同请购人,发起人(违章检查人)有删除权限!", MessageBoxIcon.Warning);
return;
}
}
}
}
BindGrid();
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete Contractor Safety Punishment");
ShowNotify("Deleted successfully!");
@@ -194,11 +420,7 @@ namespace FineUIPro.Web.SES
private bool judgementDelete(string id, bool isShow)
{
string content = string.Empty;
//if (Funs.DB.Sys_User.FirstOrDefault(x => x.RoleId == id) != null)
//{
// content = "This role is already in use in [user information] and cannot be deleted!";
//}
if (string.IsNullOrEmpty(content))
{
return true;
+48 -28
View File
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.SES {
public partial class CQualityPunish {
namespace FineUIPro.Web.SES
{
public partial class CQualityPunish
{
/// <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>
/// Panel1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hdID 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdID;
/// <summary>
/// txtFO_NO 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtFO_NO;
/// <summary>
/// drpContractAdmin 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpContractAdmin;
/// <summary>
/// txtPunishDate 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPunishDate;
/// <summary>
/// btnSearch 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnNew 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnEdit 控件。
/// </summary>
@@ -128,7 +130,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEdit;
/// <summary>
/// btnAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnDelete 控件。
/// </summary>
@@ -137,7 +148,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// btnExport 控件。
/// </summary>
@@ -146,7 +157,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnExport;
/// <summary>
/// lblNumber 控件。
/// </summary>
@@ -155,7 +166,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblNumber;
/// <summary>
/// lbtnUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtnUrl;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@@ -164,7 +184,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@@ -173,7 +193,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@@ -182,7 +202,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@@ -191,7 +211,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
@@ -200,7 +220,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
@@ -209,7 +229,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>
@@ -218,7 +238,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
/// <summary>
/// btnMenuView 控件。
/// </summary>
+119 -31
View File
@@ -15,88 +15,172 @@
<Rows>
<f:FormRow>
<Items>
<f:DatePicker ID="txtPunishDate" runat="server" Label="Date" LabelAlign="Right" LabelWidth="160px" DateFormatString="yyyy-MM-dd"></f:DatePicker>
<f:DatePicker ID="txtPunishTime" runat="server" Label="Time" LabelAlign="Right" LabelWidth="160px" DateFormatString="HH:mm" DisplayType="Time"></f:DatePicker>
<f:DatePicker ID="txtPunishDate" runat="server" Label="Date" LabelAlign="Right" LabelWidth="180px" DateFormatString="yyyy-MM-dd" ShowRedStar="true" Required="true"></f:DatePicker>
<f:DatePicker ID="txtPunishTime" runat="server" Label="Time" LabelAlign="Right" LabelWidth="180px" DateFormatString="HH:mm" DisplayType="Time" ShowRedStar="true" Required="true"></f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="50% 23% 27%">
<Items>
<f:TextBox ID="txtFO_No" runat="server" Label="Contract No." LabelAlign="Right" LabelWidth="180px" ShowRedStar="true" Required="true" AutoPostBack="true" OnTextChanged="txtText_TextChanged"></f:TextBox>
<f:TextBox ID="txtItemNo" runat="server" Label="序号" LabelWidth="180px" Readonly="true" ></f:TextBox>
<f:RadioButtonList ID="rbIsFrame" runat="server" Label="Is Frame Contract" LabelAlign="Right" LabelWidth="160px" Readonly="true">
<f:RadioItem Text="是" Value="1" />
<f:RadioItem Text="否" Value="0" />
</f:RadioButtonList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpContractor" runat="server" Label="Contractor" EnableEdit="true" LabelAlign="Right" LabelWidth="160px" ShowRedStar="true" AutoPostBack="true" OnSelectedIndexChanged="drpContractor_SelectedIndexChanged">
</f:DropDownList>
<f:DropDownList ID="drpFO_No" runat="server" Label="Contract No." EnableEdit="true" LabelAlign="Right" LabelWidth="160px" ShowRedStar="true" AutoPostBack="true" OnSelectedIndexChanged="drpFO_No_SelectedIndexChanged"></f:DropDownList>
<f:TextBox ID="txtContractor" runat="server" Label="Contractor" LabelAlign="Right" LabelWidth="180px" ShowRedStar="true" Required="true">
</f:TextBox>
<f:TextBox ID="txtDiscispline" runat="server" Label="Discispline" LabelWidth="180px" ShowRedStar="true" Required="true"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtDiscispline" runat="server" Label="Discispline" LabelWidth="160px" Readonly="true"></f:TextBox>
<f:TextBox ID="txtLocation" runat="server" Label="Location" LabelAlign="Right" MaxLength="500" LabelWidth="160px">
<f:TextBox ID="txtLocation" runat="server" Label="Location" LabelAlign="Right" MaxLength="500" LabelWidth="180px" ShowRedStar="true" Required="true">
</f:TextBox>
<f:TextBox ID="txtViolationPerson" runat="server" Label="Violation Person" LabelAlign="Right" LabelWidth="180px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtDescription" runat="server" Label="Violation Description" LabelAlign="Right" MaxLength="500" LabelWidth="160px">
<f:TextBox ID="txtDescription" runat="server" Label="Violation Description" LabelAlign="Right" MaxLength="500" LabelWidth="180px" ShowRedStar="true" Required="true">
</f:TextBox>
<f:NumberBox ID="txtCompany" runat="server" Label="Company (RMB)" LabelAlign="Right" LabelWidth="160px" DecimalPrecision="2" AutoPostBack="true" OnTextChanged="txtPunish_OnTextChanged"></f:NumberBox>
<f:DropDownList ID="drpViolationClause" runat="server" Label="Violation Clause" EnableEdit="true" LabelAlign="Right" LabelWidth="180px" EnableGroup="true"
AutoPostBack="true" OnSelectedIndexChanged="drpViolationClause_OnSelectedIndexChanged" ShowRedStar="true" Required="true"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="txtIndividual" runat="server" Label="Individual (RMB)" LabelAlign="Right" DecimalPrecision="2" LabelWidth="160px" AutoPostBack="true" OnTextChanged="txtPunish_OnTextChanged"></f:NumberBox>
<f:NumberBox ID="txtBackcharge" runat="server" Label="Backcharge (RMB)" LabelAlign="Right" DecimalPrecision="2" LabelWidth="160px" Readonly="true"></f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpViolationDegree" runat="server" Label="Violation Degree" LabelAlign="Right" LabelWidth="160px">
<Items>
<f:DropDownList ID="drpViolationDegree" runat="server" Label="Violation Degree" LabelAlign="Right" LabelWidth="180px">
<f:ListItem Value="1" Text="一般违章" />
<f:ListItem Value="2" Text="严重违章" />
<f:ListItem Value="3" Text="零容忍违章" />
</f:DropDownList>
<f:TextBox ID="txtContractAdmin" runat="server" Label="Contract Admin" LabelAlign="Right" LabelWidth="160px" Readonly="true">
</f:TextBox>
<f:NumberBox ID="txtCompany" runat="server" Label="Company (RMB)" LabelAlign="Right" LabelWidth="180px" DecimalPrecision="2" AutoPostBack="true" OnTextChanged="txtPunish_OnTextChanged" ShowRedStar="true" Required="true"></f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="txtIndividual" runat="server" Label="Individual (RMB)" LabelAlign="Right" DecimalPrecision="2" LabelWidth="180px" AutoPostBack="true" OnTextChanged="txtPunish_OnTextChanged" ShowRedStar="true" Required="true"></f:NumberBox>
<f:NumberBox ID="txtBackcharge" runat="server" Label="Backcharge (RMB)" LabelAlign="Right" DecimalPrecision="2" LabelWidth="180px" Readonly="true"></f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtMainCoordinator" runat="server" Label="Main Coordinator" LabelAlign="Right" LabelWidth="160px" Readonly="true">
<f:TextBox ID="txtContractAdmin" runat="server" Label="Contract Admin" LabelAlign="Right" LabelWidth="180px" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtMCDept" runat="server" Label="M.C.Dept" LabelAlign="Right" LabelWidth="160px" Readonly="true">
<f:TextBox ID="txtMainCoordinator" runat="server" Label="Main Coordinator" LabelAlign="Right" LabelWidth="180px" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtMCDept" runat="server" Label="M.C.Dept" LabelAlign="Right" LabelWidth="180px" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtUserRepresentative" runat="server" Label="User Representative" LabelAlign="Right" LabelWidth="180px" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpViolationInspector" runat="server" Label="Violation Inspector" EnableEdit="true" EnableGroup="true" LabelAlign="Right" LabelWidth="180px"
Readonly="true"></f:DropDownList>
<f:TextBox ID="txtInspectionDep" runat="server" Label="Inspection Department" LabelAlign="Right" LabelWidth="180px" Readonly="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUserRepresentative" runat="server" Label="User Representative" LabelAlign="Right" LabelWidth="160px" Readonly="true">
<f:DropDownList ID="drpBYC_RU" runat="server" Label="BYC Resp. Dept" LabelAlign="Right" LabelWidth="180px" ShowRedStar="true" Required="true"></f:DropDownList>
<f:TextBox ID="txtViolationRelatedSes" runat="server" Label="Violation Related SES" LabelAlign="Right" LabelWidth="180px" >
</f:TextBox>
<f:DropDownList ID="drpBYC_RU" runat="server" Label="BYC RU" EnableGroup="true" EnableEdit="true" LabelAlign="Right" LabelWidth="160px"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpViolationInspector" runat="server" Label="Violation Inspector" EnableEdit="true" EnableGroup="true" LabelAlign="Right" LabelWidth="160px"
AutoPostBack="true" OnSelectedIndexChanged="drpViolationInspector_SelectedIndexChanged"></f:DropDownList>
<f:TextBox ID="txtInspectionDep" runat="server" Label="Inspection Department" LabelAlign="Right" LabelWidth="160px" Readonly="true">
</f:TextBox>
</Items>
<f:DropDownList ID="drpRequisitioner" runat="server" Label="Contract Requisitioner" EnableEdit="true" EnableGroup="true" LabelAlign="Right" LabelWidth="180px"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<f:FormRow>
<Items>
<f:Panel ID="Panel3" Width="500px" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server">
<Items>
<f:Label ID="lblAttach" runat="server" Label="Upload Attach" LabelAlign="Right" LabelWidth="180px">
</f:Label>
<f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="Upload File" runat="server" OnClick="btnAttach_Click">
</f:Button>
</Items>
</f:Panel>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:GroupPanel ID="GPRole" Title="由 Contract Administrator 角色填写" Layout="Table" runat="server" >
<Items>
<f:TextBox ID="txtSESNo" runat="server" Label="Backcharge SES No." LabelAlign="Right" LabelWidth="170px" Width="455px" ShowRedStar="true" >
<f:TextBox ID="txtSESNo" runat="server" Label="Backcharge SES No." LabelAlign="Right" LabelWidth="180px" Width="510px" ShowRedStar="true" >
</f:TextBox>
<f:DatePicker ID="txtCompletionDate" runat="server" Label="Backcharge Completion Date" LabelAlign="Right" LabelWidth="230px" Width="470px" ShowRedStar="true"></f:DatePicker>
</Items>
</f:GroupPanel>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:GroupPanel ID="GPDep" Title="End UserBYC Resp. Dept.部门)填写" Layout="Anchor" runat="server">
<Items>
<f:Form ShowBorder="false" ShowHeader="false" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtViolationRelatedSes1" runat="server" Label="Violation Related SES" LabelAlign="Right" LabelWidth="180px" Width="510px">
</f:TextBox>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:GroupPanel ID="GPAudit" Title="审核" Layout="Anchor" runat="server" Hidden="true">
<Items>
<f:Form ShowBorder="false" ShowHeader="false" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow ColumnWidths="33% 67%">
<Items>
<f:RadioButtonList ID="rbIsPass" runat="server" Label="审核结果" LabelWidth="140px" Width="240px">
<f:RadioItem Value="1" Text="通过" Selected="true" />
<f:RadioItem Value="0" Text="拒绝" />
</f:RadioButtonList>
<f:Label runat="server"></f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtAuditResult" runat="server" Label="通过/拒绝描述" LabelWidth="140px"></f:TextBox>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:GroupPanel>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdId" runat="server"></f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="Save" ToolTip="Save" ValidateForms="SimpleForm1"
OnClick="btnSave_Click" Hidden="true">
</f:Button>
@@ -107,5 +191,9 @@
</Toolbars>
</f:Form>
</form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</body>
</html>
+567 -56
View File
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using BLL.Common;
using Model;
namespace FineUIPro.Web.SES
{
@@ -17,6 +21,11 @@ namespace FineUIPro.Web.SES
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string view = Request.Params["view"];
string audit = Request.Params["audit"];
if (!string.IsNullOrEmpty(audit))
{
GPAudit.Hidden = false;
}
if (view == "1")
{
this.btnSave.Hidden = true;
@@ -42,30 +51,28 @@ namespace FineUIPro.Web.SES
txtCompletionDate.Enabled = false;
}
BLL.ViolationClauseService.InitViolationClause(this.drpViolationClause, true);//违章条款
//BLL.SESRelatedDataService.InitFONoDropDownList(this.drpFO_No, true);//合同号
BLL.ContractorService.InitDropDownList(drpContractor, true); //承包商;
//BLL.ContractorService.InitDropDownList(drpContractor, true); //承包商;
BLL.DepartService.InitDropDownList(this.drpBYC_RU, true);//BYC负责部门
BLL.Sys_UserService.InitUserDropDownList(this.drpViolationInspector, true);//违章检查人
//BLL.Sys_UserService.InitUserDropDownList(this.drpBYC_Person, true);//
BLL.Sys_UserService.InitUserDropDownList(this.drpRequisitioner, true);//合同请购人
string punishmentId = Request.Params["punishmentId"];
if (!string.IsNullOrEmpty(punishmentId))
{
Model.View_EMC_Punishment punishment = BLL.PunishmentService.GetPunishmentViewById(punishmentId);
Model.View_EMC_Que_Punishment punishment = BLL.PunishmentService.GetQuePunishmentViewById(punishmentId);
Model.EMC_Punishment pun = BLL.PunishmentService.GetPunishmentById(punishmentId);
if (punishment != null)
if (punishment != null && pun!=null)
{
this.txtPunishDate.Text = punishment.PunishDate != null ? string.Format("{0:yyyy-MM-dd}", punishment.PunishDate) : "";
this.txtPunishTime.Text = punishment.PunishDate != null ? punishment.PunishDate.Value.ToShortTimeString() : "";
this.txtFO_No.Text = punishment.FO_NO;
txtItemNo.Text = pun.ItemNo;
txtContractor.Text = punishment.Contractor;
txtDiscispline.Text = punishment.Discipline;
if (!string.IsNullOrEmpty(punishment.ContractorId))
{
this.drpContractor.SelectedValue = punishment.ContractorId;
BLL.SESRelatedDataService.InitFONoDropDownList(this.drpFO_No, drpContractor.SelectedValue, true);//合同号
this.drpFO_No.SelectedValue = punishment.FO_NO;
}
this.txtDiscispline.Text = punishment.Discipline;
this.txtLocation.Text = punishment.Location;
this.txtDescription.Text = punishment.Description;
@@ -73,7 +80,7 @@ namespace FineUIPro.Web.SES
this.txtIndividual.Text = punishment.Individual.HasValue ? punishment.Individual.ToString() : "";
this.txtBackcharge.Text = punishment.Backcharge.HasValue ? punishment.Backcharge.Value.ToString("0.00") : "";
if (pun != null && !string.IsNullOrEmpty(pun.ViolationDegree))
if (!string.IsNullOrEmpty(pun.ViolationDegree))
{
drpViolationDegree.SelectedValue = pun.ViolationDegree;
}
@@ -93,14 +100,78 @@ namespace FineUIPro.Web.SES
string depName = BLL.DepartService.GetDepartNameById(user.DepartId);
txtInspectionDep.Text = depName;
}
if (pun.IsFrame == true)
{
rbIsFrame.SelectedValue = "1";
}
else
{
rbIsFrame.SelectedValue = "0";
}
if (!string.IsNullOrEmpty(pun.ViolationClauseId))
{
drpViolationClause.SelectedValue = pun.ViolationClauseId;
}
txtViolationPerson.Text = pun.ViolationPerson;
if (!string.IsNullOrEmpty(punishment.Requisitioner))
{
drpRequisitioner.SelectedValue = punishment.Requisitioner;
}
if (pun.IsFrame == true && (this.CurrUser.DepartId == punishment.BYC_RU || this.CurrUser.Account == Const.Gly))
{
GPDep.Hidden= false;
}
else
{
GPDep.Hidden = true;
}
this.txtCompletionDate.Text = punishment.CompletionDate != null ? string.Format("{0:yyyy-MM-dd}", punishment.CompletionDate) : "";
this.txtSESNo.Text = punishment.SES_No;
txtViolationRelatedSes.Text = punishment.ViolationRelatedSes;
txtViolationRelatedSes1.Text = punishment.ViolationRelatedSes;
hdId.Text = punishmentId;
// 审核
if (pun.IsPass != null)
{
if (pun.IsPass == true)
{
rbIsPass.SelectedValue = "1";
}
else
{
rbIsPass.SelectedValue = "0";
}
}
txtAuditResult.Text = pun.AuditResult;
if (punishment.IsFrame == true)
{
txtDiscispline.Readonly = true;
drpRequisitioner.Hidden = true;
}
else
{
txtDiscispline.Readonly = false;
txtContractAdmin.Hidden = true;
txtMainCoordinator.Hidden = true;
txtUserRepresentative.Hidden = true;
txtMCDept.Hidden = true;
drpBYC_RU.Hidden = true;
GPRole.Hidden = true;
}
}
}
else
{
this.drpViolationInspector.SelectedValue = CurrUser.UserId;
string depName = BLL.DepartService.GetDepartNameById(CurrUser.DepartId);
txtInspectionDep.Text = depName;
}
}
}
@@ -115,19 +186,9 @@ namespace FineUIPro.Web.SES
protected void btnSave_Click(object sender, EventArgs e)
{
string punishmentId = Request.Params["punishmentId"];
string audit = Request.Params["audit"];
Model.EMC_Punishment punishment = new Model.EMC_Punishment();
if (this.drpContractor.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("Please select Contractor!", MessageBoxIcon.Warning);
return;
}
if (this.drpFO_No.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("Please select Contract No.!", MessageBoxIcon.Warning);
return;
}
if (punishmentId == null)
{
punishmentId = string.Empty;
@@ -138,12 +199,19 @@ namespace FineUIPro.Web.SES
return;
}
if (drpViolationClause.SelectedValue == Const._Null)
{
Alert.ShowInTop("Please select Violation Clause!", MessageBoxIcon.Warning);
return;
}
punishment.PunishDate = Funs.GetNewDateTime(this.txtPunishDate.Text.Trim() + " " + txtPunishTime.Text.Trim());
punishment.FO_NO = drpFO_No.SelectedValue;
punishment.FO_NO = txtFO_No.Text.Trim(); //drpFO_No.SelectedValue;
if (txtSESNo.Text.Trim() != string.Empty)
{
punishment.SES_No = txtSESNo.Text.Trim();
}
punishment.ItemNo = txtItemNo.Text.Trim();
punishment.Location = txtLocation.Text.Trim();
punishment.Description = txtDescription.Text.Trim();
if (txtCompany.Text != string.Empty)
@@ -166,60 +234,486 @@ namespace FineUIPro.Web.SES
punishment.CompletionDate = Funs.GetNewDateTime(this.txtCompletionDate.Text.Trim());
punishment.Flag = "2";
if (!string.IsNullOrEmpty(punishmentId))
punishment.Contractor=txtContractor.Text.Trim();
punishment.Discipline=txtDiscispline.Text.Trim();
punishment.ViolationClauseId = drpViolationClause.SelectedValue;
if (rbIsFrame.SelectedValue == "1")
{
punishment.PunishmentId = punishmentId;
BLL.PunishmentService.UpdatePunishment(punishment);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Contractor Quality Punishment!");
ShowNotify("Save successfully!", MessageBoxIcon.Success);
punishment.IsFrame = true;
}
else
{
punishment.PunishmentId = SQLHelper.GetNewID(typeof(Model.EMC_Punishment));
BLL.PunishmentService.AddPunishment(punishment);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Contractor Quality Punishment!");
punishment.IsFrame=false;
}
punishment.ViolationPerson=txtViolationPerson.Text.Trim();
if (drpRequisitioner.SelectedValue != Const._Null)
{
punishment.Requisitioner = drpRequisitioner.SelectedValue;
}
if (!string.IsNullOrEmpty(txtViolationRelatedSes1.Text))
{
punishment.ViolationRelatedSes = txtViolationRelatedSes1.Text.Trim();
}
else if (!string.IsNullOrEmpty(txtViolationRelatedSes.Text))
{
punishment.ViolationRelatedSes = txtViolationRelatedSes.Text.Trim();
}
// 保存
if (string.IsNullOrEmpty(audit))
{
if (!string.IsNullOrEmpty(punishmentId))
{
punishment.PunishmentId = punishmentId;
var att = from x in Funs.DB.AttachFile where x.ToKeyId == punishmentId select x;
if (att.Count() > 0)
{
punishment.AttachUrl = att.First().AttachUrl;
}
BLL.PunishmentService.UpdatePunishment(punishment);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Contractor Quality Punishment!");
}
else
{
if (!string.IsNullOrEmpty(this.hdId.Text))
{
punishment.PunishmentId = this.hdId.Text.Trim();
}
else
{
punishment.PunishmentId = SQLHelper.GetNewID(typeof(Model.EMC_Punishment));
this.hdId.Text = punishment.PunishmentId;
}
var att = from x in Funs.DB.AttachFile where x.ToKeyId == punishment.PunishmentId select x;
if (att.Count() > 0)
{
punishment.AttachUrl = att.First().AttachUrl;
}
punishment.CreateDate = DateTime.Now;
BLL.PunishmentService.AddPunishment(punishment);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Contractor Quality Punishment!");
}
#region
var pun = BLL.PunishmentService.GetPunishmentById(punishment.PunishmentId);
string auditMan = string.Empty;
if (pun != null)
{
if (pun.IsFrame == true)
{
var fc = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(pun.FO_NO);
string curUser = this.CurrUser.UserId; // 当前用户
string violationInspector = pun.Violation_Inspector; // 发起人
string leader = string.Empty; // 主协调员部门领导
string mainCoordinator = fc.Main_Coordinator;
var userInfo = BLL.Sys_UserService.GetUsersByUserId(fc.Main_Coordinator);
if (userInfo != null)
{
var dep = BLL.DepartService.GetDepartById(userInfo.DepartId);
if (dep != null)
{
leader = dep.DepartLeader;
}
}
// 当前用户不是主调协员
if (curUser != mainCoordinator)
{
// 当前用户不是主调协员部门领导 发邮件给主调协员
if (curUser != leader)
{
auditMan = mainCoordinator;
}
}
else // 当前用户是主调协员
{
// 该主调协员不是部门领导时发邮件
if (curUser != leader)
{
auditMan = leader;
}
}
}
// 非框架合同
else
{
string curUser = this.CurrUser.UserId; // 当前用户
string violationInspector = pun.Violation_Inspector; // 发起人
string leader = string.Empty; // 请购人部门领导
string requisitioner = pun.Requisitioner; // 请购人
var userInfo = BLL.Sys_UserService.GetUsersByUserId(pun.Requisitioner);
if (userInfo != null)
{
var dep = BLL.DepartService.GetDepartById(userInfo.DepartId);
if (dep != null)
{
leader = dep.DepartLeader;
}
}
// 当前用户不是请购人
if (curUser != requisitioner)
{
// 当前用户是请购人部门领导 不发邮件
if (curUser != leader)
{
auditMan = requisitioner;
}
}
else // 当前用户是请购人
{
if (curUser != leader)
{
auditMan = leader;
}
}
}
}
if (pun.EmailIsSend == null || pun.EmailIsSend == false)
{
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 == auditMan
&& 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("ContractNo", pun.FO_NO);
myPram.Add("Contractor", txtContractor.Text);
myPram.Add("编号", pun.FO_NO + "-" + pun.ItemNo);
myPram.Add("Date", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
myPram.Add("Time", pun.PunishDate != null ? pun.PunishDate.Value.ToString("HH:mm") : "");
myPram.Add("Violation Description", pun.Description);
bool result = MailHelper.SendPunishSesMail(pops, myPram, "承包商质量违规审核通知", mailTo, mailCC, out resultMessage);
if (result)
{
pun.EmailIsSend = true;
Funs.DB.SubmitChanges();
}
}
}
}
#endregion
ShowNotify("Save successfully!", MessageBoxIcon.Success);
}
// 审核
else
{
var pun = BLL.PunishmentService.GetPunishmentById(punishmentId);
if (pun.AuditEmailIsSend == null || pun.AuditEmailIsSend == false)
{
// 发起人即违章检查人
string createMan = pun.Violation_Inspector;
string auditMan = Request.Params["auditMan"];
pun.AuditMan = auditMan;
pun.IsAudit = true;
if (rbIsPass.SelectedValue == "1")
{
pun.IsPass = true;
}
else
{
pun.IsPass = false;
}
pun.AuditResult = txtAuditResult.Text.Trim();
// 发邮件
#region
if (rbIsPass.SelectedValue != null)
{
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 = "";
bool result = false;
// 承包商质量违规审核通过
if (rbIsPass.SelectedValue == "1")
{
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 == createMan || x.Account == "suny2")
&& 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("ContractNo", pun.FO_NO);
myPram.Add("Contractor", txtContractor.Text);
myPram.Add("编号", pun.FO_NO + "-" + pun.ItemNo);
myPram.Add("Date", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
myPram.Add("Time", pun.PunishDate != null ? pun.PunishDate.Value.ToString("HH:mm") : "");
myPram.Add("Violation Description", pun.Description);
result = MailHelper.SendPunishSesMail(pops, myPram, "承包商质量违规审核通过", mailTo, mailCC, out resultMessage);
}
}
if (result)
{
pun.AuditEmailIsSend = true;
}
}
// 承包商质量违规审核被拒绝
else
{
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 == createMan
&& 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("ContractNo", pun.FO_NO);
myPram.Add("Contractor", txtContractor.Text);
myPram.Add("编号", pun.FO_NO + "-" + pun.ItemNo);
myPram.Add("Date", pun.PunishDate != null ? pun.PunishDate.Value.ToString("yyyy-MM-dd") : "");
myPram.Add("Time", pun.PunishDate != null ? pun.PunishDate.Value.ToString("HH:mm") : "");
myPram.Add("Violation Description", pun.Description);
myPram.Add("拒绝描述", txtAuditResult.Text.Trim());
result = MailHelper.SendPunishSesMail(pops, myPram, "承包商质量违规审核被拒绝", mailTo, mailCC, out resultMessage);
}
}
if (result)
{
pun.AuditEmailIsSend = true;
}
}
}
#endregion
#region ViolationRelatedSes为空时发送邮件提醒BYC Resp. Dept的部门经理
if (rbIsPass.SelectedValue == "1")
{
var vses = (from x in Funs.DB.EMC_Punishment
where x.PunishmentId == punishmentId
&& x.IsFrame == true
&& x.BYC_RU != null && x.BYC_RU.ToUpper() != "NA"
&& (x.ViolationRelatedSes == "" || x.ViolationRelatedSes == null)
//x.Flag == "2"
//&& (x.RelatedSesMailIsSend == null || x.RelatedSesMailIsSend == false)
select x).ToList();
if (vses.Count() > 0)
{
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
if (pops == null)
{
return;
}
foreach (var ses in vses)
{
string[] mailTo = null;
string[] mailCC = null;
string resultMessage = "";
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("承包商质量违规关联SES号的填写通知"));
if (emailTemplate.Count() > 0)
{
var dep = BLL.DepartService.GetDepartById(ses.BYC_RU);
if (dep != null && !string.IsNullOrEmpty(dep.DepartLeader))
{
var userTo = from x in Funs.DB.Sys_User
where x.UserId == dep.DepartLeader
&& 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("ContractNo", ses.FO_NO);
myPram.Add("Contractor", ses.Contractor);
myPram.Add("Date", ses.PunishDate != null ? ses.PunishDate.Value.ToString("yyyy-MM-dd") : "");
myPram.Add("Time", ses.PunishDate != null ? ses.PunishDate.Value.ToString("HH:mm") : "");
myPram.Add("Violation Description", ses.Description);
bool result = MailHelper.SendPunishSesMail(pops, myPram, "承包商质量违规关联SES号的填写通知", mailTo, mailCC, out resultMessage);
if (result)
{
ses.RelatedSesMailIsSend = true;
Funs.DB.SubmitChanges();
}
}
}
}
}
}
}
#endregion
Funs.DB.SubmitChanges();
}
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
protected void drpContractor_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpContractor.SelectedValue != BLL.Const._Null)
{
this.drpFO_No.Items.Clear();
BLL.SESRelatedDataService.InitFONoDropDownList(this.drpFO_No, drpContractor.SelectedValue, true);//合同号
drpFO_No.SelectedValue = BLL.Const._Null;
txtDiscispline.Text = string.Empty;
}
}
protected void drpFO_No_SelectedIndexChanged(object sender, EventArgs e)
protected void txtText_TextChanged(object sender, EventArgs e)
{
if (drpFO_No.SelectedValue != Const._Null)
if (!string.IsNullOrEmpty(txtFO_No.Text))
{
string foNO = drpFO_No.SelectedValue;
string foNO = txtFO_No.Text.Trim();
Model.View_FC_SESRelatedData fc = BLL.SESRelatedDataService.GetSESRelatedDataViewByFO(foNO);
if (fc != null)
{
{
txtContractor.Text = fc.Contractor;
txtDiscispline.Text = fc.Discipline;
txtContractAdmin.Text = fc.Contract_Admin;
txtMainCoordinator.Text = fc.Main_Coordinator;
txtUserRepresentative.Text = fc.User_Representative;
txtMCDept.Text = fc.MCDept;
txtContractAdmin.Hidden = false;
txtMainCoordinator.Hidden = false;
txtUserRepresentative.Hidden = false;
txtMCDept.Hidden = false;
drpBYC_RU.Hidden = false;
GPRole.Hidden = false;
drpRequisitioner.Hidden = true;
txtViolationRelatedSes.Hidden = false;
GPDep.Hidden = false;
txtDiscispline.Readonly = true;
drpRequisitioner.Required= false;
drpRequisitioner.ShowRedStar = false;
rbIsFrame.SelectedValue = "1";
}
else
{
txtDiscispline.Text = string.Empty;
txtContractor.Text = string.Empty;
txtContractAdmin.Text = string.Empty;
txtMainCoordinator.Text = string.Empty;
txtUserRepresentative.Text = string.Empty;
txtMCDept.Text = string.Empty;
txtDiscispline.Readonly = false;
txtContractAdmin.Hidden = true;
txtMainCoordinator.Hidden = true;
txtUserRepresentative.Hidden = true;
txtMCDept.Hidden = true;
drpBYC_RU.Hidden = true;
GPRole.Hidden = true;
rbIsFrame.SelectedValue = "0";
drpRequisitioner.Required = true;
drpRequisitioner.ShowRedStar = true;
txtViolationRelatedSes.Hidden = true;
GPDep.Hidden = true;
}
// 序号
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";
}
}
}
}
protected void drpViolationInspector_SelectedIndexChanged(object sender, EventArgs e)
//protected void drpViolationInspector_SelectedIndexChanged(object sender, EventArgs e)
//{
// if (drpViolationInspector.SelectedValue != Const._Null)
// {
// string manId = drpViolationInspector.SelectedValue;
// var user = BLL.Sys_UserService.GetUsersByUserId(manId);
// string depName = BLL.DepartService.GetDepartNameById(user.DepartId);
// txtInspectionDep.Text = depName;
// }
//}
protected void drpViolationClause_OnSelectedIndexChanged(object sender, EventArgs e)
{
if (drpViolationInspector.SelectedValue != Const._Null)
{
string manId = drpViolationInspector.SelectedValue;
var user = BLL.Sys_UserService.GetUsersByUserId(manId);
string depName = BLL.DepartService.GetDepartNameById(user.DepartId);
txtInspectionDep.Text = depName;
if (drpViolationClause.SelectedValue != Const._Null)
{
var vio=BLL.ViolationClauseService.GetViolationClause(drpViolationClause.SelectedValue);
if (vio.DeductionComPany1 != 0)
{
drpViolationDegree.SelectedValue = "1";
txtCompany.Text = vio.DeductionComPany1.ToString();
txtIndividual.Text = vio.DeductionIndividual1.ToString();
txtBackcharge.Text = (vio.DeductionComPany1 + vio.DeductionIndividual1).ToString();
}
if (vio.DeductionComPany2 != 0)
{
drpViolationDegree.SelectedValue = "2";
txtCompany.Text = vio.DeductionComPany2.ToString();
txtIndividual.Text = vio.DeductionIndividual2.ToString();
txtBackcharge.Text = (vio.DeductionComPany2 + vio.DeductionIndividual2).ToString();
}
if (vio.DeductionComPany3 != 0)
{
drpViolationDegree.SelectedValue = "3";
txtCompany.Text = vio.DeductionComPany3.ToString();
txtIndividual.Text = vio.DeductionIndividual3.ToString();
txtBackcharge.Text = (vio.DeductionComPany2 + vio.DeductionIndividual3).ToString();
}
}
}
@@ -239,6 +733,23 @@ namespace FineUIPro.Web.SES
txtBackcharge.Text = (numCompany + numIndividual).Value.ToString("0.00");
}
#region
/// <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));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader2.aspx?type=0&toKeyId={0}&path=FileUpload/SES/EMC_Punishment&menuId={1}", this.hdId.Text, BLL.Const.CQualityPunishMenuId)));
}
#endregion
#region
/// <summary>
/// 菜单按钮权限
+207 -61
View File
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.SES {
public partial class CQualityPunishEdit {
namespace FineUIPro.Web.SES
{
public partial class CQualityPunishEdit
{
/// <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,25 +58,43 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPunishTime;
/// <summary>
/// drpContractor 控件。
/// txtFO_No 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpContractor;
protected global::FineUIPro.TextBox txtFO_No;
/// <summary>
/// drpFO_No 控件。
/// txtItemNo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpFO_No;
protected global::FineUIPro.TextBox txtItemNo;
/// <summary>
/// rbIsFrame 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbIsFrame;
/// <summary>
/// txtContractor 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtContractor;
/// <summary>
/// txtDiscispline 控件。
/// </summary>
@@ -83,7 +103,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDiscispline;
/// <summary>
/// txtLocation 控件。
/// </summary>
@@ -92,7 +112,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtLocation;
/// <summary>
/// txtViolationPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtViolationPerson;
/// <summary>
/// txtDescription 控件。
/// </summary>
@@ -101,34 +130,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDescription;
/// <summary>
/// txtCompany 控件。
/// drpViolationClause 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtCompany;
/// <summary>
/// txtIndividual 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtIndividual;
/// <summary>
/// txtBackcharge 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtBackcharge;
protected global::FineUIPro.DropDownList drpViolationClause;
/// <summary>
/// drpViolationDegree 控件。
/// </summary>
@@ -137,7 +148,34 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpViolationDegree;
/// <summary>
/// txtCompany 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtCompany;
/// <summary>
/// txtIndividual 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtIndividual;
/// <summary>
/// txtBackcharge 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtBackcharge;
/// <summary>
/// txtContractAdmin 控件。
/// </summary>
@@ -146,7 +184,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtContractAdmin;
/// <summary>
/// txtMainCoordinator 控件。
/// </summary>
@@ -155,7 +193,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMainCoordinator;
/// <summary>
/// txtMCDept 控件。
/// </summary>
@@ -164,7 +202,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMCDept;
/// <summary>
/// txtUserRepresentative 控件。
/// </summary>
@@ -173,16 +211,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUserRepresentative;
/// <summary>
/// drpBYC_RU 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpBYC_RU;
/// <summary>
/// drpViolationInspector 控件。
/// </summary>
@@ -191,7 +220,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpViolationInspector;
/// <summary>
/// txtInspectionDep 控件。
/// </summary>
@@ -200,7 +229,61 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionDep;
/// <summary>
/// drpBYC_RU 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpBYC_RU;
/// <summary>
/// txtViolationRelatedSes 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtViolationRelatedSes;
/// <summary>
/// drpRequisitioner 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpRequisitioner;
/// <summary>
/// Panel3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel3;
/// <summary>
/// lblAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblAttach;
/// <summary>
/// btnAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// GPRole 控件。
/// </summary>
@@ -209,7 +292,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GPRole;
/// <summary>
/// txtSESNo 控件。
/// </summary>
@@ -218,7 +301,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSESNo;
/// <summary>
/// txtCompletionDate 控件。
/// </summary>
@@ -227,7 +310,52 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCompletionDate;
/// <summary>
/// GPDep 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GPDep;
/// <summary>
/// txtViolationRelatedSes1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtViolationRelatedSes1;
/// <summary>
/// GPAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupPanel GPAudit;
/// <summary>
/// rbIsPass 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbIsPass;
/// <summary>
/// txtAuditResult 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtAuditResult;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -236,7 +364,16 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdId;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -245,7 +382,7 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
@@ -254,5 +391,14 @@ namespace FineUIPro.Web.SES {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}
+75 -52
View File
@@ -302,7 +302,6 @@ namespace FineUIPro.Web.SES
punishment.PunishmentId = PunishmentId;
BLL.PunishmentService.UpdatePunishment(punishment);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Contractor Safety Punishment!");
ShowNotify("Save successfully!", MessageBoxIcon.Success);
}
else
{
@@ -310,59 +309,83 @@ namespace FineUIPro.Web.SES
punishment.PunishmentId = PunishmentId;
punishment.CreateDate = DateTime.Now;
BLL.PunishmentService.AddPunishment(punishment);
#region EHSS违规关联SES号的填写通知 Golbal里触发
//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("承包商EHSS违规关联SES号的填写通知"));
//if (emailTemplate.Count() > 0)
//{
// var dep = BLL.DepartService.GetDepartById(drpBYC_RU.SelectedValue);
// if (dep != null && !string.IsNullOrEmpty(dep.DepartLeader))
// {
// var userTo = from x in Funs.DB.Sys_User
// where x.UserId == dep.DepartLeader
// && x.Email != null && x.Email != ""
// select x;
// if (userTo != null)
// {
// mailTo = userTo.Select(x => x.Email).ToArray();
// }
// var fo = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(drpFO_No.SelectedValue);
// if (fo != null)
// {
// var userCC = from x in Funs.DB.Sys_User
// where (x.UserId == fo.Contract_Admin || x.UserId == fo.Main_Coordinator)
// && x.Email != null && x.Email != ""
// select x;
// mailCC = userCC.Select(x => x.Email).Distinct().ToArray();
// }
// if (mailTo.Length > 0)
// {
// NameValueCollection myPram = new NameValueCollection();
// myPram.Add("ContractNo", fo.FO_NO);
// myPram.Add("Contractor", drpContractor.SelectedText);
// myPram.Add("Date", punishment.PunishDate != null ? punishment.PunishDate.Value.ToString("yyyy-MM-dd") : "");
// myPram.Add("Time", punishment.PunishDate != null ? punishment.PunishDate.Value.ToString("HH:mm") : "");
// myPram.Add("Violation Description", punishment.Description);
// MailHelper.SendPunishSesMail(pops, myPram, "承包商EHSS违规关联SES号的填写通知", mailTo, mailCC, out resultMessage);
// }
// }
//}
#endregion
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Contractor Safety Punishment!");
ShowNotify("Save successfully!", MessageBoxIcon.Success);
}
#region EHSS违规关联SES号的填写通知
var vses = (from x in Funs.DB.EMC_Punishment
where (x.RelatedSesMailIsSend == null || x.RelatedSesMailIsSend == false)
&& x.BYC_RU != null && x.BYC_RU.ToUpper() != "NA" && x.Flag == "1"
&& x.PunishmentId== punishment.PunishmentId
select x).ToList();
if (vses.Count() > 0)
{
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
if (pops == null)
{
return;
}
foreach (var ses in vses)
{
string[] mailTo = null;
string[] mailCC = null;
string resultMessage = "";
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("承包商EHSS违规关联SES号的填写通知"));
if (emailTemplate.Count() > 0)
{
var dep = BLL.DepartService.GetDepartById(ses.BYC_RU);
if (dep != null && !string.IsNullOrEmpty(dep.DepartLeader))
{
var userTo = from x in Funs.DB.Sys_User
where x.UserId == dep.DepartLeader
&& x.Email != null && x.Email != ""
select x;
if (userTo != null)
{
mailTo = userTo.Select(x => x.Email).ToArray();
}
string contractor = string.Empty;
var fo = BLL.SESRelatedDataService.GetSESRelatedDataByFoNo(ses.FO_NO);
if (fo != null)
{
var userCC = from x in Funs.DB.Sys_User
where (x.UserId == fo.Contract_Admin || x.UserId == fo.Main_Coordinator)
&& x.Email != null && x.Email != ""
select x;
mailCC = userCC.Select(x => x.Email).Distinct().ToArray();
var con = Funs.DB.View_Contractor_DropDownValue.FirstOrDefault(x => x.ContractorId == fo.Contractor);
if (con != null)
{
contractor = con.Contractor;
}
}
if (mailTo.Length > 0)
{
NameValueCollection myPram = new NameValueCollection();
myPram.Add("ContractNo", fo.FO_NO);
myPram.Add("Contractor", contractor);
myPram.Add("Date", ses.PunishDate != null ? ses.PunishDate.Value.ToString("yyyy-MM-dd") : "");
myPram.Add("Time", ses.PunishDate != null ? ses.PunishDate.Value.ToString("HH:mm") : "");
myPram.Add("Violation Description", ses.Description);
bool result = MailHelper.SendPunishSesMail(pops, myPram, "承包商EHSS违规关联SES号的填写通知", mailTo, mailCC, out resultMessage);
if (result)
{
ses.RelatedSesMailIsSend = true;
Funs.DB.SubmitChanges();
}
}
}
}
}
}
#endregion
ShowNotify("Save successfully!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
+4 -4
View File
@@ -90,17 +90,17 @@
LabelAlign="Right">
</f:DropDownList>
<f:Button ID="btnNCRExport" OnClick="btnNCRExport_Click" runat="server" Text="Export" ToolTip="Export"
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false">
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
</f:Button>
<f:Button ID="btnExport" OnClick="btnExport_Click" runat="server" Text="FCExport" ToolTip="FCExport"
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false">
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
</f:Button>
<f:Button ID="btnExport1" OnClick="btnExport1_Click" runat="server" Text="PersonExport" ToolTip="PersonExport"
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false">
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
</f:Button>
<f:Button ID="btnFoExport" OnClick="btnFoExport_Click" runat="server" Text="FoExport" ToolTip="FO Report Export"
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false">
Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
</f:Button>
</Items>
@@ -2034,9 +2034,21 @@ namespace FineUIPro.Web.SES
#endregion
if (buttonList.Contains(BLL.Const.BtnOut))
{
this.btnNCRExport.Hidden = false;
}
if (buttonList.Contains(BLL.Const.FCExport))
{
this.btnExport.Hidden = false;
}
if (buttonList.Contains(BLL.Const.PersonExport))
{
this.btnExport1.Hidden = false;
}
if (buttonList.Contains(BLL.Const.FoExport))
{
this.btnFoExport.Hidden = false;
}
}
}
#endregion
@@ -30,7 +30,7 @@ namespace FineUIPro.Web.SES
{
this.tvStandardTemp.Nodes.Clear();
TreeNode rootRole = new TreeNode();
rootRole.Text = "TemplateType";
rootRole.Text = "Template Type";
rootRole.NodeID = "0";
rootRole.Expanded = true;
this.tvStandardTemp.Nodes.Add(rootRole);