焊接管理,补充公司级树
This commit is contained in:
@@ -11,6 +11,22 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
public partial class MediaComprehensive : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -23,38 +39,69 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
//单位
|
||||
// var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
// if (unit != null && unit.UnitTypeId == BLL.Const.ProjectUnitType_2)
|
||||
if (CommonService.GetProjectUnitType(this.CurrUser.LoginProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
|
||||
{
|
||||
BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnit.Enabled = false;
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//var supervisonUnit = BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId);
|
||||
//if (supervisonUnit)
|
||||
//{
|
||||
// BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.CurrUser.LoginProjectId, this.CurrUser.UnitId, true);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, true);
|
||||
}
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
}
|
||||
BLL.Base_TestMediumService.InitMediumDropDownList(this.ddlService, true);//介质
|
||||
}
|
||||
}
|
||||
|
||||
private void InitDropDownList()
|
||||
{
|
||||
//单位
|
||||
// var unit = BLL.UnitService.GetUnitByUnitId(this.CurrUser.UnitId);
|
||||
// if (unit != null && unit.UnitTypeId == BLL.Const.ProjectUnitType_2)
|
||||
if (CommonService.GetProjectUnitType(this.ProjectId, this.CurrUser.UnitId) != BLL.Const.ProjectUnitType_1 && this.CurrUser.UnitId != Const.hfnbdId)
|
||||
{
|
||||
BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
this.drpUnit.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnit.Enabled = false;
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//var supervisonUnit = BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId);
|
||||
//if (supervisonUnit)
|
||||
//{
|
||||
// BLL.UnitService.InitSubUnitNameDownList(this.drpUnit, this.ProjectId, this.CurrUser.UnitId, true);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(this.drpUnit, this.ProjectId, BLL.Const.ProjectUnitType_2, true);
|
||||
}
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
}
|
||||
BLL.Base_TestMediumService.InitMediumDropDownList(this.ddlService, true);//介质
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.InitDropDownList();
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定BindGrid
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Table
|
||||
/// </summary>
|
||||
private DataTable tb = null;
|
||||
|
||||
@@ -63,9 +110,13 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@projectId", this.CurrUser.LoginProjectId)
|
||||
new SqlParameter("@projectId", this.ProjectId)
|
||||
};
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpUnit.SelectedValue))
|
||||
{
|
||||
@@ -91,7 +142,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
listStr.Add(new SqlParameter("@sername", null));
|
||||
}
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.CurrUser.LoginProjectId))
|
||||
if (BLL.WorkAreaService.IsSupervisor(this.CurrUser.UnitId, this.ProjectId))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@supervisorUnitId", this.CurrUser.UnitId));
|
||||
}
|
||||
@@ -342,7 +393,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
this.drpWorkArea.Items.Clear();
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpUnit.SelectedValue))
|
||||
{
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.drpUnit.SelectedValue, true);
|
||||
BLL.WorkAreaService.InitWorkAreaProjectUnitDropDownList(this.drpWorkArea, this.ProjectId, this.drpUnit.SelectedValue, true);
|
||||
this.drpWorkArea.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user