⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 templates.cs

📁 客户关系管理系统ASP.NET+VB.NET编程完整程序!
💻 CS
📖 第 1 页 / 共 5 页
字号:
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return row.IsNull("NetSqlType") ? null : (System.String) row["NetSqlType"]; 
				else
					return row.IsNull(row.Table.Columns["NetSqlType"], DataRowVersion.Original) ? null : (System.String) row["NetSqlType", DataRowVersion.Original]; 

				//System.String 
			} 
			set
			{ 
				row["NetSqlType"] = value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the SqlDbType.
		/// </summary>
		/// <value>
		/// The underlying rows SqlDbType cell
		/// </value>
		public virtual System.String SqlDbType 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return row.IsNull("SqlDbType") ? null : (System.String) row["SqlDbType"]; 
				else
					return row.IsNull(row.Table.Columns["SqlDbType"], DataRowVersion.Original) ? null : (System.String) row["SqlDbType", DataRowVersion.Original]; 

				//System.String 
			} 
			set
			{ 
				row["SqlDbType"] = value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the OracleDbType.
		/// </summary>
		/// <value>
		/// The underlying rows OracleDbType cell
		/// </value>
		public virtual System.String OracleDbType 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return row.IsNull("OracleDbType") ? null : (System.String) row["OracleDbType"]; 
				else
					return row.IsNull(row.Table.Columns["OracleDbType"], DataRowVersion.Original) ? null : (System.String) row["OracleDbType", DataRowVersion.Original]; 

				//System.String 
			} 
			set
			{ 
				row["OracleDbType"] = value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the OracleType.
		/// </summary>
		/// <value>
		/// The underlying rows OracleType cell
		/// </value>
		public virtual System.String OracleType 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return row.IsNull("OracleType") ? null : (System.String) row["OracleType"]; 
				else
					return row.IsNull(row.Table.Columns["OracleType"], DataRowVersion.Original) ? null : (System.String) row["OracleType", DataRowVersion.Original]; 

				//System.String 
			} 
			set
			{ 
				row["OracleType"] = value; 
 
			} 
		}
		private ORMBiz.ParamCollection _Params = null;
	
		/// <summary>
		/// Refreshes the collection of Params from the underlying dataset
		/// </summary>
		internal void refreshParams()
		{
			if (_Params == null) _Params = new ORMBiz.ParamCollection();
			
			((IList)_Params).Clear();

			DataRow[] cr = row.GetChildRows("FKDataTypeIDParam");
			foreach( DataRow chld in cr)
			{
				ORMBiz.Param obj = new ORMBiz.Param(base.DataContext, chld);
				_Params.Add( obj );
			}
			
			// add after, so that events wont be fired
			_Params.Parent = this;
		}
				
		/// <summary>
		/// Exposes the collection of child ORMBiz.Params.
		/// </summary>
		public virtual ORMBiz.ParamCollection Params
		{
			get 
			{ 
				if (_Params == null) refreshParams();

				return _Params;
			}
		}


			/// <summary>
			/// Adds a ORMBiz.Param to the collection.
			/// </summary>
			public virtual int AddParam(ORMBiz.Param newParam)
			{
				if ( _Params == null ) refreshParams();

				if ( newParam.row.GetParentRow(base.DataSet.Relations["FKDataTypeIDParam"]) == row )
					return _Params.IndexOf( newParam );

				newParam.row.SetParentRow(row,base.DataSet.Relations["FKDataTypeIDParam"]);

				int index = _Params.Add( newParam );

				return index;

			}

			/// <summary>
			/// Creates a new ORMBiz.Param, adding it to the collection.
			/// </summary>
			/// <remarks>
			/// CommitAll() must be called to persist this to the database.
			/// </remarks>
			/// <returns>A new Param object</returns>
			public virtual ORMBiz.Param NewParam()
			{
				if ( _Params == null ) refreshParams();

				ORMBiz.Param newParam = new ORMBiz.Param(base.DataContext, base.DataSet.Tables["Param"].NewRow());
				base.DataSet.Tables["Param"].Rows.Add(newParam.row);
				
				this.AddParam(newParam);

				return newParam;
			}
	
		private ORMBiz.ColumnCollection _Columns = null;
	
		/// <summary>
		/// Refreshes the collection of Columns from the underlying dataset
		/// </summary>
		internal void refreshColumns()
		{
			if (_Columns == null) _Columns = new ORMBiz.ColumnCollection();
			
			((IList)_Columns).Clear();

			DataRow[] cr = row.GetChildRows("FKDataTypeIDColumn");
			foreach( DataRow chld in cr)
			{
				ORMBiz.Column obj = new ORMBiz.Column(base.DataContext, chld);
				_Columns.Add( obj );
			}
			
			// add after, so that events wont be fired
			_Columns.Parent = this;
		}
				
		/// <summary>
		/// Exposes the collection of child ORMBiz.Columns.
		/// </summary>
		public virtual ORMBiz.ColumnCollection Columns
		{
			get 
			{ 
				if (_Columns == null) refreshColumns();

				return _Columns;
			}
		}


			/// <summary>
			/// Adds a ORMBiz.Column to the collection.
			/// </summary>
			public virtual int AddColumn(ORMBiz.Column newColumn)
			{
				if ( _Columns == null ) refreshColumns();

				if ( newColumn.row.GetParentRow(base.DataSet.Relations["FKDataTypeIDColumn"]) == row )
					return _Columns.IndexOf( newColumn );

				newColumn.row.SetParentRow(row,base.DataSet.Relations["FKDataTypeIDColumn"]);

				int index = _Columns.Add( newColumn );

				return index;

			}

			/// <summary>
			/// Creates a new ORMBiz.Column, adding it to the collection.
			/// </summary>
			/// <remarks>
			/// CommitAll() must be called to persist this to the database.
			/// </remarks>
			/// <returns>A new Column object</returns>
			public virtual ORMBiz.Column NewColumn()
			{
				if ( _Columns == null ) refreshColumns();

				ORMBiz.Column newColumn = new ORMBiz.Column(base.DataContext, base.DataSet.Tables["Column"].NewRow());
				base.DataSet.Tables["Column"].Rows.Add(newColumn.row);
				
				this.AddColumn(newColumn);

				return newColumn;
			}
	

	}



	/// <summary>
	/// Wraps a datarow, exposing it's richest features as properties and methods.
	/// </summary>
	public abstract class ParamOrmTemplate : Business
	{
		/// <summary>
		/// Default Constructor
		/// </summary>
		/// <param name="dataContext">The DataManager this object should perform it's operations with</param>
		/// <param name="ROW">The underlying row that this object will wrap</param>
		internal ParamOrmTemplate( DataManager dataContext, DataRow ROW) : base(dataContext) 
		{ 
			row = ROW; 
		}


		/// <summary>
		/// Gets and sets the property at the underlying row index.
		/// </summary>
		public object this[int index]
		{
			get
			{
				if ( this.row.IsNull(index) )
					return null;
				else
					return this.row[index];
			}
			set
			{
				if ( value == null )
					this.row[index] = DBNull.Value;
				else
					this.row[index] = value;
			}
		}

		/// <summary>
		/// Gets and sets the property by its name.
		/// </summary>
		/// <remarks>
		/// Do not use the underlying column name if it is different.
		/// </remarks>
		public object this[string property]
		{
			get
			{
				System.Reflection.PropertyInfo pi = this.GetType().GetProperty(property);
				
				if ( pi != null && pi.CanRead )
					return pi.GetValue(this, null);

				System.Reflection.MethodInfo mi = this.GetType().GetMethod("Get" + property,new Type[]{});
								
				if ( mi != null )
					return mi.Invoke(this, null);

				return null;
			}
			set
			{
				System.Reflection.PropertyInfo pi = this.GetType().GetProperty(property);
				
				if ( pi != null && pi.CanWrite )
				{
					pi.SetValue(this, value, null);
					return;
				}

				System.Reflection.MethodInfo mi = this.GetType().GetMethod("Set" + property,new Type[]{value.GetType()});
								
				if ( mi != null )
					mi.Invoke(this, new object[]{value});
			}
		}		

		
		/// <summary>
		/// Returns true if the underlying DataRow.RowState is marked as DataRowState.Deleted
		/// </summary>
		/// <returns>true if deleted</returns>
		public virtual bool IsDeleted()
		{
			return row.RowState == DataRowState.Deleted;
		}

		/// <summary>
		/// Gets the ID.
		/// </summary>
		/// <value>
		/// The underlying rows ID cell
		/// </value>
		public virtual System.Int32 ID 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return (System.Int32) row["ID"]; 
				else
					return (System.Int32) row["ID", DataRowVersion.Original];
				
				//System.Int32 
			} 
		} 
		/// <summary>
		/// Gets and Sets the FKProcedureID.
		/// </summary>
		/// <value>
		/// The underlying rows FKProcedureID cell
		/// </value>
		public virtual System.Data.SqlTypes.SqlInt32 FKProcedureID 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
				{
					if (row.IsNull("FKProcedureID"))
						return System.Data.SqlTypes.SqlInt32.Null;
					else
						return new System.Data.SqlTypes.SqlInt32((System.Int32)row["FKProcedureID"]);
				}
				else
				{
					if (row.IsNull(row.Table.Columns["FKProcedureID"], DataRowVersion.Original))
						return System.Data.SqlTypes.SqlInt32.Null;
					else
						return new System.Data.SqlTypes.SqlInt32((System.Int32)row["FKProcedureID", DataRowVersion.Original]);
				}
 
			} 
			set
			{ 
				if ( value.IsNull ) 
					row["FKProcedureID"] = DBNull.Value;
				else
					row["FKProcedureID"] = value.Value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the Name.
		/// </summary>
		/// <value>
		/// The underlying rows Name cell
		/// </value>
		public virtual System.String Name 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return row.IsNull("Name") ? null : (System.String) row["Name"]; 
				else
					return row.IsNull(row.Table.Columns["Name"], DataRowVersion.Original) ? null : (System.String) row["Name", DataRowVersion.Original]; 

				//System.String 
			} 
			set
			{ 
				row["Name"] = value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the FKDataTypeID.
		/// </summary>
		/// <value>
		/// The underlying rows FKDataTypeID cell
		/// </value>
		public virtual System.Data.SqlTypes.SqlInt32 FKDataTypeID 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
				{
					if (row.IsNull("FKDataTypeID"))
						return System.Data.SqlTypes.SqlInt32.Null;
					else
						return new System.Data.SqlTypes.SqlInt32((System.Int32)row["FKDataTypeID"]);
				}
				else
				{
					if (row.IsNull(row.Table.Columns["FKDataTypeID"], DataRowVersion.Original))
						return System.Data.SqlTypes.SqlInt32.Null;
					else
						return new System.Data.SqlTypes.SqlInt32((System.Int32)row["FKDataTypeID", DataRowVersion.Original]);
				}
 
			} 
			set
			{ 
				if ( value.IsNull ) 
					row["FKDataTypeID"] = DBNull.Value;
				else
					row["FKDataTypeID"] = value.Value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the Length.
		/// </summary>
		/// <value>
		/// The underlying rows Length cell
		/// </value>
		public virtual System.Data.SqlTypes.SqlInt32 Length 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
				{
					if (row.IsNull("Length"))
						return System.Data.SqlTypes.SqlInt32.Null;
					else
						return new System.Data.SqlTypes.SqlInt32((System.Int32)row["Length"]);
				}
				else
				{
					if (row.IsNull(row.Table.Columns["Length"], DataRowVersion.Original))
						return System.Data.SqlTypes.SqlInt32.Null;
					else
						return new System.Data.SqlTypes.SqlInt32((System.Int32)row["Length", DataRowVersion.Original]);
				}
 
			} 
			set
			{ 
				if ( value.IsNull ) 
					row["Length"] = DBNull.Value;
				else
					row["Length"] = value.Value; 
 
			} 
		}
		/// <summary>
		/// Gets and Sets the IsOutputParam.
		/// </summary>
		/// <value>
		/// The underlying rows IsOutputParam cell
		/// </value>
		public virtual System.String IsOutputParam 
		{ 
			get
			{ 
				if (row.RowState != DataRowState.Deleted)
					return row.IsNull("IsOutputParam") ? null : (System.String) row["IsOutputParam"]; 
				else
					return row.IsNull(row.Table.Columns["IsOutputParam"], DataRowVersion.Original) ? null : (System.String) row["IsOutputParam", DataRowVersion.Original]; 

				//System.String 
			} 
			set
			{ 
				row["IsOutputParam"] = value; 
 
			} 
		}
		
		/// <summary>
		/// Gets and Sets the parent ORMBiz.Procedure.
		/// </summary>
		[System.ComponentModel.Bindable(false)] 
		public virtual ORMBiz.Procedure Procedure
		{
			get
			{
				if (row.GetParentRow(base.DataSet.Relations["FKProcedureIDParam"]) != null)
					return new ORMBiz.Procedure( DataContext, row.GetParentRow("FKProcedureIDParam"));
				else
					return null;
			}
			set
			{
				if ( value == null )
				{
					row.SetParentRow(null, base.DataSet.Relations["FKProcedureIDParam"] );

⌨️ 快捷键说明

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