焊接管理,补充公司级树
This commit is contained in:
@@ -11,8 +11,24 @@ using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
public partial class UnitWorkAreaQuality :PageBase
|
||||
public partial class UnitWorkAreaQuality : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -25,30 +41,19 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
List<Model.Base_Unit> units = new List<Model.Base_Unit>();
|
||||
var pUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
|
||||
if (pUnit == null || pUnit.UnitType == Const.ProjectUnitType_1)
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2);
|
||||
//this.drpUnit.Enabled = false;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = units;
|
||||
this.drpUnit.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
Funs.FineUIPleaseSelect(this.drpInstallation);
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
else
|
||||
this.InitDropDownList();
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
units = BLL.UnitService.GetSubUnitsListBySupervisorUnitId(this.CurrUser.ProjectId, this.CurrUser.UnitId);
|
||||
this.drpUnit.Enabled = false;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = units;
|
||||
this.drpUnit.DataBind();
|
||||
this.drpUnit.SelectedValue = CurrUser.UnitId;
|
||||
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.CurrUser.LoginProjectId, true);
|
||||
this.drpInstallation.SelectedValue = BLL.Const._Null;
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
//this.GetButtonPower();
|
||||
}
|
||||
///单位
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
@@ -67,6 +72,51 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
//}
|
||||
}
|
||||
}
|
||||
private void InitDropDownList()
|
||||
{
|
||||
List<Model.Base_Unit> units = new List<Model.Base_Unit>();
|
||||
var pUnit = BLL.ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
|
||||
if (pUnit == null || pUnit.UnitType == Const.ProjectUnitType_1)
|
||||
{
|
||||
units = BLL.UnitService.GetUnitByProjectIdUnitTypeList(this.ProjectId, BLL.Const.ProjectUnitType_2);
|
||||
//this.drpUnit.Enabled = false;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = units;
|
||||
this.drpUnit.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
Funs.FineUIPleaseSelect(this.drpInstallation);
|
||||
}
|
||||
else
|
||||
{
|
||||
units = BLL.UnitService.GetSubUnitsListBySupervisorUnitId(this.CurrUser.ProjectId, this.CurrUser.UnitId);
|
||||
this.drpUnit.Enabled = false;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = units;
|
||||
this.drpUnit.DataBind();
|
||||
this.drpUnit.SelectedValue = CurrUser.UnitId;
|
||||
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.ProjectId, true);
|
||||
this.drpInstallation.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定BindGrid
|
||||
@@ -80,9 +130,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)
|
||||
{
|
||||
@@ -124,7 +178,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
listStr.Add(new SqlParameter("@date2", null));
|
||||
}
|
||||
if (this.drpSteType.SelectedValue!=BLL.Const._Null&&!string.IsNullOrEmpty(this.drpSteType.SelectedValue))
|
||||
if (this.drpSteType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpSteType.SelectedValue))
|
||||
{
|
||||
listStr.Add(new SqlParameter("@ste_steeltype", this.drpSteType.SelectedValue));
|
||||
}
|
||||
@@ -132,7 +186,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
listStr.Add(new SqlParameter("@ste_steeltype", 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));
|
||||
}
|
||||
@@ -369,7 +423,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
if (this.Grid1.Columns[i] is GroupField)
|
||||
{
|
||||
var gf = this.Grid1.Columns[i] as GroupField;
|
||||
|
||||
|
||||
for (int j = 0; j < gf.Columns.Count; j++)
|
||||
{
|
||||
gf.Columns[i].Hidden = true;
|
||||
@@ -407,7 +461,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,9 +591,9 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
{
|
||||
if (!column.Hidden)
|
||||
{
|
||||
if (("current_passreate" == item.ColumnID || "cuurent_point_passreate" == item.ColumnID || "current_ext_passreate" == item.ColumnID || "passreate" == item.ColumnID || "point_passreate" == item.ColumnID || "ext_passreate" == item.ColumnID || "tofdpassrate" == item.ColumnID || "tdfwpassrate" == item.ColumnID || "utpassrate" == item.ColumnID || "tofdpassrate" == item.ColumnID) && sumary.ContainsKey(item.ColumnID)&&null!=sumary.GetValue(item.ColumnID))
|
||||
if (("current_passreate" == item.ColumnID || "cuurent_point_passreate" == item.ColumnID || "current_ext_passreate" == item.ColumnID || "passreate" == item.ColumnID || "point_passreate" == item.ColumnID || "ext_passreate" == item.ColumnID || "tofdpassrate" == item.ColumnID || "tdfwpassrate" == item.ColumnID || "utpassrate" == item.ColumnID || "tofdpassrate" == item.ColumnID) && sumary.ContainsKey(item.ColumnID) && null != sumary.GetValue(item.ColumnID))
|
||||
{
|
||||
sb.AppendFormat("<td style=\"text-align:center;\" >{0}</td>", sumary.GetValue(item.ColumnID).ToString()) ;
|
||||
sb.AppendFormat("<td style=\"text-align:center;\" >{0}</td>", sumary.GetValue(item.ColumnID).ToString());
|
||||
|
||||
}
|
||||
else if (sumary.ContainsKey(item.ColumnID))
|
||||
@@ -609,7 +663,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
this.drpInstallation.Items.Clear(); ///装置
|
||||
this.drpWorkArea.Items.Clear(); ///区域
|
||||
|
||||
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.CurrUser.LoginProjectId, true);
|
||||
Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, this.ProjectId, true);
|
||||
this.drpInstallation.SelectedValue = BLL.Const._Null;
|
||||
|
||||
Funs.FineUIPleaseSelect(this.drpWorkArea);
|
||||
@@ -624,7 +678,7 @@ namespace FineUIPro.Web.HJGL.WeldingReport
|
||||
protected void drpInstallation_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpWorkArea.Items.Clear();
|
||||
WorkAreaService.InitWorkAreaProjectInstallUnitDropDownList(this.drpWorkArea, this.CurrUser.LoginProjectId, this.drpInstallation.SelectedValue, this.drpUnit.SelectedValue, true);
|
||||
WorkAreaService.InitWorkAreaProjectInstallUnitDropDownList(this.drpWorkArea, this.ProjectId, this.drpInstallation.SelectedValue, this.drpUnit.SelectedValue, true);
|
||||
this.drpWorkArea.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user