private void RenderProperties(ITable table)
        {
            Condor.Core.Property prop = null;
            foreach (IColumn c in table.Columns)
            {
                prop = new BusinessObjectsPropertyRenderDataAnnotations(c, _context);
                prop.Render();
            }
            BusinessObjectsPropertiesRenderForeignKey foreignKey = new BusinessObjectsPropertiesRenderForeignKey(table, _context);

            foreignKey.Render();
        }
Exemple #2
0
        private void RenderProperties(ITable table)
        {
            Condor.Core.Property prop = null;
            foreach (IColumn c in table.Columns)
            {
                prop = new WcfPropertyRenderDto(c, _context);
                prop.Render();
            }

            WcfForeignKeyPropertiesDtos dtos = new WcfForeignKeyPropertiesDtos(table, _context);

            dtos.Render();
        }
        private void RenderProperties(ITable table)
        {
            //_context.FileList.Add("      Inside RenderProperties method...");
            Condor.Core.Property prop = null;
            foreach (IColumn c in table.Columns)
            {
                //_context.FileList.Add("      Processing column '" + c.Name + "'");
                prop = new BusinessObjectsPropertyRenderDataAnnotationsForDbContext(c, _context);
                prop.Render();
            }
            BusinessObjectsPropertiesRenderForeignKeyForDbContext foreignKey = new BusinessObjectsPropertiesRenderForeignKeyForDbContext(table, _context);

            foreignKey.Render();
        }
        public void BuildModelClass(ITable table, bool useWebService)
        {
            _hdrUtil.WriteClassHeader(_output);

            _output.autoTabLn("using System;");
            _output.autoTabLn("using System.Web.Mvc;");
            _output.autoTabLn("using System.ComponentModel;");
            _output.autoTabLn("using System.ComponentModel.DataAnnotations;");
            _output.autoTabLn("using System.Collections.Generic;");
            _output.autoTabLn("");
            if (useWebService)
            {
                _output.autoTabLn("using " + _script.Settings.UI.UIWcfServiceNamespace + ";");
            }
            else
            {
                _output.autoTabLn("using " + _script.Settings.BusinessObjects.BusinessObjectsNamespace + ";");
            }
            _output.autoTabLn("");
            _output.autoTabLn("namespace " + _script.Settings.UI.UINamespace + ".Models");
            _output.autoTabLn("{");
            _output.tabLevel++;
            _output.autoTabLn("public class " + StringFormatter.CleanUpClassName(table.Name) + "Model");
            _output.autoTabLn("{");
            _output.tabLevel++;
            _output.autoTabLn("");

            Condor.Core.Property prop = null;
            foreach (IColumn c in table.Columns)
            {
                prop = new BusinessObjectsPropertyRenderDataAnnotations(c, _context);
                prop.Render();
            }
            BusinessObjectsPropertiesRenderForeignKey foreignKey = new BusinessObjectsPropertiesRenderForeignKey(table, _context);

            foreignKey.Render();


            _output.autoTabLn("");
            _output.tabLevel--;
            _output.autoTabLn("}");
            _output.tabLevel--;
            _output.autoTabLn("}");

            _context.FileList.Add("    " + StringFormatter.CleanUpClassName(table.Name) + "Model.cs");
            SaveOutput(CreateFullPath(_script.Settings.UI.UINamespace + "\\Models", StringFormatter.CleanUpClassName(table.Name) + "Model.cs"), SaveActions.DontOverwrite);
        }
Exemple #5
0
        public void TestMethod1()
        {
            // Arrange
            ITable   table   = null;
            IColumns columns = new CategoryColumns();

            columns.Add(new IdentityColumn(table));
            columns.Add(new DateTimeColumn(table));
            columns.Add(new CategoryNameColumn(table));

            table = new CategoryTable(columns, null);

            RequestContext context = new RequestContext();

            context.Zeus = new TempZeusContext();
            //context.ScriptSettings = new ScriptSettings(null, null, null, null);

            Condor.Core.Property prop = null;
            foreach (IColumn c in table.Columns)
            {
                prop = new BusinessObjectsPropertyRenderDataAnnotationsForDbContext(c, context);
                prop.Render();
            }
        }