protected void GridDpt_RowCommand(object sender, GridCommandEventArgs e) { int deptID = GetSelectedDataKeyID(GridDpt); if (e.CommandName == "Delete") { BLL.tUsers BLL = new Maticsoft.BLL.tUsers(); bool isTrue = BLL.Delete(deptID); if (!isTrue) { Alert.ShowInTop("删除失败!"); return; } else { BindTree(); LoadData(); } } if (e.CommandName == "Edit") { this.Window1.Title = "用户管理"; string openUrl = String.Format("./UserEdit.aspx?userId={0}", HttpUtility.UrlEncode(deptID.ToString())); PageContext.RegisterStartupScript(Window1.GetSaveStateReference(deptID.ToString()) + Window1.GetShowReference(openUrl)); } }
protected void LoadData() { //Alert.ShowInTop(TreeDpt.SelectedNodeID); Maticsoft.BLL.tUsers BLL = new Maticsoft.BLL.tUsers(); DataTable dt = null; TreeUser.Nodes.Clear(); if (TreeDpt.SelectedNodeID == "" || TreeDpt.SelectedNodeID == "10000") { dt = BLL.GetAllList().Tables[0]; } else { string NodeId = TreeDpt.SelectedNodeID; dt = BLL.GetList(" dptId=" + NodeId).Tables[0]; } foreach (DataRow row in dt.Rows) { FineUIPro.TreeNode node = new FineUIPro.TreeNode(); node.NodeID = row["userId"].ToString(); node.Text = row["usersName"].ToString(); node.EnableClickEvent = true; TreeUser.Nodes.Add(node); } }
protected void LoadData() { Maticsoft.BLL.tUsers BLL = new Maticsoft.BLL.tUsers(); string sortField = GridDpt.SortField; string sortDirection = GridDpt.SortDirection; if (TreeDpt.SelectedNode == null) { GridDpt.RecordCount = BLL.GetRecordCount(""); DataView view = BLL.GetListByPage("", " userId asc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); } else { string NodeId = TreeDpt.SelectedNodeID; GridDpt.RecordCount = BLL.GetRecordCount(" dptId=" + NodeId); DataView view = BLL.GetListByPage(" dptId=" + NodeId, " userId asc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); } GridDpt.DataBind(); }