对于存储过程的调用, 今日发布的版本中以及将接口放在了一个新的类中, 即SPHelper ,专门用来处理存储过程。
SPHelper 同样也是泛型类, 而且需要传递两个 类型,T为返回值类型, K为List时使用, 而当List时,T固定为int型。
生成后的代码如下:
//
------------------------------------------------------------------------------
//
// 此代码由工具生成。
// 运行时版本:2.0.50727.3053
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
// 生成日期:20090514015505
namespace DAL {
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using Keel.ORM;
public class SP {
public static int coop_tb_codfiles_GetAll( out List < Model.tb_codfiles > _ListOut_keel) {
Keel.SPHelper < int , Model.tb_codfiles > dbi = new Keel.SPHelper < int , Model.tb_codfiles > ();
return dbi.ExcStoredProcedure( " coop_tb_codfiles_GetAll " , Keel.SPExcMethod.List, out _ListOut_keel);
}
public static System.Data.DataTable coop_tb_codsoftitem_GetAll() {
Keel.SPHelper < System.Data.DataTable, object > dbi = new Keel.SPHelper < System.Data.DataTable, object > ();
return dbi.ExcStoredProcedure( " coop_tb_codsoftitem_GetAll " , Keel.SPExcMethod.Fill);
}
public static int coop_tb_user_GetAll( out List < Model.tb_user > _ListOut_keel) {
Keel.SPHelper < int , Model.tb_user > dbi = new Keel.SPHelper < int , Model.tb_user > ();
return dbi.ExcStoredProcedure( " coop_tb_user_GetAll " , Keel.SPExcMethod.List, out _ListOut_keel);
}
public static int coop_tb_codfiles_Insert( string @filemd5, string @filepath) {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
string [] names = new string [] {
" @filemd5 " ,
" @filepath " };
object [] values = new object [] {
@filemd5,
@filepath};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_Insert " , Keel.SPExcMethod.ExecuteNonQuery, names, values);
}
public static Model.tb_codfiles coop_tb_codfiles_GetOne( string @filemd5) {
Keel.SPHelper < Model.tb_codfiles, object > dbi = new Keel.SPHelper < Model.tb_codfiles, object > ();
string [] names = new string [] {
" @filemd5 " };
object [] values = new object [] {
@filemd5};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_GetOne " , Keel.SPExcMethod.Model, names, values);
}
public static int coop_tb_codfiles_Delete( string @filemd5) {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
string [] names = new string [] {
" @filemd5 " };
object [] values = new object [] {
@filemd5};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_Delete " , Keel.SPExcMethod.ExecuteNonQuery, names, values);
}
public static int coop_tb_codfiles_Update( string @filemd5, string @filepath, string @PK_filemd5) {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
string [] names = new string [] {
" @filemd5 " ,
" @filepath " ,
" @PK_filemd5 " };
object [] values = new object [] {
@filemd5,
@filepath,
@PK_filemd5};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_Update " , Keel.SPExcMethod.ExecuteNonQuery, names, values);
}
public static int test1() {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
return dbi.ExcStoredProcedure( " test1 " , Keel.SPExcMethod.ExecuteNonQuery);
}
}
}
//
// 此代码由工具生成。
// 运行时版本:2.0.50727.3053
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
// 生成日期:20090514015505
namespace DAL {
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using Keel.ORM;
public class SP {
public static int coop_tb_codfiles_GetAll( out List < Model.tb_codfiles > _ListOut_keel) {
Keel.SPHelper < int , Model.tb_codfiles > dbi = new Keel.SPHelper < int , Model.tb_codfiles > ();
return dbi.ExcStoredProcedure( " coop_tb_codfiles_GetAll " , Keel.SPExcMethod.List, out _ListOut_keel);
}
public static System.Data.DataTable coop_tb_codsoftitem_GetAll() {
Keel.SPHelper < System.Data.DataTable, object > dbi = new Keel.SPHelper < System.Data.DataTable, object > ();
return dbi.ExcStoredProcedure( " coop_tb_codsoftitem_GetAll " , Keel.SPExcMethod.Fill);
}
public static int coop_tb_user_GetAll( out List < Model.tb_user > _ListOut_keel) {
Keel.SPHelper < int , Model.tb_user > dbi = new Keel.SPHelper < int , Model.tb_user > ();
return dbi.ExcStoredProcedure( " coop_tb_user_GetAll " , Keel.SPExcMethod.List, out _ListOut_keel);
}
public static int coop_tb_codfiles_Insert( string @filemd5, string @filepath) {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
string [] names = new string [] {
" @filemd5 " ,
" @filepath " };
object [] values = new object [] {
@filemd5,
@filepath};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_Insert " , Keel.SPExcMethod.ExecuteNonQuery, names, values);
}
public static Model.tb_codfiles coop_tb_codfiles_GetOne( string @filemd5) {
Keel.SPHelper < Model.tb_codfiles, object > dbi = new Keel.SPHelper < Model.tb_codfiles, object > ();
string [] names = new string [] {
" @filemd5 " };
object [] values = new object [] {
@filemd5};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_GetOne " , Keel.SPExcMethod.Model, names, values);
}
public static int coop_tb_codfiles_Delete( string @filemd5) {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
string [] names = new string [] {
" @filemd5 " };
object [] values = new object [] {
@filemd5};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_Delete " , Keel.SPExcMethod.ExecuteNonQuery, names, values);
}
public static int coop_tb_codfiles_Update( string @filemd5, string @filepath, string @PK_filemd5) {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
string [] names = new string [] {
" @filemd5 " ,
" @filepath " ,
" @PK_filemd5 " };
object [] values = new object [] {
@filemd5,
@filepath,
@PK_filemd5};
return dbi.ExcStoredProcedure( " coop_tb_codfiles_Update " , Keel.SPExcMethod.ExecuteNonQuery, names, values);
}
public static int test1() {
Keel.SPHelper < int , object > dbi = new Keel.SPHelper < int , object > ();
return dbi.ExcStoredProcedure( " test1 " , Keel.SPExcMethod.ExecuteNonQuery);
}
}
}
生成后的代码调用方式
private
void
button6_Click(
object
sender, EventArgs e)
{
this .dataGridView1.DataSource = DAL.SP.coop_tb_codsoftitem_GetAll();
}
private void button7_Click( object sender, EventArgs e)
{
Keel.DBHelper < Model.fadsdsfas > fsd = new Keel.DBHelper < Model.fadsdsfas > ();
this .dataGridView1.DataSource = fsd.GetDataViewForObjectList();
}
{
this .dataGridView1.DataSource = DAL.SP.coop_tb_codsoftitem_GetAll();
}
private void button7_Click( object sender, EventArgs e)
{
Keel.DBHelper < Model.fadsdsfas > fsd = new Keel.DBHelper < Model.fadsdsfas > ();
this .dataGridView1.DataSource = fsd.GetDataViewForObjectList();
}

--------------------------
新闻: Facebook:你从不想知道的一切...
网站导航: 博客园首页 新闻 .NET频道 社区 博问 闪存 找找看