存储过程生成后的代码演示

对于存储过程的调用, 今日发布的版本中以及将接口放在了一个新的类中, 即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);
        }
    }
}

 

生成后的代码调用方式

 

    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();
        }

 

 

1456406.html?type=1

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

转载于:https://my.oschina.net/mysticboy/blog/853

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值