• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Models.ModelRoot类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中nHydrate.Generator.Models.ModelRoot的典型用法代码示例。如果您正苦于以下问题:C# ModelRoot类的具体用法?C# ModelRoot怎么用?C# ModelRoot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ModelRoot类属于nHydrate.Generator.Models命名空间,在下文中一共展示了ModelRoot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SQLSelectStoredProcedureTemplate

 public SQLSelectStoredProcedureTemplate(ModelRoot model, CustomStoredProcedure currentStoredProcedure, bool useSingleFile, StringBuilder grantSB)
     : base(model)
 {
     _currentStoredProcedure = currentStoredProcedure;
     _useSingleFile = useSingleFile;
     _grantSB = grantSB;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:SQLSelectStoredProcedureTemplate.cs


示例2: NewModelWizardForm

		public NewModelWizardForm(ModelRoot root)
			: this()
		{
			_root = root;
			txtCompanyName.Text = _root.CompanyName;
			txtProjectName.Text = _root.ProjectName;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:NewModelWizardForm.cs


示例3: GetBody

            public static string GetBody(Table table, ModelRoot model)
            {
                try
                {
                    var allColumns = new List<Column>();
                    foreach (var column in table.GetColumnsFullHierarchy().Where(x => x.Generated).OrderBy(x => x.Name))
                    {
                        if (!(column.DataType == System.Data.SqlDbType.Binary ||
                            column.DataType == System.Data.SqlDbType.Image ||
                            column.DataType == System.Data.SqlDbType.NText ||
                            column.DataType == System.Data.SqlDbType.Text ||
                            column.DataType == System.Data.SqlDbType.Timestamp ||
                            column.DataType == System.Data.SqlDbType.Udt ||
                            column.DataType == System.Data.SqlDbType.VarBinary ||
                            column.DataType == System.Data.SqlDbType.Variant ||
                        column.DataType == System.Data.SqlDbType.Money))
                        {
                            allColumns.Add(column);
                        }
                    }

                    if (allColumns.Count != 0)
                    {
                        return BuildStoredProcedure(table, model, allColumns);
                    }

                    return "";

                }
                catch (Exception ex)
                {
                    throw new Exception(table.DatabaseName + ": Failed on generation of paging select statement", ex);
                }
            }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:34,代码来源:SQLGeneratedBodyHelper.cs


示例4: XSDSchemaTemplate

		public XSDSchemaTemplate(ModelRoot model, string schemaName, string rawFileName, bool droprelations)
			: base(model)
		{
			_rawFileName = rawFileName;
			_schemaName = schemaName;
			_droprelations = droprelations;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:XSDSchemaTemplate.cs


示例5: SQLStoredProcedureViewAllTemplate

 public SQLStoredProcedureViewAllTemplate(ModelRoot model, CustomView view, bool singleFile, StringBuilder grantSB)
     : base(model)
 {
     _view = view;
     _singleFile = singleFile;
     _grantSB = grantSB;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:7,代码来源:SQLStoredProcedureViewAllTemplate.cs


示例6: GetTableDatabaseName

 public static string GetTableDatabaseName(ModelRoot model, Table table)
 {
     var retval = model.Database.TablePrefix;
     if (!string.IsNullOrEmpty(retval))
         return retval + "_" + table.DatabaseName;
     else
         return table.DatabaseName;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:8,代码来源:Globals.cs


示例7: Populate

		public void Populate(ModelRoot model)
		{
			_model = model;
			_model.PropertyChanged += new PropertyChangedEventHandler(_model_PropertyChanged);
			this.LoadControls();

			#region Hook events
			txtCompanyName.Leave += new EventHandler(txtCompanyName_Leave);
			txtCompanyName.Enter += new EventHandler(txtCompanyName_Enter);
			txtCompanyName.KeyDown += new KeyEventHandler(txtCompanyName_KeyDown);

			txtCopyright.Leave += new EventHandler(txtCopyright_Leave);
			txtCopyright.Enter += new EventHandler(txtCopyright_Enter);
			txtCopyright.KeyDown += new KeyEventHandler(txtCopyright_KeyDown);

			txtDefaultNamespace.Leave += new EventHandler(txtDefaultNamespace_Leave);
			txtDefaultNamespace.Enter += new EventHandler(txtDefaultNamespace_Enter);
			txtDefaultNamespace.KeyDown += new KeyEventHandler(txtDefaultNamespace_KeyDown);

			txtProjectName.Leave += new EventHandler(txtProjectName_Leave);
			txtProjectName.Enter += new EventHandler(txtProjectName_Enter);
			txtProjectName.KeyDown += new KeyEventHandler(txtProjectName_KeyDown);

			txtStoredProcPrefix.Leave += new EventHandler(txtStoredProcPrefix_Leave);
			txtStoredProcPrefix.Enter += new EventHandler(txtStoredProcPrefix_Enter);
			txtStoredProcPrefix.KeyDown += new KeyEventHandler(txtStoredProcPrefix_KeyDown);

			txtVersion.Leave += new EventHandler(txtVersion_Leave);
			txtVersion.Enter += new EventHandler(txtVersion_Enter);
			txtVersion.KeyDown += new KeyEventHandler(txtVersion_KeyDown);

			chkCustomChangeEvents.CheckStateChanged += new EventHandler(chkCustomChangeEvents_CheckStateChanged);
			chkSupprtLegacySearch.CheckStateChanged += new EventHandler(chkSupprtLegacySearch_CheckStateChanged);
			chkTransformNames.CheckStateChanged += new EventHandler(chkTransformNames_CheckStateChanged);
			chkUseUTC.CheckStateChanged += new EventHandler(chkUseUTC_CheckStateChanged);
			#endregion

			#region Setup Tooltips
			toolTip1.SetToolTip(txtCompanyName, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "CompanyName"));
			toolTip1.SetToolTip(txtCopyright, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "Copyright"));
			toolTip1.SetToolTip(txtDefaultNamespace, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "DefaultNamespace"));
			toolTip1.SetToolTip(txtProjectName, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "ProjectName"));
			toolTip1.SetToolTip(txtStoredProcPrefix, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "StoredProcedurePrefix"));
			toolTip1.SetToolTip(txtVersion, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "Version"));
			toolTip1.SetToolTip(chkCustomChangeEvents, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "EnableCustomChangeEvents"));
			toolTip1.SetToolTip(chkSupprtLegacySearch, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "SupportLegacySearchObject"));
			toolTip1.SetToolTip(chkTransformNames, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "TransformNames"));
			toolTip1.SetToolTip(chkUseUTC, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "UseUTCTime"));
			toolTip1.SetToolTip(cboSQLServerType, ReflectionHelper.GetPropertyAttributeDescriptionValue(_model, "SQLServerType"));
			#endregion

		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:52,代码来源:ModelRootControllerUIControl.cs


