protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.txtUserName.Attributes["ReadOnly"] = "true"; if (base.Request["action"].ToString() == "update") { DataTable corpRole = FlowRoleAction.GetCorpRole(base.Request["uid"].ToString()); this.hfldUserCode.Value = corpRole.Rows[0]["UserCode"].ToString(); this.txtUserName.Text = corpRole.Rows[0]["v_xm"].ToString(); string text = corpRole.Rows[0]["CorpCode"].ToString(); string[] t = ( from c in text.Split(new char[] { ',' }) where c.Length > 1 select c).ToArray <string>(); this.hfldCorpCode.Value = JsonHelper.JsonSerializer <string[]>(t); DataTable corpTable = FlowRoleAction.GetCorpTable(corpRole.Rows[0]["CorpCode"].ToString()); this.gvCorpList.DataSource = corpTable; this.gvCorpList.DataBind(); return; } DataTable dataSource = new DataTable(); this.gvCorpList.DataSource = dataSource; this.gvCorpList.DataBind(); } }
private void dgdRoleList_Bind() { int roleType = System.Convert.ToInt32(this.ddlRoleType.SelectedValue); this.dgdRoleList.DataSource = FlowRoleAction.QueryAllRole(roleType); this.dgdRoleList.DataBind(); }
private void dgdRole_Bind() { DataTable dataSource = FlowRoleAction.QueryAllRole(this.RoleType); this.dgdRole.DataSource = dataSource; this.dgdRole.DataBind(); }
protected void BtnSave_Click(object sender, System.EventArgs e) { bool flag = true; bool flag2 = false; string[] array = this.hdnUserCode.Value.Substring(0, this.hdnUserCode.Value.Length - 1).Split(new char[] { ',' }); for (int i = 0; i < array.Length; i++) { if (!FlowRoleAction.IsSameUser(this.RoleID, array[i])) { flag = FlowRoleAction.AddUser(this.RoleID, array[i], "00"); } if (!flag) { break; } } if (flag) { base.RegisterScript("top.ui.tabSuccess({ parentName: '_roleuser' });"); return; } if (flag2) { base.RegisterScript("top.ui.tabError();"); } }
private void BtnAdd_Click(object sender, System.EventArgs e) { string text = this.txtRoleName.Text; string text2 = this.txtRemark.Text; int roleType = System.Convert.ToInt32(this.ddlRoleType.SelectedValue); if (this.RoleID == 0) { if (FlowRoleAction.AddRole(text, roleType, text2)) { base.RegisterScript("successed();"); return; } base.RegisterScript("top.ui.alert('保存失败');"); return; } else { if (FlowRoleAction.UpdRole(this.RoleID, text, roleType, text2)) { base.RegisterScript("successed();"); return; } base.RegisterScript("top.ui.alert('保存失败');"); return; } }
protected void dgdRoleList_PageIndexChanged(object source, DataGridPageChangedEventArgs e) { string a; int roleType; if ((a = base.Request["tp"]) != null) { if (a == "3") { roleType = 2; goto IL_3C; } if (a == "4") { roleType = 1; goto IL_3C; } } roleType = 3; IL_3C: if (this.dgdRoleList.PageCount == 1) { this.dgdRoleList.CurrentPageIndex = 1; } if (this.dgdRoleList.CurrentPageIndex > this.dgdRoleList.PageCount && this.dgdRoleList.PageCount > 2) { this.dgdRoleList.CurrentPageIndex = this.dgdRoleList.PageCount - 1; } else { this.dgdRoleList.CurrentPageIndex = e.NewPageIndex; } this.dgdRoleList.DataSource = FlowRoleAction.QueryAllRole(roleType); this.dgdRoleList.DataBind(); }
public void BindGv() { DataTable corpList = FlowRoleAction.GetCorpList(this.RoleID); this.gvCorpUser.DataSource = corpList; this.gvCorpUser.DataBind(); }
public void BindGV() { this.AspNetPager1.PageSize = NBasePage.pagesize; DataTable corpUserList = FlowRoleAction.GetCorpUserList(base.Request["bm"].ToString(), this.txtUserName.Text, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex); this.gvUser.DataSource = corpUserList; this.gvUser.DataBind(); }
protected void gvCorpUser_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView dataRowView = (DataRowView)e.Row.DataItem; e.Row.Attributes["id"] = this.gvCorpUser.DataKeys[e.Row.RowIndex].Value.ToString(); e.Row.Attributes["onclick"] = "doClickRow('" + dataRowView["Role_User_ID"].ToString() + "');"; e.Row.Cells[2].Text = FlowRoleAction.GetCorpNames(dataRowView["CorpCode"].ToString()); } }
private void btnDel_Click(object sender, System.EventArgs e) { int userId = System.Convert.ToInt32(this.hdnUserID.Value); if (FlowRoleAction.DelUser(userId)) { this.Page.RegisterClientScriptBlock("warn", "<script language=\"javascript\">alert('删除成功!');</script>"); } this.dgdUser_Bind(); }
private void RoleRestore(int roleId) { DataTable dataTable = FlowRoleAction.QueryOneRole(roleId); if (dataTable.Rows.Count == 1) { dataTable.Rows[0]["roletype"].ToString(); this.txtRoleName.Text = dataTable.Rows[0]["rolename"].ToString(); this.ddlRoleType.SelectedValue = dataTable.Rows[0]["roletype"].ToString(); this.txtRemark.Text = dataTable.Rows[0]["remark"].ToString(); } }
private void TVRole_Create() { this.TVRole.Nodes.Clear(); DataTable dataTable = FlowRoleAction.QueryAllRole(); for (int i = 1; i < 4; i++) { TreeNode treeNode = new TreeNode(); string text = ""; switch (i) { case 1: text = "项目相关"; break; case 2: text = "群组"; break; case 3: text = "部门相关"; break; } treeNode.Text = text; treeNode.Value = i.ToString(); this.TVRole.Nodes.Add(treeNode); DataRow[] array = dataTable.Select("RoleType=" + i.ToString()); if (array.Length > 0) { for (int j = 0; j < array.Length; j++) { DataRow dataRow = array[j]; TreeNode treeNode2 = new TreeNode(); treeNode2.Text = dataRow["RoleName"].ToString(); treeNode2.Value = i.ToString() + j; if (i == 1) { treeNode2.Value = "RoleProjectList.aspx?ri=" + dataRow["RoleID"].ToString(); } else if (i == 2) { treeNode2.Value = "RoleUser.aspx?ri=" + dataRow["RoleID"].ToString(); } else { treeNode2.Value = "RoleCorpUser.aspx?ri=" + dataRow["RoleID"].ToString(); } treeNode.ChildNodes.Add(treeNode2); } } } }
protected void btnSave_Click(object sender, System.EventArgs e) { if (!string.IsNullOrEmpty(base.Request.QueryString["bm"])) { string text = base.Request["bm"].ToString(); for (int i = 0; i < this.gvUser.Rows.Count; i++) { CheckBox checkBox = (CheckBox)this.gvUser.Rows[i].FindControl("cbBox"); if (checkBox.Checked && !FlowRoleAction.IsHaveCorpUser(this.gvUser.DataKeys[i].Value.ToString(), text)) { FlowRoleAction.AddUser(0, this.gvUser.DataKeys[i].Value.ToString(), text); } } } base.RegisterScript("parent.location=parent.location;divClose(parent);"); }
public void BindGv() { if (this.hfldCorpCode.Value.Length >= 2) { string text = this.hfldCorpCode.Value.Substring(1, this.hfldCorpCode.Value.Length - 2); text = text.Replace('"', '\''); DataTable corpTable = FlowRoleAction.GetCorpTable(text); this.gvCorpList.DataSource = corpTable; this.gvCorpList.DataBind(); return; } DataTable dataSource = new DataTable(); this.gvCorpList.DataSource = dataSource; this.gvCorpList.DataBind(); }
private void btnDel_Click(object sender, System.EventArgs e) { int roleId = System.Convert.ToInt32(this.hdnRoleID.Value); if (FlowRoleAction.IsHaveUser(roleId)) { this.Page.RegisterClientScriptBlock("warn", "<script language=\"javascript\">alert('该角色下有用户,不允许删除!');</script>"); } else { if (FlowRoleAction.DelRole(roleId)) { this.Page.RegisterClientScriptBlock("warn", "<script language=\"javascript\">alert('删除成功!');parent.location.reload();</script>"); } } this.dgdRole_Bind(); }
protected void btnSave_Click(object sender, System.EventArgs e) { string text = string.Empty; System.Collections.Generic.List <string> list = JsonHelper.JsonDeserialize <string[]>(this.hfldCorpCode.Value).ToList <string>(); foreach (string current in list) { text = text + current + ","; } text = text.Substring(0, text.Length - 1); if (base.Request["action"].ToString() == "update") { string roleUserId = base.Request["uid"].ToString(); if (string.IsNullOrEmpty(this.hfldUserCode.Value) || string.IsNullOrEmpty(text)) { base.RegisterScript("top.ui.alert('没有选择人员或所负责的部门为空')"); return; } bool flag = FlowRoleAction.UpdateCorpUser(roleUserId, this.hfldUserCode.Value, text); if (flag) { base.RegisterScript("top.ui.tabSuccess({parentName: '_rolecorpuser'});"); return; } base.RegisterScript("top.ui.tabError();"); return; } else { int roleId = System.Convert.ToInt32(base.Request["rid"].ToString()); if (string.IsNullOrEmpty(this.hfldUserCode.Value) || string.IsNullOrEmpty(text)) { base.RegisterScript("top.ui.alert('没有选择人员或所负责的部门为空')"); return; } bool flag2 = FlowRoleAction.AddUser(roleId, this.hfldUserCode.Value, text); if (flag2) { base.RegisterScript("top.ui.tabSuccess({parentName: '_rolecorpuser'});"); return; } base.RegisterScript("top.ui.tabError();"); return; } }
private void dgdRoleList_Bind(int roleType) { base.Response.Cache.SetNoStore(); this.dgdRoleList.DataSource = FlowRoleAction.QueryAllRole(roleType); this.dgdRoleList.DataBind(); }
private void Bind_Duty(string UserCode) { this.GVDuty.DataSource = FlowRoleAction.GetUserInfo(UserCode); this.GVDuty.DataBind(); }
private void dgdUser_Bind() { this.dgdUser.DataSource = FlowRoleAction.QueryRoleUser(this.RoleID); this.dgdUser.DataBind(); }