This commit is contained in:
毕文静 2025-10-09 10:39:49 +08:00
parent 6b422a4781
commit aea0bf3079
8 changed files with 181 additions and 67 deletions

View File

@ -56,6 +56,7 @@ namespace BLL
newDepart.DepartName = depart.DepartName;
newDepart.Remark = depart.Remark;
newDepart.DepartLeader = depart.DepartLeader;
newDepart.DelegatedRepresentative = depart.DelegatedRepresentative;
Funs.DB.Base_Depart.InsertOnSubmit(newDepart);
Funs.DB.SubmitChanges();
}
@ -73,6 +74,7 @@ namespace BLL
newDepart.DepartName = depart.DepartName;
newDepart.Remark = depart.Remark;
newDepart.DepartLeader = depart.DepartLeader;
newDepart.DelegatedRepresentative = depart.DelegatedRepresentative;
Funs.DB.SubmitChanges();
}
}

View File

@ -42,6 +42,9 @@
<f:RenderField Width="150px" ColumnID="UserName" DataField="UserName"
FieldType="String" HeaderText="Department leader" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="DelegatedRepresentativeName" DataField="DelegatedRepresentativeName"
FieldType="String" HeaderText="Delegated Representative" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="Remark" DataField="Remark"
FieldType="String" HeaderText="Remark" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
</f:RenderField>
@ -77,6 +80,7 @@
runat="server" LabelAlign="right" LabelWidth="140px">
</f:TextBox>
<f:DropDownList ID="drpDepartLeader" runat="server" Label="Department leader" LabelAlign="Right" EnableEdit="true" LabelWidth="140px"></f:DropDownList>
<f:DropDownList ID="drpDelegatedRepresentative" runat="server" Label="Delegated Representative" LabelAlign="Right" EnableEdit="true" LabelWidth="140px"></f:DropDownList>
<f:TextArea ID="txtRemark" Label="Remark" runat="server" LabelAlign="Right" LabelWidth="140px"></f:TextArea>
</Items>
<Toolbars>
@ -117,7 +121,7 @@
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
}
</script>
</body>
</html>

View File

@ -1,6 +1,7 @@
using BLL;
using BLL.Common;
using Model;
using Org.BouncyCastle.Tls.Crypto;
using System;
using System.Collections.Generic;
using System.Data;
@ -23,14 +24,21 @@ namespace FineUIPro.Web.BaseInfo
if (!IsPostBack)
{
GetButtonPower();//按钮权限
//部门领导
drpDepartLeader.DataTextField = "UserName";
drpDepartLeader.DataValueField = "UserId";
this.drpDepartLeader.DataSource = BLL.Sys_UserService.GetUserList();
this.drpDepartLeader.DataBind();
Funs.FineUIPleaseSelect(this.drpDepartLeader);
this.drpDepartLeader.SelectedIndex = 0;
//部门代理人
drpDelegatedRepresentative.DataTextField = "UserName";
drpDelegatedRepresentative.DataValueField = "UserId";
this.drpDelegatedRepresentative.DataSource = BLL.Sys_UserService.GetUserList();
this.drpDelegatedRepresentative.DataBind();
Funs.FineUIPleaseSelect(this.drpDelegatedRepresentative);
this.drpDelegatedRepresentative.SelectedIndex = 0;
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
@ -42,9 +50,10 @@ namespace FineUIPro.Web.BaseInfo
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT dep.DepartId,dep.DepartCode,dep.DepartName,dep.DepartLeader,u.UserName
string strSql = @"SELECT dep.DepartId,dep.DepartCode,dep.DepartName,dep.DepartLeader,u.UserName,dep.DelegatedRepresentative,r.UserName as DelegatedRepresentativeName
FROM dbo.Base_Depart AS dep
LEFT JOIN dbo.Sys_User AS u ON u.UserId = dep.DepartLeader
LEFT JOIN dbo.Sys_User AS r ON r.UserId = dep.DelegatedRepresentative
Where 1=1";
// 2.获取当前分页数据
List<SqlParameter> listStr = new List<SqlParameter>();
@ -99,13 +108,11 @@ namespace FineUIPro.Web.BaseInfo
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
BLL.DepartService.DeleteDepartById(hfFormID.Text);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete department");
// 重新绑定表格,并模拟点击[新增按钮]
BindGrid();
//PageContext.RegisterStartupScript("onNewButtonClick();");
}
/// <summary>
/// 右键删除事件
@ -170,6 +177,18 @@ namespace FineUIPro.Web.BaseInfo
{
this.drpDepartLeader.SelectedValue = depart.DepartLeader;
}
else
{
this.drpDepartLeader.SelectedIndex = 0;
}
if (!string.IsNullOrEmpty(depart.DelegatedRepresentative))
{
this.drpDelegatedRepresentative.SelectedValue = depart.DelegatedRepresentative;
}
else
{
this.drpDelegatedRepresentative.SelectedIndex = 0;
}
hfFormID.Text = Id;
this.btnDelete.Enabled = true;
}
@ -197,6 +216,10 @@ namespace FineUIPro.Web.BaseInfo
{
depart.DepartLeader = this.drpDepartLeader.SelectedValue;
}
if (this.drpDelegatedRepresentative.SelectedValue!=BLL.Const._Null)
{
depart.DelegatedRepresentative = this.drpDelegatedRepresentative.SelectedValue;
}
if (string.IsNullOrEmpty(strRowID))
{
depart.DepartId = SQLHelper.GetNewID(typeof(Model.Base_Depart));
@ -264,6 +287,7 @@ namespace FineUIPro.Web.BaseInfo
this.txtDepartCode.Text = string.Empty;
this.txtDepartName.Text = string.Empty;
this.drpDepartLeader.SelectedValue = Const._Null;
this.drpDelegatedRepresentative.SelectedValue= Const._Null;
this.txtRemark.Text = string.Empty;
this.btnDelete.Enabled = false;
}
@ -397,7 +421,6 @@ namespace FineUIPro.Web.BaseInfo
{
errorInfos += (i + 2) + "Line, [Manager] cannot be empty!</br>";
}
depList.Add(d);
#endregion
}

