protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //首次進入 if (!AclExpress.IsAclAdminUser()) { divError.Visible = true; DivMainList.Visible = false; DivMainSingle.Visible = false; DivDetailArea.Visible = false; labErrMsg.Text = Util.getHtmlMessage(Util.HtmlMessageKind.Error, AclRS.Resources.Msg_AclAdminDeny); return; } //強制顯示主檔清單 _IsADD = false; _RuleID = ""; _AreaID = ""; _GrantID = ""; Refresh(true); } //彈出視窗 事件訂閱 ucModalPopup1.onClose += ucModalPopup1_onClose; //主檔清單 事件訂閱 ucGridMain.RowCommand += ucGridMain_RowCommand; //明細檔清單 訂閱 RowCommand 事件 ucGridDetail.RowCommand += ucGridDetail_RowCommand; }
protected void Page_Load(object sender, EventArgs e) { if (ucAclInfo == null) { divAclInfo.Visible = false; labErrMsg.Visible = true; labErrMsg.Text = Util.getHtmlMessage(Util.HtmlMessageKind.Error, string.Format(RS.Resources.Msg_ParaNotFound1, "ucAclInfo")); } if (!IsPostBack) { if (AclExpress.IsAclAdminUser()) { tab03.Visible = true; } else { tab03.Visible = false; } } }
public void RefreshTreeView() { TreeView1.Nodes.Clear(); TreeNode tRootNode = new TreeNode(); tRootNode.Text = "ACL資料查詢"; tRootNode.NavigateUrl = string.Format(_ContentUrlFormat, AclExpress._AclSysPath + "AclInfo.aspx"); tRootNode.PopulateOnDemand = false; tRootNode.Expanded = true; TreeView1.Nodes.Add(tRootNode); //管理專用 if (AclExpress.IsAclAdminUser()) { //Acl 管理員專用 TreeNode tManageNode = new TreeNode(); tManageNode.Text = "管理作業"; tManageNode.Expanded = true; tManageNode.SelectAction = TreeNodeSelectAction.Expand; tRootNode.ChildNodes.Add(tManageNode); TreeNode tBaseNode = new TreeNode(); tBaseNode.Text = "基本資料"; tBaseNode.Expanded = true; tBaseNode.SelectAction = TreeNodeSelectAction.Expand; tManageNode.ChildNodes.Add(tBaseNode); TreeNode tChildNode = new TreeNode(); tChildNode.Text = "區域資料(AclArea)"; tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, "AclArea.aspx"); tBaseNode.ChildNodes.Add(tChildNode); tChildNode = new TreeNode(); tChildNode.Text = "規則資料(AclRule)"; tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, "AclRule.aspx"); tBaseNode.ChildNodes.Add(tChildNode); TreeNode tAdminNode = new TreeNode(); tAdminNode.Text = "管理權"; tAdminNode.Expanded = true; tAdminNode.SelectAction = TreeNodeSelectAction.Expand; tManageNode.ChildNodes.Add(tAdminNode); tChildNode = new TreeNode(); tChildNode.Text = "規則<->區域(AclAdminRuleArea)"; //AclAdminRuleArea tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, "AclAdminRuleArea.aspx"); tAdminNode.ChildNodes.Add(tChildNode); tChildNode = new TreeNode(); tChildNode.Text = "使用者<->區域(AclAdminUserArea)"; //AclAdminUserArea tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, "AclAdminUserArea.aspx"); tAdminNode.ChildNodes.Add(tChildNode); tAdminNode = new TreeNode(); tAdminNode.Text = "使用權"; tAdminNode.Expanded = true; tAdminNode.SelectAction = TreeNodeSelectAction.Expand; tManageNode.ChildNodes.Add(tAdminNode); tChildNode = new TreeNode(); tChildNode.Text = "規則<->區域(AclAuthRuleArea)"; //AclAuthRuleArea tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, "AclAuthRuleArea.aspx"); tAdminNode.ChildNodes.Add(tChildNode); tChildNode = new TreeNode(); tChildNode.Text = "使用者<->區域(AclAuthUserArea)"; //AclAuthUserArea tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, "AclAreaSelect.aspx"); tAdminNode.ChildNodes.Add(tChildNode); tAdminNode = new TreeNode(); tAdminNode.Text = "工具"; tAdminNode.Expanded = true; tAdminNode.SelectAction = TreeNodeSelectAction.Expand; tManageNode.ChildNodes.Add(tAdminNode); tChildNode = new TreeNode(); tChildNode.Text = "CodeMap"; tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, string.Format("{0}?DBName={1}&LogDBName={2}", Util._CodeMapAdminUrl, AclExpress._AclDBName, AclExpress._AclLogDBName)); tAdminNode.ChildNodes.Add(tChildNode); tChildNode = new TreeNode(); tChildNode.Text = "AppLog"; tChildNode.PopulateOnDemand = false; tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, string.Format("{0}?DBName={1}&AllowPurgeYN=Y", Util._AppLogQryUrl, AclExpress._AclDBName)); tAdminNode.ChildNodes.Add(tChildNode); } //一般授權作業 string[] tAreaList = AclInfo.getAclInfo().getAdminAreaList(); if (tAreaList != null && tAreaList.Length > 0) { string[] tGrantIDList = AclInfo.getAclInfo().getAdminAreaGrantList(tAreaList[0]); if (tGrantIDList != null && !string.IsNullOrEmpty(tGrantIDList[0])) { //確定有資料才產生 TreeNode TreeNode tAreaNode = new TreeNode(); tAreaNode.Text = "一般授權"; tAreaNode.Expanded = true; tAreaNode.SelectAction = TreeNodeSelectAction.Expand; tRootNode.ChildNodes.Add(tAreaNode); DataTable dtArea = AclExpress.getAclAreaData().Select(string.Format(" AreaID in ('{0}') and IsEnabled = 'Y' ", Util.getStringJoin(tAreaList, "','"))).CopyToDataTable(); if (dtArea != null && dtArea.Rows.Count > 0) { for (int i = 0; i < dtArea.Rows.Count; i++) { DataRow dr = dtArea.Rows[i]; //AreaID 節點 TreeNode tChildNode = new TreeNode(); tChildNode.PopulateOnDemand = false; tChildNode.Text = string.Format("{0}【{1}】", dr["AreaID"], dr["AreaName"]); tChildNode.NavigateUrl = string.Format(_ContentUrlFormat, string.Format("{0}?AreaID={1}&IsDebug=Y", AclExpress._AclSysPath + "AclAuthUserArea.aspx", dr["AreaID"])); tChildNode.Expanded = false; tChildNode.SelectAction = TreeNodeSelectAction.Select; tAreaNode.ChildNodes.Add(tChildNode); //AddStepNodes(tSpecNode, dr["FlowID"].ToString()); } } } } }