安全检查,补充公司级树

This commit is contained in:
2025-04-10 17:34:21 +08:00
parent 6e6f78e900
commit d9a4bb09ac
98 changed files with 6493 additions and 3750 deletions
@@ -8,6 +8,22 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
{
public partial class CostUseCondition : PageBase
{
#region
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@@ -18,6 +34,21 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.ProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
//this.GetButtonPower();
}
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
this.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
// 绑定表格
@@ -25,12 +56,33 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
}
}
/// <summary>
/// 公司级树加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
//this.GetButtonPower();
this.BindGrid();
}
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
string strSql = @"SELECT report.ReportId,
report.Months,
report.UnitId,
@@ -43,7 +95,7 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
+ @" LEFT JOIN dbo.Base_Unit as unit on unit.UnitId = report.UnitId"
+ @" WHERE report.ProjectId= @ProjectId and year(report.Months)=@y and MONTH(report.Months)=@m";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
listStr.Add(new SqlParameter("@y", Funs.GetNewDateTime(this.txtMonth.Text.Trim()).Value.Year));
listStr.Add(new SqlParameter("@m", Funs.GetNewDateTime(this.txtMonth.Text.Trim()).Value.Month));
SqlParameter[] parameter = listStr.ToArray();
@@ -108,7 +160,7 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
{
if (GetButtonPower(Const.BtnAdd))
{
var report = BLL.CostUseConditionService.GetReportByMonths(this.CurrUser.LoginProjectId,Funs.GetNewDateTime(this.txtMonth.Text.Trim()).Value.Year, Funs.GetNewDateTime(this.txtMonth.Text.Trim()).Value.Month);
var report = BLL.CostUseConditionService.GetReportByMonths(this.ProjectId,Funs.GetNewDateTime(this.txtMonth.Text.Trim()).Value.Year, Funs.GetNewDateTime(this.txtMonth.Text.Trim()).Value.Month);
if (report != null)
{
Alert.ShowInTop("本月月报已存在!", MessageBoxIcon.Warning);
@@ -245,7 +297,7 @@ namespace FineUIPro.Web.Customization.CNCEC4.HSSE.Report
/// <returns></returns>
private bool GetButtonPower(string button)
{
return BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.CostUseConditionMenuId, button);
return BLL.CommonService.GetAllButtonPowerList(this.ProjectId, this.CurrUser.UserId, BLL.Const.CostUseConditionMenuId, button);
}
#endregion