setcollections.format

来自「客户关系管理系统ASP.NET+VB.NET编程完整程序!」· FORMAT 代码 · 共 39 行

FORMAT
39
字号

			/// <summary>
			/// Adds a {0} to the collection.
			/// </summary>
			{4} int Add{2}({0} new{2})
			{
				if ( _{2}s == null ) refresh{2}s();

				if ( new{2}.row.GetParentRow(base.DataSet.Relations["{1}{3}"]) == row )
					return _{2}s.IndexOf( new{2} );

				new{2}.row.SetParentRow(row,base.DataSet.Relations["{1}{3}"]);

				int index = _{2}s.Add( new{2} );

				return index;

			}

			/// <summary>
			/// Creates a new {0}, adding it to the collection.
			/// </summary>
			/// <remarks>
			/// CommitAll() must be called to persist this to the database.
			/// </remarks>
			/// <returns>A new {2} object</returns>
			{4} {0} New{2}()
			{
				if ( _{2}s == null ) refresh{2}s();

				{0} new{2} = new {0}(base.DataContext, base.DataSet.Tables["{3}"].NewRow());
				base.DataSet.Tables["{3}"].Rows.Add(new{2}.row);
				
				this.Add{2}(new{2});

				return new{2};
			}
	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?