CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/CQMS/QualityPlanning/Organizational.aspx.cs

510 lines
24 KiB
C#
Raw Normal View History

2024-05-31 16:17:04 +08:00
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
namespace FineUIPro.Web.CQMS.QualityPlanning
{
public partial class Organizational : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string projectId = this.CurrUser.LoginProjectId;
string unitId = this.CurrUser.UnitId;
this.lblProjectName.Text = "项目名称:" + BLL.ProjectService.GetProjectNameByProjectId(projectId);
var unit = (from x in Funs.DB.Project_ProjectUnit
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == projectId
&& x.UnitType == BLL.Const.ProjectUnitType_2
&& x.UnitId == unitId
select y).Count();
if (unit>0)
{
string projectManagerName = string.Empty;
var projectManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "项目经理");
if (projectManager != null)
{
foreach (var item in projectManager)
{
projectManagerName += item + ",";
}
if (!string.IsNullOrEmpty(projectManagerName))
{
this.Label1.Text = "项目经理:" + projectManagerName.Substring(0, projectManagerName.LastIndexOf(','));
}
}
string sjName = string.Empty;
var sj = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设计经理");
if (sj != null)
{
foreach (var item in sj)
{
sjName += item + ",";
}
if (!string.IsNullOrEmpty(sjName))
{
this.Label2.Text = "设计经理:" + sjName.Substring(0, sjName.LastIndexOf(','));
}
}
string cgName = string.Empty;
var cg = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "采购经理");
if (cg != null)
{
foreach (var item in cg)
{
cgName += item + ",";
}
if (!string.IsNullOrEmpty(cgName))
{
this.Label3.Text = "采购经理:" + cgName.Substring(0, cgName.LastIndexOf(','));
}
}
string name4 = string.Empty;
var con = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "施工经理");
if (con != null)
{
foreach (var item in con)
{
name4 += item + ",";
}
if (!string.IsNullOrEmpty(name4))
{
this.Label4.Text = "施工经理:" + name4.Substring(0, name4.LastIndexOf(','));
}
}
string name5 = string.Empty;
var qa = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "质量经理");
if (qa != null)
{
foreach (var item in qa)
{
name5 += item + ",";
}
if (!string.IsNullOrEmpty(name5))
{
this.Label5.Text = "质量经理:" + name5.Substring(0, name5.LastIndexOf(','));
}
}
string name6 = string.Empty;
var hseManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE经理");
if (hseManager != null)
{
foreach (var item in hseManager)
{
name6 += item + ",";
}
if (!string.IsNullOrEmpty(name6))
{
this.Label6.Text = "HSE经理" + name6.Substring(0, name6.LastIndexOf(','));
}
}
string name7 = string.Empty;
var carManager = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "开车经理");
if (carManager != null)
{
foreach (var item in carManager)
{
name7 += item + ",";
}
if (!string.IsNullOrEmpty(name7))
{
this.Label7.Text = "开车经理:" + name7.Substring(0, name7.LastIndexOf(','));
}
}
string warehousemanName = string.Empty;
var warehousemanLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仓库管理员");
if (warehousemanLists != null)
{
foreach (var item in warehousemanLists)
{
warehousemanName += item + ",";
}
if (!string.IsNullOrEmpty(warehousemanName))
{
warehousemanName = warehousemanName.Substring(0, warehousemanName.LastIndexOf(','));
}
}
this.Label8.Text = "仓库管理员:" + warehousemanName;
string docName = string.Empty;
var doc = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "文控工程师");
if (doc != null)
{
foreach (var item in doc)
{
docName += item + ",";
}
if (!string.IsNullOrEmpty(docName))
{
docName = docName.Substring(0, docName.LastIndexOf(','));
}
}
this.Label9.Text = "文控工程师:" + docName;
string hseEngineerName = string.Empty;
var hseEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "HSE工程师");
if (hseEngineerLists != null)
{
foreach (var item in hseEngineerLists)
{
hseEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(hseEngineerName))
{
hseEngineerName = hseEngineerName.Substring(0, hseEngineerName.LastIndexOf(','));
}
}
this.Label10.Text = "HSE工程师" + hseEngineerName;
string carEngineerName = string.Empty;
var carEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "开车工程师");
if (carEngineerLists != null)
{
foreach (var item in carEngineerLists)
{
carEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(carEngineerName))
{
carEngineerName = carEngineerName.Substring(0, carEngineerName.LastIndexOf(','));
}
}
this.Label11.Text = "开车工程师:" + carEngineerName;
string CVEngineerName = string.Empty;
var CVEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "土建工程师");
if (CVEngineerLists != null)
{
foreach (var item in CVEngineerLists)
{
CVEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(CVEngineerName))
{
CVEngineerName = CVEngineerName.Substring(0, CVEngineerName.LastIndexOf(','));
}
}
this.Label12.Text = "土建工程师:" + CVEngineerName;
string FEEngineerName = string.Empty;
var FEEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "设备工程师");
if (FEEngineerLists != null)
{
foreach (var item in FEEngineerLists)
{
FEEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(FEEngineerName))
{
FEEngineerName = FEEngineerName.Substring(0, FEEngineerName.LastIndexOf(','));
}
}
this.Label13.Text = "设备工程师:" + FEEngineerName;
string PDEngineerName = string.Empty;
var PDEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "管道工程师");
if (PDEngineerLists != null)
{
foreach (var item in PDEngineerLists)
{
PDEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(PDEngineerName))
{
PDEngineerName = PDEngineerName.Substring(0, PDEngineerName.LastIndexOf(','));
}
}
this.Label14.Text = "管道工程师:" + PDEngineerName;
string EHEngineerName = string.Empty;
var EHEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "电气工程师");
if (EHEngineerLists != null)
{
foreach (var item in EHEngineerLists)
{
EHEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(EHEngineerName))
{
EHEngineerName = EHEngineerName.Substring(0, EHEngineerName.LastIndexOf(','));
}
}
this.Label15.Text = "电气工程师:" + EHEngineerName;
string EAEngineerName = string.Empty;
var EAEngineerLists = BLL.UserService.GetUserNameListsByUnitIdWorkPostName(projectId, unitId, "仪表工程师");
if (EAEngineerLists != null)
{
foreach (var item in EAEngineerLists)
{
EAEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(EAEngineerName))
{
EAEngineerName = EAEngineerName.Substring(0, EAEngineerName.LastIndexOf(','));
}
}
this.Label16.Text = "仪表工程师:" + EAEngineerName;
}
else
{
string projectManagerName = string.Empty;
var projectManager = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "项目经理");
if (projectManager != null)
{
foreach (var item in projectManager)
{
projectManagerName += item + ",";
}
if (!string.IsNullOrEmpty(projectManagerName))
{
this.Label1.Text = "项目经理:" + projectManagerName.Substring(0, projectManagerName.LastIndexOf(','));
}
}
string sjName = string.Empty;
var sj = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "设计经理");
if (sj != null)
{
foreach (var item in sj)
{
sjName += item + ",";
}
if (!string.IsNullOrEmpty(sjName))
{
this.Label2.Text = "设计经理:" + sjName.Substring(0, sjName.LastIndexOf(','));
}
}
string cgName = string.Empty;
var cg = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "采购经理");
if (cg != null)
{
foreach (var item in cg)
{
cgName += item + ",";
}
if (!string.IsNullOrEmpty(cgName))
{
this.Label3.Text = "采购经理:" + cgName.Substring(0, cgName.LastIndexOf(','));
}
}
string name4 = string.Empty;
var con = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "施工经理");
if (con != null)
{
foreach (var item in con)
{
name4 += item + ",";
}
if (!string.IsNullOrEmpty(name4))
{
this.Label4.Text = "施工经理:" + name4.Substring(0, name4.LastIndexOf(','));
}
}
string name5 = string.Empty;
var qa = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "质量经理");
if (qa != null)
{
foreach (var item in qa)
{
name5 += item + ",";
}
if (!string.IsNullOrEmpty(name5))
{
this.Label5.Text = "质量经理:" + name5.Substring(0, name5.LastIndexOf(','));
}
}
string name6 = string.Empty;
var hseManager = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "HSE经理");
if (hseManager != null)
{
foreach (var item in hseManager)
{
name6 += item + ",";
}
if (!string.IsNullOrEmpty(name6))
{
this.Label6.Text = "HSE经理" + name6.Substring(0, name6.LastIndexOf(','));
}
}
string name7 = string.Empty;
var carManager = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "开车经理");
if (carManager != null)
{
foreach (var item in carManager)
{
name7 += item + ",";
}
if (!string.IsNullOrEmpty(name7))
{
this.Label7.Text = "开车经理:" + name7.Substring(0, name7.LastIndexOf(','));
}
}
string warehousemanName = string.Empty;
var warehousemanLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "仓库管理员");
if (warehousemanLists != null)
{
foreach (var item in warehousemanLists)
{
warehousemanName += item + ",";
}
if (!string.IsNullOrEmpty(warehousemanName))
{
warehousemanName = warehousemanName.Substring(0, warehousemanName.LastIndexOf(','));
}
}
this.Label8.Text = "仓库管理员:" + warehousemanName;
string docName = string.Empty;
var doc = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "文控工程师");
if (doc != null)
{
foreach (var item in doc)
{
docName += item + ",";
}
if (!string.IsNullOrEmpty(docName))
{
docName = docName.Substring(0, docName.LastIndexOf(','));
}
}
this.Label9.Text = "文控工程师:" + docName;
string hseEngineerName = string.Empty;
var hseEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "HSE工程师");
if (hseEngineerLists != null)
{
foreach (var item in hseEngineerLists)
{
hseEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(hseEngineerName))
{
hseEngineerName = hseEngineerName.Substring(0, hseEngineerName.LastIndexOf(','));
}
}
this.Label10.Text = "HSE工程师" + hseEngineerName;
string carEngineerName = string.Empty;
var carEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "开车工程师");
if (carEngineerLists != null)
{
foreach (var item in carEngineerLists)
{
carEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(carEngineerName))
{
carEngineerName = carEngineerName.Substring(0, carEngineerName.LastIndexOf(','));
}
}
this.Label11.Text = "开车工程师:" + carEngineerName;
string CVEngineerName = string.Empty;
var CVEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "土建工程师");
if (CVEngineerLists != null)
{
foreach (var item in CVEngineerLists)
{
CVEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(CVEngineerName))
{
CVEngineerName = CVEngineerName.Substring(0, CVEngineerName.LastIndexOf(','));
}
}
this.Label12.Text = "土建工程师:" + CVEngineerName;
string FEEngineerName = string.Empty;
var FEEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "设备工程师");
if (FEEngineerLists != null)
{
foreach (var item in FEEngineerLists)
{
FEEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(FEEngineerName))
{
FEEngineerName = FEEngineerName.Substring(0, FEEngineerName.LastIndexOf(','));
}
}
this.Label13.Text = "设备工程师:" + FEEngineerName;
string PDEngineerName = string.Empty;
var PDEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "管道工程师");
if (PDEngineerLists != null)
{
foreach (var item in PDEngineerLists)
{
PDEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(PDEngineerName))
{
PDEngineerName = PDEngineerName.Substring(0, PDEngineerName.LastIndexOf(','));
}
}
this.Label14.Text = "管道工程师:" + PDEngineerName;
string EHEngineerName = string.Empty;
var EHEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "电气工程师");
if (EHEngineerLists != null)
{
foreach (var item in EHEngineerLists)
{
EHEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(EHEngineerName))
{
EHEngineerName = EHEngineerName.Substring(0, EHEngineerName.LastIndexOf(','));
}
}
this.Label15.Text = "电气工程师:" + EHEngineerName;
string EAEngineerName = string.Empty;
var EAEngineerLists = BLL.UserService.GetUserNameListsByWorkPostName(projectId, "仪表工程师");
if (EAEngineerLists != null)
{
foreach (var item in EAEngineerLists)
{
EAEngineerName += item + ",";
}
if (!string.IsNullOrEmpty(EAEngineerName))
{
EAEngineerName = EAEngineerName.Substring(0, EAEngineerName.LastIndexOf(','));
}
}
this.Label16.Text = "仪表工程师:" + EAEngineerName;
}
}
}
#endregion
}
}