补充公司级树
This commit is contained in:
@@ -11,9 +11,25 @@ using System.Web.UI.WebControls;
|
||||
namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
public partial class RewardAndPunish : PageBase
|
||||
{/// <summary>
|
||||
/// 项目id
|
||||
/// </summary>
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目id
|
||||
/// </summary>
|
||||
public string RewardAndPunishID
|
||||
{
|
||||
get
|
||||
@@ -25,17 +41,48 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
ViewState["RewardAndPunishID"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
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();
|
||||
}
|
||||
btnNew.OnClientClick = Window1.GetShowReference("RewardAndPunishEdit.aspx") + "return false;";
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
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>
|
||||
/// 绑定数据
|
||||
@@ -43,6 +90,10 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
|
||||
public void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
DataTable tb = ChecklistData();
|
||||
|
||||
// 2.获取当前分页数据
|
||||
@@ -55,9 +106,9 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected DataTable ChecklistData()
|
||||
{
|
||||
string strSql = @" SELECT RewardAndPunishID
|
||||
@@ -72,14 +123,14 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
where ProjectId=@ProjectId";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
|
||||
if (drpType.SelectedValue != Const._Null)
|
||||
{
|
||||
strSql += " AND Type=@Type";
|
||||
listStr.Add(new SqlParameter("@Type", drpType.SelectedValue));
|
||||
}
|
||||
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
return tb;
|
||||
@@ -172,7 +223,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnMenuModify_Click(null, null);
|
||||
btnMenuModify_Click(null, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +277,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.RewardAndPunishMenuId);
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.RewardAndPunishMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
@@ -266,8 +317,8 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
return;
|
||||
}
|
||||
string codes = Grid1.SelectedRowID.Split(',')[0];
|
||||
|
||||
BLL.RewardAndPunishService.DeleteRewardAndPunishById(codes);
|
||||
|
||||
BLL.RewardAndPunishService.DeleteRewardAndPunishById(codes);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, "", codes, BLL.Const.CheckListMenuId, "删除奖罚通知单(定稿)");
|
||||
Grid1.DataBind();
|
||||
BindGrid();
|
||||
|
||||
Reference in New Issue
Block a user