View File

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo {
public partial class Department {
namespace FineUIPro.Web.BaseInfo
{
public partial class Department
{
/// <summary>
/// form1 控件。
/// </summary>
@ -20,7 +22,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@ -29,7 +31,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@ -38,7 +40,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
@ -47,7 +49,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@ -56,7 +58,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtDepCode 控件。
/// </summary>
@ -65,7 +67,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDepCode;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
@ -74,7 +76,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary>
/// fuAttachUrl 控件。
/// </summary>
@ -83,7 +85,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload fuAttachUrl;
/// <summary>
/// hdFileName 控件。
/// </summary>
@ -92,7 +94,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFileName;
/// <summary>
/// btnImport 控件。
/// </summary>
@ -101,7 +103,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
@ -110,7 +112,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -119,7 +121,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@ -128,7 +130,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@ -137,7 +139,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@ -146,7 +148,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.SimpleForm SimpleForm1;
/// <summary>
/// hfFormID 控件。
/// </summary>
@ -155,7 +157,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hfFormID;
/// <summary>
/// txtDepartCode 控件。
/// </summary>
@ -164,7 +166,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDepartCode;
/// <summary>
/// txtDepartName 控件。
/// </summary>
@ -173,7 +175,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtDepartName;
/// <summary>
/// drpDepartLeader 控件。
/// </summary>
@ -182,7 +184,16 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpDepartLeader;
/// <summary>
/// drpDelegatedRepresentative 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpDelegatedRepresentative;
/// <summary>
/// txtRemark 控件。
/// </summary>
@ -191,7 +202,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@ -200,7 +211,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnNew 控件。
/// </summary>
@ -209,7 +220,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnDelete 控件。
/// </summary>
@ -218,7 +229,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -227,7 +238,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
@ -236,7 +247,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// Menu1 控件。
/// </summary>
@ -245,7 +256,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
@ -254,7 +265,7 @@ namespace FineUIPro.Web.BaseInfo {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>

View File

@ -1183,7 +1183,7 @@ namespace FineUIPro.Web.ContractorQuality
pun.UserDepStartDate = DateTime.Now;//用户部门审批到达时间
pun.Pause = false;//如果审核通过,取消暂停
#region :
#region :
Model.EmailPop pops = Funs.DB.EmailPop.FirstOrDefault(x => x.EmailID == BLL.Const.EmailPopId);
if (pops == null)
{
@ -1196,31 +1196,56 @@ namespace FineUIPro.Web.ContractorQuality
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主协调员填写完成后审批通过通知"));
if (emailTemplate.Count() > 0)
{
string departLeader = string.Empty;
string delegatedRepresentative = string.Empty;//部门代理人
string departmentLeader = string.Empty;//部门经理
var depart = BLL.DepartService.GetDepartById(drpUserDep.SelectedValue);
if (depart != null)
{
departLeader = depart.DepartLeader;
delegatedRepresentative = depart.DelegatedRepresentative;
departmentLeader = depart.DepartLeader;
}
if (!string.IsNullOrEmpty(departLeader))
if (!string.IsNullOrEmpty(delegatedRepresentative))
{
var userTo = from x in Funs.DB.Sys_User
where x.UserId.Contains(departLeader) && x.Email != null && x.Email != ""
where x.UserId.Contains(delegatedRepresentative) && 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();
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.UserId.Contains(departmentLeader))
&& x.Email != null && x.Email != ""
select x;
if (userCc != null)
{
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
}
}
else
{
if(!string.IsNullOrEmpty(departmentLeader))
{
var userTo = from x in Funs.DB.Sys_User
where x.UserId.Contains(departmentLeader) && 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();

View File

@ -834,7 +834,7 @@ namespace FineUIPro.Web.Evaluation
if (punish != null)
{
punish.IsUserEvaluated = true;
punish.IsUserEvaluatedTime = DateTime.Now;
//punish.IsUserEvaluatedTime = DateTime.Now;
Funs.DB.SubmitChanges();
}
@ -966,7 +966,7 @@ namespace FineUIPro.Web.Evaluation
if (punish != null)
{
punish.IsDepEvaluated = true;
punish.IsDepEvaluatedTime = DateTime.Now;
//punish.IsDepEvaluatedTime = DateTime.Now;
Funs.DB.SubmitChanges();
}
}

View File

@ -47,7 +47,7 @@
}
//每月25810邮件自动发送给SSR提交人员和主协调人及合同员用户代表等评价
if ((DateTime.Now.Day == 2 || DateTime.Now.Day == 5 || DateTime.Now.Day == 8 || DateTime.Now.Day == 10) && DateTime.Now.Hour == 9)
if ((DateTime.Now.Day == 2 || DateTime.Now.Day == 5 || DateTime.Now.Day == 8 || DateTime.Now.Day == 10) && DateTime.Now.Hour == 8)
{
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_Elapsed);
@ -1754,9 +1754,9 @@
}
#endregion
# region 3
# region 3
/// <summary>
/// 承包商报告主协调员提交后通知承包商联系人若无异议或3天未操作发送邮件给用户部门经理
/// 承包商报告主协调员提交后通知承包商联系人若无异议或3天未操作发送邮件给用户部门(有部门代理人发送给部门代理人抄送给部门经理,无部门代理人发送则发送给部门经理)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@ -1791,6 +1791,7 @@
string[] mailCC = null;
string resultMessage = "";
string departLeader = string.Empty;
string delegatedRepresentative = string.Empty;
var emailTemplate = Funs.DB.SendEmailTemplate.Where(x => x.EmailName.Contains("主协调员填写完成后审批通过通知"));
if (emailTemplate.Count() > 0)
@ -1799,26 +1800,50 @@
if (depart != null)
{
departLeader = depart.DepartLeader;
delegatedRepresentative = depart.DelegatedRepresentative;
}
if (!string.IsNullOrEmpty(departLeader))
if (!string.IsNullOrEmpty(delegatedRepresentative))
{
var userTo = from x in Funs.DB.Sys_User
where x.UserId.Contains(departLeader) && x.Email != null && x.Email != ""
where x.UserId.Contains(delegatedRepresentative) && 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 == pun.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();
var userCc = from x in Funs.DB.View_EMail_UserTo
where ((x.PunishmentId == pun.PunishmentId && x.AuditDate != null) || x.UserId.Contains(pun.Violation_Inspector) || x.UserId.Contains(departLeader))
&& x.Email != null && x.Email != ""
select x;
if (userCc != null)
{
mailCC = userCc.Select(x => x.Email).Distinct().ToArray();
}
}
else
{
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 == pun.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();

View File

@ -1739,6 +1739,8 @@ namespace Model
private string _DepartLeader;
private string _DelegatedRepresentative;
private EntitySet<EMC_CTSalesContracts> _EMC_CTSalesContracts;
private EntitySet<EMC_CTSalesContracts> _Depart;
@ -1763,6 +1765,8 @@ namespace Model
partial void OnRemarkChanged();
partial void OnDepartLeaderChanging(string value);
partial void OnDepartLeaderChanged();
partial void OnDelegatedRepresentativeChanging(string value);
partial void OnDelegatedRepresentativeChanged();
#endregion
public Base_Depart()
@ -1875,6 +1879,26 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DelegatedRepresentative", DbType="NVarChar(50)")]
public string DelegatedRepresentative
{
get
{
return this._DelegatedRepresentative;
}
set
{
if ((this._DelegatedRepresentative != value))
{
this.OnDelegatedRepresentativeChanging(value);
this.SendPropertyChanging();
this._DelegatedRepresentative = value;
this.SendPropertyChanged("DelegatedRepresentative");
this.OnDelegatedRepresentativeChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_EMC_CTSalesContracts_Base_Depart", Storage="_EMC_CTSalesContracts", ThisKey="DepartId", OtherKey="DeptOfRevenue", DeleteRule="NO ACTION")]
public EntitySet<EMC_CTSalesContracts> EMC_CTSalesContracts
{