人员管理-人员信息下菜单补充公司级树
This commit is contained in:
@@ -40,23 +40,51 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["ProjectId"]))
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["ProjectId"];
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.BindGrid();
|
||||
|
||||
this.GetButtonPower();
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
//DateTime? sDate = Funs.GetNewDateTime(this.txtDate.Text);
|
||||
//var dayReports = BLL.SitePerson_DayReportService.getDayReports(this.ProjectId, sDate);
|
||||
//DataTable tb = this.LINQToDataTable(dayReports);
|
||||
@@ -94,7 +122,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " AND DayReport.ProjectId = @ProjectId";
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"])) ///是否文件柜查看页面传项目值
|
||||
{
|
||||
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
|
||||
strSql += " AND DayReport.States = @States"; ///状态为已完成
|
||||
@@ -102,7 +130,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtDate.Text.Trim()))
|
||||
{
|
||||
@@ -235,7 +263,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
where
|
||||
(from z in db.SitePerson_DayReport
|
||||
where z.CompileDate <= date && z.CompileDate.Value.Year == date.Year
|
||||
&& z.ProjectId == this.CurrUser.LoginProjectId
|
||||
&& z.ProjectId == this.ProjectId
|
||||
select z.DayReportId).Contains(y.DayReportId)
|
||||
select y;
|
||||
if (q.Count() > 0)
|
||||
@@ -257,7 +285,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
Model.SUBQHSEDB db = Funs.DB;
|
||||
DateTime date = Convert.ToDateTime(compileDate);
|
||||
var q = from y in db.SitePerson_DayReportDetail where (from z in db.SitePerson_DayReport where z.CompileDate <= date && z.ProjectId == this.CurrUser.LoginProjectId select z.DayReportId).Contains(y.DayReportId) select y;
|
||||
var q = from y in db.SitePerson_DayReportDetail where (from z in db.SitePerson_DayReport where z.CompileDate <= date && z.ProjectId == this.ProjectId select z.DayReportId).Contains(y.DayReportId) select y;
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
return q.Sum(x => x.PersonWorkTime ?? 0).ToString();
|
||||
@@ -279,7 +307,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DayReportMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.DayReportMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
@@ -410,13 +438,13 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
return;
|
||||
}
|
||||
DateTime? compileDate = BLL.Funs.GetNewDateTime(this.txtCompileDate.Text);
|
||||
if (compileDate.HasValue && !BLL.SitePerson_DayReportService.IsExistDayReport(compileDate.Value, this.CurrUser.LoginProjectId))
|
||||
if (compileDate.HasValue && !BLL.SitePerson_DayReportService.IsExistDayReport(compileDate.Value, this.ProjectId))
|
||||
{
|
||||
this.DayReportId = SQLHelper.GetNewID(typeof(Model.SitePerson_DayReport));
|
||||
Model.SitePerson_DayReport newDayReport = new Model.SitePerson_DayReport
|
||||
{
|
||||
DayReportId = this.DayReportId,
|
||||
ProjectId = this.CurrUser.LoginProjectId,
|
||||
ProjectId = this.ProjectId,
|
||||
CompileMan = this.CurrUser.UserId,
|
||||
CompileDate = compileDate,
|
||||
States = BLL.Const.State_0 //待提交
|
||||
@@ -424,7 +452,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
BLL.SitePerson_DayReportService.AddDayReport(newDayReport);
|
||||
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_1 || x.UnitType == BLL.Const.ProjectUnitType_2)
|
||||
where x.ProjectId == this.ProjectId && (x.UnitType == BLL.Const.ProjectUnitType_1 || x.UnitType == BLL.Const.ProjectUnitType_2)
|
||||
select x; //1为总包,2为施工分包
|
||||
if (units.Count() > 0)
|
||||
{
|
||||
@@ -443,7 +471,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
var posts = (from x in Funs.DB.Base_WorkPost
|
||||
join y in Funs.DB.SitePerson_Person
|
||||
on x.WorkPostId equals y.WorkPostId
|
||||
where y.UnitId == item.UnitId && y.ProjectId == this.CurrUser.LoginProjectId
|
||||
where y.UnitId == item.UnitId && y.ProjectId == this.ProjectId
|
||||
orderby x.WorkPostCode
|
||||
select x).Distinct().ToList();
|
||||
foreach (var postItem in posts)
|
||||
@@ -483,7 +511,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
return;
|
||||
}
|
||||
string id = Grid1.SelectedRowID.Split(',')[0];
|
||||
if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.UserId, Const.DayReportMenuId, Const.BtnDelete))
|
||||
if (CommonService.GetAllButtonPowerList(this.ProjectId, CurrUser.UserId, Const.DayReportMenuId, Const.BtnDelete))
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var day = db.SitePerson_DayReport.Where(u => u.DayReportId == id).FirstOrDefault();
|
||||
@@ -531,7 +559,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
||||
var checks = from x in Funs.DB.SitePerson_Checking
|
||||
join y in Funs.DB.SitePerson_Person on x.PersonId equals y.PersonId
|
||||
join z in Funs.DB.Base_WorkPost on y.WorkPostId equals z.WorkPostId
|
||||
where x.IntoOutTime > nowMont.Value.AddDays(-1) && x.IntoOutTime < nowMont.Value.AddDays(1) && y.ProjectId == this.CurrUser.LoginProjectId
|
||||
where x.IntoOutTime > nowMont.Value.AddDays(-1) && x.IntoOutTime < nowMont.Value.AddDays(1) && y.ProjectId == this.ProjectId
|
||||
&& z.WorkPostId == workPostId
|
||||
select x;
|
||||
count = checks.Count();
|
||||
|
||||
Reference in New Issue
Block a user