公司级树补充
This commit is contained in:
+51
-28
@@ -1,34 +1,27 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using static System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
|
||||
{
|
||||
public partial class BenchmarkWorkSite : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
///// <summary>
|
||||
///// 项目主键
|
||||
///// </summary>
|
||||
//public string ProjectId
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return (string)ViewState["ProjectId"];
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// ViewState["ProjectId"] = value;
|
||||
// }
|
||||
//}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
@@ -42,24 +35,56 @@ namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ProjectId = this.ProjectId;
|
||||
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.btnNew.OnClientClick = Window1.GetShowReference("BenchmarkWorkSiteEdit.aspx") + "return false;";
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <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();
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
var db = Funs.DB;
|
||||
var queryData = from x in db.ConstructionStandardization_BenchmarkWorkSite
|
||||
join pro in db.Base_Project on x.ProjectId equals pro.ProjectId
|
||||
@@ -67,10 +92,8 @@ namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
|
||||
join un2 in db.Base_Unit on x.Supervisor equals un2.UnitId
|
||||
join un3 in db.Base_Unit on x.Owner equals un3.UnitId
|
||||
join y in db.Sys_User on x.CompileMan equals y.UserId
|
||||
where
|
||||
//x.ProjectId == this.ProjectId
|
||||
//&&
|
||||
(string.IsNullOrEmpty(txtCode.Text.Trim()) || x.Code.Contains(txtCode.Text.Trim()))
|
||||
where x.ProjectId == this.ProjectId
|
||||
&& (string.IsNullOrEmpty(txtCode.Text.Trim()) || x.Code.Contains(txtCode.Text.Trim()))
|
||||
&& (string.IsNullOrEmpty(txtName.Text.Trim()) || x.Name.Contains(txtName.Text.Trim()))
|
||||
&& (string.IsNullOrEmpty(txtProjectName.Text.Trim()) || pro.ProjectName.Contains(txtProjectName.Text.Trim()))
|
||||
select new
|
||||
@@ -222,7 +245,7 @@ namespace FineUIPro.Web.ThreeYearAction.ConstructionStandardization
|
||||
return;
|
||||
}
|
||||
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.BenchmarkWorkSiteMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.BenchmarkWorkSiteMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
|
||||
Reference in New Issue
Block a user