Exemple #1
0
        public static void AreSame(this WfClientRolePropertyRowCollection expected, SOARolePropertyRowCollection actual)
        {
            Assert.AreEqual(expected.Count, actual.Count);

            for (int i = 0; i < expected.Count; i++)
            {
                AreSame(expected[i], actual[i]);
            }
        }
Exemple #2
0
        public static void FillMatrixSheetData(this IWfClientMatrixContainer matrix, WorkSheet sheet)
        {
            matrix.NullCheck("matrix");
            sheet.NullCheck("sheet");

            int rowIndex = 4;
            WfClientRolePropertyRowCollection rows = matrix.Rows;

            foreach (WfClientRolePropertyRow row in rows)
            {
                foreach (DefinedName name in sheet.Names)
                {
                    var propertyValue = row.Values.FindByColumnName(name.Name);

                    object dataValue = null;

                    if (propertyValue != null)
                    {
                        if (propertyValue.Column.DataType != Data.DataObjects.ColumnDataType.String)
                        {
                            dataValue = DataConverter.ChangeType(typeof(string),
                                                                 propertyValue.Value,
                                                                 propertyValue.Column.RealDataType);
                        }
                        else
                        {
                            dataValue = propertyValue.Value;
                        }
                    }
                    else
                    {
                        if (matrix.MatrixType != WfClientMatrixType.ApprovalMatrix)
                        {
                            switch (name.Name.ToLower())
                            {
                            case "operatortype":
                                dataValue = row.OperatorType.ToString();
                                break;

                            case "operator":
                                dataValue = row.Operator;
                                break;
                            }
                        }
                    }

                    if (dataValue != null)
                    {
                        sheet.Cells[rowIndex, name.Address.StartColumn].Value = dataValue;
                    }
                }

                rowIndex++;
            }
        }
Exemple #3
0
        private static void FillMatrixSheetData(WfClientActivityMatrixResourceDescriptor matrix, WorkSheet ws)
        {
            int rowIndex = 4;
            WfClientRolePropertyRowCollection rows = matrix.Rows;

            foreach (WfClientRolePropertyRow row in rows)
            {
                foreach (DefinedName name in ws.Names)
                {
                    var propertyValue = row.Values.FindByColumnName(name.Name);

                    object dataValue = null;

                    if (propertyValue != null)
                    {
                        if (propertyValue.Column.DataType != Data.DataObjects.ColumnDataType.String)
                        {
                            dataValue = DataConverter.ChangeType(typeof(string)
                                                                 , propertyValue.Value
                                                                 , propertyValue.Column.RealDataType);
                        }
                        else
                        {
                            dataValue = propertyValue.Value;
                        }
                    }
                    else
                    {
                        switch (name.Name.ToLower())
                        {
                        case "operatortype":
                            dataValue = row.OperatorType.ToString();
                            break;

                        case "operator":
                            dataValue = row.Operator;
                            break;
                        }
                    }

                    if (dataValue != null)
                    {
                        ws.Cells[rowIndex, name.Address.StartColumn].Value = dataValue;
                    }
                }

                rowIndex++;
            }
        }
        private static WfClientRolePropertyRowCollection PrepareClientRows(WfClientRolePropertyDefinitionCollection pds)
        {
            WfClientRolePropertyRowCollection rows = new WfClientRolePropertyRowCollection();

            WfClientRolePropertyRow row1 = new WfClientRolePropertyRow()
            {
                RowNumber = 1, OperatorType = WfClientRoleOperatorType.User, Operator = "fanhy"
            };

            row1.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"])
            {
                Value = "1001"
            });
            row1.Values.Add(new WfClientRolePropertyValue(pds["PayMethod"])
            {
                Value = "1"
            });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Age"])
            {
                Value = "30"
            });

            WfClientRolePropertyRow row2 = new WfClientRolePropertyRow()
            {
                RowNumber = 2, OperatorType = WfClientRoleOperatorType.User, Operator = "wangli5"
            };

            row2.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"])
            {
                Value = "1002"
            });
            row2.Values.Add(new WfClientRolePropertyValue(pds["PayMethod"])
            {
                Value = "2"
            });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Age"])
            {
                Value = "40"
            });

            rows.Add(row1);
            rows.Add(row2);

            return(rows);
        }
        private static WfClientRolePropertyRowCollection PrepareClientRows(WfClientRolePropertyDefinitionCollection pds)
        {
            WfClientRolePropertyRowCollection rows = new WfClientRolePropertyRowCollection();

            WfClientRolePropertyRow row1 = new WfClientRolePropertyRow() { RowNumber = 1, OperatorType = WfClientRoleOperatorType.User, Operator = "fanhy" };

            row1.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"]) { Value = "1001" });
            row1.Values.Add(new WfClientRolePropertyValue(pds["PayMethod"]) { Value = "1" });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Age"]) { Value = "30" });

            WfClientRolePropertyRow row2 = new WfClientRolePropertyRow() { RowNumber = 2, OperatorType = WfClientRoleOperatorType.User, Operator = "wangli5" };

            row2.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"]) { Value = "1002" });
            row2.Values.Add(new WfClientRolePropertyValue(pds["PayMethod"]) { Value = "2" });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Age"]) { Value = "40" });

            rows.Add(row1);
            rows.Add(row2);

            return rows;
        }
        public static void AreSame(this WfClientRolePropertyRowCollection expected, WfClientRolePropertyRowCollection actual)
        {
            Assert.AreEqual(expected.Count, actual.Count);

            for (int i = 0; i < expected.Count; i++)
            {
                AreSame(expected[i], actual[i]);
            }
        }
        private static WfClientRolePropertyRowCollection PrepareClientRows(WfClientRolePropertyDefinitionCollection pds)
        {
            WfClientRolePropertyRowCollection rows = new WfClientRolePropertyRowCollection();

            WfClientRolePropertyRow row1 = new WfClientRolePropertyRow() { RowNumber = 1, OperatorType = WfClientRoleOperatorType.User };

            row1.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"]) { Value = "1001" });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Approver1"]) { Value = "yangrui1" });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Approver2"]) { Value = "quym" });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Approver3"]) { Value = "liming" });

            WfClientRolePropertyRow row2 = new WfClientRolePropertyRow() { RowNumber = 2, OperatorType = WfClientRoleOperatorType.User };

            row2.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"]) { Value = "1002" });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Approver1"]) { Value = string.Empty });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Approver2"]) { Value = "quym" });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Approver3"]) { Value = "liming" });

            WfClientRolePropertyRow row3 = new WfClientRolePropertyRow() { RowNumber = 3, OperatorType = WfClientRoleOperatorType.User };

            row3.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"]) { Value = "1003" });
            row3.Values.Add(new WfClientRolePropertyValue(pds["Approver1"]) { Value = string.Empty });
            row3.Values.Add(new WfClientRolePropertyValue(pds["Approver2"]) { Value = string.Empty });
            row3.Values.Add(new WfClientRolePropertyValue(pds["Approver3"]) { Value = "liming" });

            WfClientRolePropertyRow row4 = new WfClientRolePropertyRow() { RowNumber = 4, OperatorType = WfClientRoleOperatorType.User };

            row4.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"]) { Value = "1003" });
            row4.Values.Add(new WfClientRolePropertyValue(pds["Approver1"]) { Value = "yangrui1" });
            row4.Values.Add(new WfClientRolePropertyValue(pds["Approver2"]) { Value = string.Empty });
            row4.Values.Add(new WfClientRolePropertyValue(pds["Approver3"]) { Value = "liming" });

            rows.Add(row1);
            rows.Add(row2);
            rows.Add(row3);
            rows.Add(row4);

            return rows;
        }
