/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { mCollectWebControlListLook = new List <CollectWebControl>(); mCollectWebControlListMaintain = new List <CollectWebControl>(); //在查看权限下需要被隐藏的控件 mCollectWebControlListLook.Add(new CollectWebControl(GridViewShowCraftList.Columns[5])); mCollectWebControlListLook.Add(new CollectWebControl(GridViewShowCraftList.Columns[6])); mCollectWebControlListLook.Add(new CollectWebControl(GridViewShowRejects.Columns[5])); mCollectWebControlListLook.Add(new CollectWebControl(GridViewShowRejects.Columns[4])); mCollectWebControlListLook.Add(new CollectWebControl(Asp_Input_AddNewCraft)); //在查看维护下需要被隐藏的控件 mCollectWebControlListMaintain.Add(new CollectWebControl(Panel_ADD_BadProduct)); UserStat mCraftMgtUserStatLook = new CraftMgtUserStatLook(mCollectWebControlListLook); UserStat mCraftMgtUserStatMaintain = new CraftMgtUserStatMaintain(mCollectWebControlListMaintain); UserRole mUserRole = new UserRole(mCraftMgtUserStatMaintain, this); mCraftMgtUserStatMaintain.SetNextStat(mCraftMgtUserStatLook, mUserRole); mUserRole.CheckRole(); if (!Page.IsPostBack) //保证页面第一次加载的时候会加载数据库信心,在更新数据的时候不会再次加载数据 { base.Bind_Updata(GridViewShowCraftList, mProcessCraftMgtL.SList_Craft(), UpdatePanel_List_Craft); //初始化成员数据变量; BlInto_S_Search = false; BlIs_Close_ADD = false; IntCurrentPageIndex = 0; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { //检查权限 //if (base.CheckRoleCanMaintain("异常原因现象选项维护") == false) //{ // if (base.CheckRoleCanLook("异常原因现象选项查看") == true) // { // //令几个控件不能显示 // GridViewShowErrorOptionList.Columns[3].Visible = false; // GridViewShowErrorOptionList.Columns[4].Visible = false; // Asp_Input_AddNewErrorOption.Visible = false; // } // else // { // Response.Redirect("~/Default.aspx"); // } //} mCollectWebControlListLook = new List <CollectWebControl>(); mCollectWebControlListMaintain = new List <CollectWebControl>(); mCollectWebControlListLook.Add(new CollectWebControl(GridViewShowErrorOptionList.Columns[3])); mCollectWebControlListLook.Add(new CollectWebControl(GridViewShowErrorOptionList.Columns[4])); mCollectWebControlListLook.Add(new CollectWebControl(Asp_Input_AddNewErrorOption)); UserStat mProductErrorInfoStatLook = new ProductErrorInfoLook(mCollectWebControlListLook); UserStat mProductErrorInfoStatMaintain = new ProductErrorInfoStatMaintain(mCollectWebControlListMaintain); UserRole mUserRole = new UserRole(mProductErrorInfoStatMaintain, this); mProductErrorInfoStatMaintain.SetNextStat(mProductErrorInfoStatLook, mUserRole); mUserRole.CheckRole(); if (!Page.IsPostBack)//保证页面第一次加载的时候会加载数据库信心,在更新数据的时候不会再次加载数据 { //Bind_Updata(GridViewShowErrorOptionList, mProSeriesInfo_ProErrorTypeL.SList_ProErrorSeries(), UpdatePanel_List_ErrorOption); base.Bind_Updata(GridViewShowErrorOptionList, mProSeriesInfo_ProErrorTypeL.SList_ProErrorSeries(), UpdatePanel_List_ErrorOption); //初始化成员数据变量; BlInto_S_Search = false; BlIs_Close_ADD = false; IntCurrentPageIndex = 0; DropDownList1.DataSource = erl.S_WOError_Rework_PBCraft(); DropDownList1.DataTextField = "PBC_Name"; DropDownList1.DataValueField = "PBC_ID"; DropDownList1.DataBind(); DropDownList1.Items.Insert(0, new ListItem("所有工序", "")); DropDownList2.DataSource = erl.S_WOError_Rework_PBCraft(); DropDownList2.DataTextField = "PBC_Name"; DropDownList2.DataValueField = "PBC_ID"; DropDownList2.DataBind(); DropDownList2.Items.Insert(0, new ListItem("请选择", "")); } }
public override bool CheckRoleBelong(UserRole user, string CurrentStat) { if (CurrentStat.Contains("工序维护") == true) { foreach (CollectWebControl m in base.CollectWebControlList) { m.SetVisible(true); } return(true); } else { user.CurrentUserStat = base.mNextStat; user.CheckRole(); return(false); } }