private static string PrepareValueSql(string roleID, SOARolePropertyRow row, SOARolePropertyValue propValue)
        {
            InsertSqlClauseBuilder builder = ORMapping.GetInsertSqlClauseBuilder(propValue);

            builder.AppendItem("ROLE_ID", roleID);
            builder.AppendItem("PROPERTIES_ROW_ID", row.RowNumber);
            builder.AppendItem("PROPERTY_NAME", propValue.Column.Name);

            return("INSERT INTO WF.ROLE_PROPERTIES_CELLS" + builder.ToSqlString(TSqlBuilder.Instance));
        }
Esempio n. 2
0
        private static void FillSheetData(SOARole role, WorkSheet ws)
        {
            int rowIndex = 4;
            SOARolePropertyRowCollection rows = SOARolePropertiesAdapter.Instance.LoadByRole(role, role.PropertyDefinitions);

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

                    string dataValue = null;

                    if (propertyValue != null)
                    {
                        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++;
            }
        }