Exemple #8
0
        private static WfClientRolePropertyRowCollection PrepareClientRows(WfClientRolePropertyDefinitionCollection pds)
        {
            WfClientRolePropertyRowCollection rows = new WfClientRolePropertyRowCollection();

            WfClientRolePropertyRow row1 = new WfClientRolePropertyRow()
            {
                RowNumber = 1, OperatorType = WfClientRoleOperatorType.User
            };

            row1.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"])
            {
                Value = "1001"
            });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Approver1"])
            {
                Value = "yangrui1"
            });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Approver2"])
            {
                Value = "quym"
            });
            row1.Values.Add(new WfClientRolePropertyValue(pds["Approver3"])
            {
                Value = "liming"
            });

            WfClientRolePropertyRow row2 = new WfClientRolePropertyRow()
            {
                RowNumber = 2, OperatorType = WfClientRoleOperatorType.User
            };

            row2.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"])
            {
                Value = "1002"
            });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Approver1"])
            {
                Value = string.Empty
            });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Approver2"])
            {
                Value = "quym"
            });
            row2.Values.Add(new WfClientRolePropertyValue(pds["Approver3"])
            {
                Value = "liming"
            });

            WfClientRolePropertyRow row3 = new WfClientRolePropertyRow()
            {
                RowNumber = 3, OperatorType = WfClientRoleOperatorType.User
            };

            row3.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"])
            {
                Value = "1003"
            });
            row3.Values.Add(new WfClientRolePropertyValue(pds["Approver1"])
            {
                Value = string.Empty
            });
            row3.Values.Add(new WfClientRolePropertyValue(pds["Approver2"])
            {
                Value = string.Empty
            });
            row3.Values.Add(new WfClientRolePropertyValue(pds["Approver3"])
            {
                Value = "liming"
            });

            WfClientRolePropertyRow row4 = new WfClientRolePropertyRow()
            {
                RowNumber = 4, OperatorType = WfClientRoleOperatorType.User
            };

            row4.Values.Add(new WfClientRolePropertyValue(pds["CostCenter"])
            {
                Value = "1003"
            });
            row4.Values.Add(new WfClientRolePropertyValue(pds["Approver1"])
            {
                Value = "yangrui1"
            });
            row4.Values.Add(new WfClientRolePropertyValue(pds["Approver2"])
            {
                Value = string.Empty
            });
            row4.Values.Add(new WfClientRolePropertyValue(pds["Approver3"])
            {
                Value = "liming"
            });

            rows.Add(row1);
            rows.Add(row2);
            rows.Add(row3);
            rows.Add(row4);

            return(rows);
        }