Esempio n. 1
0
        internal void FillMatrixRows(string matrixID, WfMatrixRowCollection rows)
        {
            WhereSqlClauseBuilder whereBuilder = new WhereSqlClauseBuilder();

            whereBuilder.AppendItem("R." + DB_FIELD_MATRIX_ID, matrixID);
            whereBuilder.AppendTenantCode("R.TENANT_CODE");

            DataSet ds = DbHelper.RunSqlReturnDS(SELECT_SQL_CLAUSE + whereBuilder.ToSqlString(TSqlBuilder.Instance));

            rows.CopyFrom(ds.Tables[0].DefaultView);
        }
Esempio n. 2
0
        internal void GenerateCandidatesFromMatrix(WfMatrix matrix)
        {
            WfMatrixRowCollection rows = FilterRowsByActivity(matrix);

            WfMatrixRowUsersCollection rowsUsers = rows.GenerateRowsUsers();

            foreach (WfMatrixRowUsers ru in rowsUsers)
            {
                this.Candidates.Add(ru.Users);
            }

            Candidates.Distinct((a1, a2) => string.Compare(a1.User.ID, a2.User.ID, true) == 0 && a1.AssigneeType == a2.AssigneeType);
        }
Esempio n. 3
0
        private WfMatrixRowCollection FilterRowsByActivity(WfMatrix matrix)
        {
            WfMatrixRowCollection result = new WfMatrixRowCollection();

            if (matrix.Definition.Dimensions.ContainsKey("ActivityKey"))
            {
                foreach (WfMatrixRow row in matrix.Rows)
                {
                    if (string.Compare(row.Cells.GetValue("ActivityKey", string.Empty), this.Descriptor.Key, true) == 0)
                    {
                        result.Add(row);
                    }
                }
            }

            return(result);
        }