📄 deletestatement.cs
字号:
using System;
namespace Platform.Data {
public class DeleteStatement : StatementBase {
public DeleteStatement() : base() {
}
public DeleteStatement(object obj) : base( obj ){
}
public DeleteStatement(object obj,string _TName) : base( obj ,_TName)
{
}
public override void BuildSqlClause() {
this.WhereString = this.BuildWhereString();
this.SqlClause = String.Format(
"DELETE FROM {0} WHERE {1}", 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 DeleteStatement();
}
public void Perform( CriteriaCollection cts)
{
// if( cts != null )
// {
// this.AddCriterias( cts );
// }
//
//
// string whereString = this.CriteriaString.Length > 0 ? " WHERE " + this.CriteriaString : "";
// string sql = String.Format( "delete FROM {0} where {1}",
// this.TableName,
// whereString);
//
// this.SqlClause = sql;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -