internal void FireRemoveMatrixMergeableRows(SOARolePropertyRowUsersCollection rowsUsers, WfMergeMatrixRowParams eventArgs)
 {
     if (RemoveMatrixMergeableRows != null)
     {
         RemoveMatrixMergeableRows(rowsUsers, eventArgs);
     }
 }
Example #2
0
        public void RoleMatrixUsersTest()
        {
            IRole role = GetTestRole();

            SOARole soaRole = SOARoleHelper.PrepareSOARole(role);

            SOARolePropertyRowUsersCollection rowsUsers = soaRole.Rows.GenerateRowsUsers();

            //输出每一行中的每一个人,也包括指定的列
            Output(rowsUsers);
        }
Example #3
0
        private static void Output(SOARolePropertyRowUsersCollection rowsUsers)
        {
            foreach (SOARolePropertyRowUsers rowUsers in rowsUsers)
            {
                Console.Write("CostCenter: {0} ", rowUsers.Row.Values.GetValue("CostCenter", string.Empty));

                foreach (IUser user in rowUsers.Users)
                {
                    Console.Write("User Name: {0} ", user.DisplayName);
                }

                Console.WriteLine();
            }
        }
		internal void FireRemoveMatrixMergeableRows(SOARolePropertyRowUsersCollection rowsUsers, WfMergeMatrixRowParams eventArgs)
		{
			if (RemoveMatrixMergeableRows != null)
				RemoveMatrixMergeableRows(rowsUsers, eventArgs);
		}
        private void PrepareUserContainers(string roleID, SOARolePropertyRowUsersCollection rowsUsers, StringBuilder strB)
        {
            foreach (SOARolePropertyRowUsers rowUsers in rowsUsers)
            {
                foreach (IUser user in rowUsers.Users)
                {
                    InsertSqlClauseBuilder builder = new InsertSqlClauseBuilder();

                    strB.Append(TSqlBuilder.Instance.DBStatementSeperator);

                    builder.AppendItem("ROLE_ID", roleID);
                    builder.AppendItem("ROW_NUMBER", rowUsers.Row.RowNumber);
                    builder.AppendItem("OPERATOR_TYPE", (int)rowUsers.Row.OperatorType);
                    builder.AppendItem("OPERATOR_ID", user.ID);
                    builder.AppendItem("OPERATOR_NAME", user.DisplayName.IsNotEmpty() ? user.DisplayName : user.Name);

                    builder.AppendTenantCode();

                    string sql = string.Format("INSERT INTO WF.ROLE_PROPERTIES_USER_CONTAINERS {0}", builder.ToSqlString(TSqlBuilder.Instance));

                    strB.Append(sql);
                }
            }
        }