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

📄 selectstatement.cs

📁 .net的数据持久层
💻 CS
字号:
using System;
using System.Text;

namespace Platform.Data {

	public class SelectStatement : StatementBase {

		public SelectStatement() : base() { }

		public SelectStatement(object obj) : base( obj ) {
		}

		public override void BuildSqlClause() {
			this.FieldString = this.BuildFieldString();
			this.WhereString = this.BuildWhereString();

			this.SqlClause = String.Format("SELECT {0} FROM {1} WHERE {2}",
				this.FieldString, this.TableName, this.WhereString );
		}
		
		public override void FillDataParameter(object obj) {
			foreach(FieldProp fp in this.Fields){
				if( fp.IsKeyField ){
					DataParameter dp = this.Parameters[ fp.FieldName ];
					if( fp.Size != 0 ){
						dp.Size = fp.Size;
					}
					dp.Value = fp.GetValue( obj );
				}
			}
		}

		public override StatementBase Create() {
			return new SelectStatement();
		}

	}
}

⌨️ 快捷键说明

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