焊接管理,补充公司级树
This commit is contained in:
@@ -10,6 +10,20 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 试压包主键
|
||||
/// </summary>
|
||||
public string PTP_ID
|
||||
@@ -41,43 +55,78 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
//施工单位、装置
|
||||
//if (BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId) == null || BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId).UnitTypeId == BLL.Const.ProjectUnitType_1)
|
||||
//{
|
||||
// BLL.UnitService.InitUnitNameByUnitTypeDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
|
||||
// BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, true);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// BLL.UnitService.InitSubUnitNameDownList(this.drpUnitId, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
//}
|
||||
var pUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
|
||||
if (pUnit != null)
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.drpUnitId.DataTextField = "UnitName";
|
||||
this.drpUnitId.DataValueField = "UnitId";
|
||||
this.drpUnitId.DataSource = pUnit;
|
||||
this.drpUnitId.DataBind();
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && CurrUser.UserId != Const.hfnbdId)
|
||||
{
|
||||
this.drpUnitId.Enabled = false;
|
||||
}
|
||||
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, true);
|
||||
this.drpInstallationId.SelectedIndex = 0;
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
this.InitDropDownList();
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
//this.GetButtonPower();
|
||||
}
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Modifier, this.CurrUser.LoginProjectId, true);//修改人
|
||||
BLL.Base_PressureService.InitPressureDropDownList(this.drpPTP_TestType, true);//试验类型
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Tabler, this.CurrUser.LoginProjectId, true);//建档人
|
||||
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||
this.txtPTP_TableDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.drpPTP_Tabler.SelectedValue = this.CurrUser.UserId;
|
||||
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitDropDownList()
|
||||
{
|
||||
//施工单位、装置
|
||||
//if (BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId) == null || BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId).UnitTypeId == BLL.Const.ProjectUnitType_1)
|
||||
//{
|
||||
// BLL.UnitService.InitUnitNameByUnitTypeDropDownList(this.drpUnitId, this.ProjectId, BLL.Const.ProjectUnitType_2, true);
|
||||
// BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallationId, this.ProjectId, true);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// BLL.UnitService.InitSubUnitNameDownList(this.drpUnitId, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
//}
|
||||
var pUnit = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
|
||||
if (pUnit != null)
|
||||
{
|
||||
this.drpUnitId.DataTextField = "UnitName";
|
||||
this.drpUnitId.DataValueField = "UnitId";
|
||||
this.drpUnitId.DataSource = pUnit;
|
||||
this.drpUnitId.DataBind();
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && CurrUser.UserId != Const.hfnbdId)
|
||||
{
|
||||
this.drpUnitId.Enabled = false;
|
||||
}
|
||||
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpUnitId.SelectedValue, true);
|
||||
this.drpInstallationId.SelectedIndex = 0;
|
||||
}
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Modifier, this.ProjectId, true);//修改人
|
||||
BLL.UserService.InitUserDropDownList(this.drpPTP_Tabler, this.ProjectId, true);//建档人
|
||||
this.drpPTP_Tabler.SelectedValue = this.CurrUser.UserId;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.InitDropDownList();
|
||||
//if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
//{
|
||||
// btnNew.Hidden = true;
|
||||
//}
|
||||
//this.GetButtonPower();
|
||||
this.InitTreeMenu();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载树装置-单位-工作区
|
||||
@@ -86,6 +135,10 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim()))
|
||||
{
|
||||
DateTime? startTime = Funs.GetNewDateTime(this.txtReportDate.Text.Trim());
|
||||
@@ -102,16 +155,16 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
var unit = BLL.ProjectUnitService.GetProjectUnitById(this.CurrUser.UnitId);
|
||||
if (unit == null || unit.UnitType == BLL.Const.ProjectUnitType_1 || unit.UnitType == BLL.Const.ProjectUnitType_3)
|
||||
{
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
|
||||
{
|
||||
units = (from x in Funs.DB.Base_Unit
|
||||
join y in Funs.DB.ProjectData_WorkArea on x.UnitId equals y.UnitId
|
||||
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.CurrUser.LoginProjectId
|
||||
where (x.UnitId == this.CurrUser.UnitId || y.SupervisorUnitId == this.CurrUser.UnitId) && y.ProjectId == this.ProjectId
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, "2");
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, "2");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -122,7 +175,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
if (!this.txtReportDate.Hidden)
|
||||
{
|
||||
testPackageLists = (from x in Funs.DB.TP_TestPackage
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && x.PTP_TableDate >= startTime && x.PTP_TableDate < endTime
|
||||
where x.ProjectId == this.ProjectId && x.PTP_TableDate >= startTime && x.PTP_TableDate < endTime
|
||||
select x).ToList();
|
||||
}
|
||||
if (units != null)
|
||||
@@ -495,7 +548,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
return;
|
||||
}
|
||||
Model.TP_TestPackage testPackage = new Model.TP_TestPackage();
|
||||
testPackage.ProjectId = this.CurrUser.LoginProjectId;
|
||||
testPackage.ProjectId = this.ProjectId;
|
||||
testPackage.BSU_ID = this.drpUnitId.SelectedValue;
|
||||
testPackage.InstallationId = this.drpInstallationId.SelectedValue;
|
||||
testPackage.PTP_TestPackageNo = this.txtPTP_TestPackageNo.Text.Trim();
|
||||
@@ -547,7 +600,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
testPackage.PTP_ID = PTP_ID;
|
||||
BLL.TestPackageManageEditService.UpdateTP_TestPackage(testPackage);
|
||||
// BLL.TestPackageManageEditService.DeleteTP_IsoListByPTP_ID(PTP_ID);
|
||||
// BLL.TestPackageManageEditService.DeleteTP_IsoListByPTP_ID(PTP_ID);
|
||||
//BLL.LogService.AddLog(this.CurrUser.UserId, "修改试压单信息");
|
||||
}
|
||||
}
|
||||
@@ -561,7 +614,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
}
|
||||
|
||||
|
||||
var oldios = Funs.DB.TP_IsoList.Where(x => x.PTP_ID == this.PTP_ID).ToList();
|
||||
var oldios = Funs.DB.TP_IsoList.Where(x => x.PTP_ID == this.PTP_ID).ToList();
|
||||
//添加新的
|
||||
foreach (var item in isoInfos)
|
||||
{
|
||||
@@ -572,7 +625,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
{
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!has)
|
||||
{
|
||||
@@ -588,7 +641,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
bool has = false;
|
||||
foreach (var newios in isoInfos)
|
||||
{
|
||||
if(old.ISO_ID== newios.ISO_ID)
|
||||
if (old.ISO_ID == newios.ISO_ID)
|
||||
{
|
||||
has = true;
|
||||
break;
|
||||
@@ -600,7 +653,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
}
|
||||
}
|
||||
Funs.DB.SubmitChanges();
|
||||
isoInfos.Clear();
|
||||
isoInfos.Clear();
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
InitTreeMenu();
|
||||
}
|
||||
@@ -706,17 +759,17 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
this.drpInstallationId.Items.Clear();
|
||||
if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue) && this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
//if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
|
||||
//if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
|
||||
//{
|
||||
// BLL.Project_InstallationService.InitInstallationBySupervisorUnitIdListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, this.CurrUser.UnitId, true);
|
||||
// BLL.Project_InstallationService.InitInstallationBySupervisorUnitIdListDownList(this.drpInstallationId, this.ProjectId, this.drpUnitId.SelectedValue, this.CurrUser.UnitId, true);
|
||||
// this.drpInstallationId.SelectedIndex = 0;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, true);
|
||||
// BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpUnitId.SelectedValue, true);
|
||||
// this.drpInstallationId.SelectedIndex = 0;
|
||||
//}
|
||||
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.CurrUser.LoginProjectId, this.drpUnitId.SelectedValue, true);
|
||||
BLL.Project_InstallationService.InitInstallationListDownList(this.drpInstallationId, this.ProjectId, this.drpUnitId.SelectedValue, true);
|
||||
this.drpInstallationId.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
@@ -724,7 +777,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
Funs.FineUIPleaseSelect(this.drpInstallationId);
|
||||
}
|
||||
changeTestPackageNo(sender, e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 介质转换
|
||||
@@ -754,7 +807,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
/// <returns></returns>
|
||||
private bool GetButtonPower(string button)
|
||||
{
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageManageMenuId, button);
|
||||
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.HJGL_TestPackageManageMenuId, button);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -775,7 +828,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
if (install != null && unit != null)
|
||||
{
|
||||
string code = unit.UnitCode + "-" + install.InstallationCode + "-SYB-";
|
||||
txtPTP_TestPackageNo.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.TP_TestPackage", "PTP_TestPackageNo", this.CurrUser.LoginProjectId, code);
|
||||
txtPTP_TestPackageNo.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.TP_TestPackage", "PTP_TestPackageNo", this.ProjectId, code);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -798,7 +851,7 @@ namespace FineUIPro.Web.HJGL.TestPackageManage
|
||||
if (testMedium != null)
|
||||
{
|
||||
string code = install.InstallationCode + "-" + testMedium.MediumCode + "-";
|
||||
txtPTP_TestPackageCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.TP_TestPackage", "PTP_TestPackageCode", this.CurrUser.LoginProjectId, code);
|
||||
txtPTP_TestPackageCode.Text = BLL.SQLHelper.RunProcNewId("SpGetNewCode5ByProjectId", "dbo.TP_TestPackage", "PTP_TestPackageCode", this.ProjectId, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user