private void UpdateUserLastModifyDate() { IList <User> userList = TheUserRoleMgr.GetUsersByRoleCode(this.lbCode.Text); foreach (User user in userList) { user.LastModifyDate = DateTime.Now; user.LastModifyUser = this.CurrentUser; TheUserMgr.UpdateUser(user); } }
protected void ODS_User_Inserted(object sender, ObjectDataSourceStatusEventArgs e) { UserRole userRole = new UserRole(); userRole.Role = TheRoleMgr.LoadRole("everyone"); userRole.User = user; TheUserRoleMgr.CreateUserRole(userRole); if (CreateEvent != null) { CreateEvent(user.Code, e); ShowSuccessMessage("Security.User.AddUser.Successfully", user.Code); } }
protected void ToInBT_Click(object sender, EventArgs e) { List <Role> rList = new List <Role>(); foreach (ListItem item in this.CBL_NotInRole.Items) { if (item.Selected) { rList.Add(TheRoleMgr.LoadRole(item.Value)); } } if (rList.Count > 0) { TheUserRoleMgr.CreateUserRoles(TheUserMgr.LoadUser(this.lbCode.Text), rList); } this.CBL_NotInRole.DataBind(); this.CBL_InRole.DataBind(); this.cb_InRole.Checked = false; this.cb_NotInRole.Checked = false; UpdateUserLastModifyDate(); }
protected void ToOutBT_Click(object sender, EventArgs e) { List <UserRole> urList = new List <UserRole>(); foreach (ListItem item in this.CBL_InRole.Items) { if (item.Selected) { UserRole userRole = TheUserRoleMgr.LoadUserRole(this.lbCode.Text, item.Value); urList.Add(userRole); } } if (urList.Count > 0) { TheUserRoleMgr.DeleteUserRole(urList); } this.CBL_NotInRole.DataBind(); this.CBL_InRole.DataBind(); this.cb_InRole.Checked = false; this.cb_NotInRole.Checked = false; UpdateUserLastModifyDate(); }