示例8: GetSQLCreateTable

        public static string GetSQLCreateTable(ModelRoot model, Table table)
        {
            try
            {
                if (table.TypedTable == TypedTableConstants.EnumOnly)
                    return string.Empty;

                var sb = new StringBuilder();
                var tableName = Globals.GetTableDatabaseName(model, table);

                sb.AppendLine("--CREATE TABLE [" + table.DatabaseName + "]");
                sb.AppendLine("if not exists(select * from sysobjects where name = '" + tableName + "' and xtype = 'U')");
                sb.AppendLine("CREATE TABLE [" + table.GetSQLSchema() + "].[" + tableName + "] (");

                var firstLoop = true;
                foreach (var column in table.GeneratedColumns.OrderBy(x => x.SortOrder))
                {
                    if (!firstLoop) sb.AppendLine(",");
                    else firstLoop = false;
                    sb.Append("\t" + AppendColumnDefinition(column, allowDefault: true, allowIdentity: true));
                }
                AppendModifiedAudit(model, table, sb);
                AppendCreateAudit(model, table, sb);
                AppendTimestamp(model, table, sb);
                AppendTenantField(model, table, sb);

                //Emit PK
                var tableIndex = table.TableIndexList.FirstOrDefault(x => x.PrimaryKey);
                if (tableIndex != null)
                {
                    var indexName = "PK_" + table.DatabaseName.ToUpper();
                    sb.AppendLine(",");
                    sb.AppendLine("\t" + "CONSTRAINT [" + indexName + "] PRIMARY KEY " + (tableIndex.Clustered ? "CLUSTERED" : "NONCLUSTERED"));
                    sb.AppendLine("\t" + "(");
                    sb.AppendLine("\t\t" + Globals.GetSQLIndexField(table, tableIndex));
                    sb.AppendLine("\t" + ")");
                }
                else
                    sb.AppendLine();

                sb.AppendLine(")");
                return sb.ToString();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:48,代码来源:SQLEmit.cs


示例9: AppendCopyrightInSQL

		public static void AppendCopyrightInSQL(StringBuilder sb, ModelRoot model)
		{
			if (!string.IsNullOrEmpty(model.Copyright))
			{
				sb.AppendLine("--Copyright (c) " + DateTime.Now.Year + " " + model.CompanyName + ", All Rights Reserved");

				var temp = model.Copyright.Replace("\r\n", "\n");
				temp = temp.Replace("\r", "\n");
				temp = temp.Replace("%year%", DateTime.Now.Year.ToString());
				var arr = temp.Split('\n');
				foreach (var s in arr)
				{
					sb.AppendLine("--" + s);
				}
				sb.AppendLine();
			}
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:17,代码来源:GenerationHelper.cs


示例10: ColumnCodeFacadeUpdateForm

		public ColumnCodeFacadeUpdateForm(ReferenceCollection columnCollection, ModelRoot modelRoot, FieldSettingConstants fieldSetting)
			: this()
		{
			_columnCollection = columnCollection;
			_modelRoot = modelRoot;
			_fieldSetting = fieldSetting;

			if (_fieldSetting == FieldSettingConstants.Name)
			{
				this.Text = "Update Field";
			}
			else if (_fieldSetting == FieldSettingConstants.Name)
			{
				this.Text = "Update CodeFacade";
			}

			try
			{
				ModelCacheFile cacheFile = null;
				if (modelRoot != null) cacheFile = new ModelCacheFile(modelRoot.GeneratorProject);
				else cacheFile = new ModelCacheFile(((ModelRoot)columnCollection.Root).GeneratorProject);
				if (!string.IsNullOrEmpty(cacheFile.CodeFacadeSettings))
				{
					var document = new XmlDocument();
					document.LoadXml(cacheFile.CodeFacadeSettings);
					var containerNode = document.DocumentElement.ChildNodes[0];
					optPrefix.Checked = XmlHelper.GetAttributeValue(containerNode, "prefixChecked", optPrefix.Checked);
					txtPrefix.Text = XmlHelper.GetAttributeValue(containerNode, "prefix", txtPrefix.Text);
					chkReplaceText.Checked = XmlHelper.GetAttributeValue(containerNode, "replaceText", chkReplaceText.Checked);
					txtReplaceSource.Text = XmlHelper.GetAttributeValue(containerNode, "replaceSource", txtReplaceSource.Text);
					txtReplaceTarget.Text = XmlHelper.GetAttributeValue(containerNode, "replaceTarget", txtReplaceTarget.Text);
					optUpcase.Checked = XmlHelper.GetAttributeValue(containerNode, "upcase", optUpcase.Checked);
					optUnderscore.Checked = XmlHelper.GetAttributeValue(containerNode, "underscore", optUnderscore.Checked);
					chkSkip2Caps.Checked = XmlHelper.GetAttributeValue(containerNode, "TwoCaps", chkSkip2Caps.Checked);
				}
			}
			catch (Exception ex)
			{
				throw;
			}

			this.UpdateForm();
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:43,代码来源:ColumnCodeFacadeUpdateForm.cs


示例11: AppendFullTemplate

        private void AppendFullTemplate(StringBuilder sb, Table table, ModelRoot model)
        {
            try
            {
                var moduleSuffix = string.Empty;
                if (!string.IsNullOrEmpty(_model.ModuleName))
                    moduleSuffix = _model.ModuleName + "_";

                sb.AppendLine("if exists(select * from sys.objects where name = '" + GetStoredProcedureName(table, model, moduleSuffix) + "' and type = 'P' and type_desc = 'SQL_STORED_PROCEDURE')");
                sb.AppendLine("	drop procedure [" + table.GetSQLSchema() + "].[" + GetStoredProcedureName(table, model, moduleSuffix) + "]");
                sb.AppendLine("GO");
                sb.AppendLine();

                //Just drop the procedure if no CRUD SP
                if (!_model.Database.UseGeneratedCRUD)
                    return;

                sb.AppendLine("CREATE PROCEDURE [" + table.GetSQLSchema() + "].[" + GetStoredProcedureName(table, model, moduleSuffix) + "]");
                sb.AppendLine("(");
                sb.AppendLine(BuildParameterList(table, model));
                sb.AppendLine(")");
                sb.AppendLine("AS");
                sb.AppendLine("SET NOCOUNT OFF;");
                sb.AppendLine();
                sb.Append(SQLGeneratedBodyHelper.SQLInsertBusinessObjectBody(table, model));
                sb.AppendLine("GO");
                sb.AppendLine();
                if (model.Database.GrantExecUser != string.Empty)
                {
                    sb.AppendFormat("GRANT EXECUTE ON [" + table.GetSQLSchema() + "].[{0}] TO [{1}]", GetStoredProcedureName(table, model, moduleSuffix), model.Database.GrantExecUser).AppendLine();
                    sb.AppendLine("GO");
                    sb.AppendLine();
                }

            }
            catch (Exception ex)
            {
                throw;
            }

        }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:41,代码来源:SQLInsertBusinessObjectTemplate.cs


示例12: DatasiteMasterScriptTemplate

		public DatasiteMasterScriptTemplate(ModelRoot model, string templateLocation)
			: base(model)
		{
			_templateLocation = templateLocation;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:DatasiteMasterScriptTemplate.cs


示例13: ComplexTypesSPExtenderTemplate

		public ComplexTypesSPExtenderTemplate(ModelRoot model, CustomStoredProcedure item)
			: base(model)
		{
			_item = item;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:ComplexTypesSPExtenderTemplate.cs


示例14: StyleSheetTemplate

		public StyleSheetTemplate(ModelRoot model, string templateLocation)
			: base(model)
		{
			_templateLocation = templateLocation;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:StyleSheetTemplate.cs


示例15: ViewEntityGeneratedTemplate

 public ViewEntityGeneratedTemplate(ModelRoot model, CustomView currentTable)
     : base(model)
 {
     _item = currentTable;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:ViewEntityGeneratedTemplate.cs


示例16: ActionTypesExtenderTemplate

		public ActionTypesExtenderTemplate(ModelRoot model, CustomStoredProcedure storedProcedure)
			: base(model)
		{
			_storedProc = storedProcedure;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:ActionTypesExtenderTemplate.cs


示例17: SQLHelperGeneratedTemplate

 public SQLHelperGeneratedTemplate(ModelRoot model)
     : base(model)
 {
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:4,代码来源:SQLHelperGeneratedTemplate.cs


示例18: LINQExtenderTemplate

 public LINQExtenderTemplate(ModelRoot model)
     : base(model)
 {
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:4,代码来源:BusinessObjectLINQExtenderTemplate.cs


示例19: SQLUpdateComponentTemplate

 public SQLUpdateComponentTemplate(ModelRoot model, TableComponent currentComponent)
 {
     _model = model;
     _currentComponent = currentComponent;
 }
开发者ID:nHydrate,项目名称:nHydrate,代码行数:5,代码来源:SQLUpdateComponentTemplate.cs


示例20: SQLSelectViewTemplate

		public SQLSelectViewTemplate(ModelRoot model, CustomView currentView, StringBuilder grantSB)
		{
			_model = model;
			_currentView = currentView;
			_grantSB = grantSB;
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:6,代码来源:SQLSelectViewTemplate.cs



注:本文中的nHydrate.Generator.Models.ModelRoot类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# jndn.Interest类代码示例发布时间:2022-05-26
下一篇:
C# Data.SqlParameterHelper类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap