储存过程生成器

/Files/qanholas/SPGen_ReleaseCandidate1_Binaries.zip

 

 

--

-- Dropping stored procedure sp_费用表_SelectAll :

--

 

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[sp_费用表_SelectAll]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

  DROP PROCEDURE [dbo].[sp_费用表_SelectAll]

 

GO

 

-- ==========================================================================================

-- Entity Name:   sp_费用表_SelectAll

-- Author: Mehdi Keramati

-- Create date:   2011-10-5 13:08:25

-- Description:   This stored procedure is intended for selecting all rows from 费用表table

-- ==========================================================================================

Create Procedure sp_费用表_SelectAll

As

Begin

    Select

       [费用ID],

       [费用类型],

       [户号],

       [金额],

       [生成工号],

       [生成日期],

       [滞纳金日期],

       [滞纳金],

       [销帐工号],

       [销帐日期],

       [实收方式],

       [供水公司],

       [户名],

       [地址],

       [表位号],

       [表身号],

       [口径],

       [收费方式],

       [帐户编号],

       [税号],

       [打印发票],

       [标志],

       [备注],

       [滞纳金结算日],

       [处理类型],

       [处理费用ID],

       [处理标志],

       [销帐时间]

    From 费用表

End

 

GO

 

 

--

-- Dropping stored procedure sp_费用表_SelectRow :

--

 

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[sp_费用表_SelectRow]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

  DROP PROCEDURE [dbo].[sp_费用表_SelectRow]

 

GO

 

-- ==========================================================================================

-- Entity Name:   sp_费用表_SelectRow

-- Author: Mehdi Keramati

-- Create date:   2011-10-5 13:08:25

-- Description:   This stored procedure is intended for selecting a specific row from 费用表table

-- ==========================================================================================

Create Procedure sp_费用表_SelectRow

 

As

Begin

    Select

       [费用ID],

       [费用类型],

       [户号],

       [金额],

       [生成工号],

       [生成日期],

       [滞纳金日期],

       [滞纳金],

       [销帐工号],

       [销帐日期],

       [实收方式],

       [供水公司],

       [户名],

       [地址],

       [表位号],

       [表身号],

       [口径],

       [收费方式],

       [帐户编号],

       [税号],

       [打印发票],

       [标志],

       [备注],

       [滞纳金结算日],

       [处理类型],

       [处理费用ID],

       [处理标志],

       [销帐时间]

    From 费用表

    Where

 

End

 

GO

 

 

--

-- Dropping stored procedure sp_费用表_Insert :

--

 

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[sp_费用表_Insert]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

  DROP PROCEDURE [dbo].[sp_费用表_Insert]

 

GO

 

-- ==========================================================================================

-- Entity Name:   sp_费用表_Insert

-- Author: Mehdi Keramati

-- Create date:   2011-10-5 13:08:25

-- Description:   This stored procedure is intended for inserting values to 费用表table

-- ==========================================================================================

Create Procedure sp_费用表_Insert

    @费用ID decimal,

    @费用类型char(2),

    @户号int,

    @金额decimal,

    @生成工号int,

    @生成日期datetime,

    @滞纳金日期datetime,

    @滞纳金decimal,

    @销帐工号int,

    @销帐日期datetime,

    @实收方式char(2),

    @供水公司char(3),

    @户名varchar(60),

    @地址varchar(60),

    @表位号char(13),

    @表身号varchar(10),

    @口径int,

    @收费方式char(2),

    @帐户编号int,

    @税号varchar(20),

    @打印发票bit,

    @标志char(1),

    @备注varchar(254),

    @滞纳金结算日datetime,

    @处理类型varchar(50),

    @处理费用ID decimal,

    @处理标志varchar(2),

    @销帐时间datetime

As

Begin

    Insert Into 费用表

       ([费用ID],[费用类型],[户号],[金额],[生成工号],[生成日期],[滞纳金日期],[滞纳金],[销帐工号],[销帐日期],[实收方式],[供水公司],[户名],[地址],[表位号],[表身号],[口径],[收费方式],[帐户编号],[税号],[打印发票],[标志],[备注],[滞纳金结算日],[处理类型],[处理费用ID],[处理标志],[销帐时间])

    Values

       (@费用ID,@费用类型,@户号,@金额,@生成工号,@生成日期,@滞纳金日期,@滞纳金,@销帐工号,@销帐日期,@实收方式,@供水公司,@户名,@地址,@表位号,@表身号,@口径,@收费方式,@帐户编号,@税号,@打印发票,@标志,@备注,@滞纳金结算日,@处理类型,@处理费用ID,@处理标志,@销帐时间)

 

End

 

GO

 

 

--

-- Dropping stored procedure sp_费用表_Update :

--

 

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[sp_费用表_Update]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

  DROP PROCEDURE [dbo].[sp_费用表_Update]

 

GO

 

-- ==========================================================================================

-- Entity Name:   sp_费用表_Update

-- Author: Mehdi Keramati

-- Create date:   2011-10-5 13:08:26

-- Description:   This stored procedure is intended for updating 费用表table

-- ==========================================================================================

Create Procedure sp_费用表_Update

    @费用ID decimal,

    @费用类型char(2),

    @户号int,

    @金额decimal,

    @生成工号int,

    @生成日期datetime,

    @滞纳金日期datetime,

    @滞纳金decimal,

    @销帐工号int,

    @销帐日期datetime,

    @实收方式char(2),

    @供水公司char(3),

    @户名varchar(60),

    @地址varchar(60),

    @表位号char(13),

    @表身号varchar(10),

    @口径int,

    @收费方式char(2),

    @帐户编号int,

    @税号varchar(20),

    @打印发票bit,

    @标志char(1),

    @备注varchar(254),

    @滞纳金结算日datetime,

    @处理类型varchar(50),

    @处理费用ID decimal,

    @处理标志varchar(2),

    @销帐时间datetime

As

Begin

    Update 费用表

    Set

       [费用ID] = @费用ID,

       [费用类型] = @费用类型,

       [户号] = @户号,

       [金额] = @金额,

       [生成工号] = @生成工号,

       [生成日期] = @生成日期,

       [滞纳金日期] = @滞纳金日期,

       [滞纳金] = @滞纳金,

       [销帐工号] = @销帐工号,

       [销帐日期] = @销帐日期,

       [实收方式] = @实收方式,

       [供水公司] = @供水公司,

       [户名] = @户名,

       [地址] = @地址,

       [表位号] = @表位号,

       [表身号] = @表身号,

       [口径] = @口径,

       [收费方式] = @收费方式,

       [帐户编号] = @帐户编号,

       [税号] = @税号,

       [打印发票] = @打印发票,

       [标志] = @标志,

       [备注] = @备注,

       [滞纳金结算日] = @滞纳金结算日,

       [处理类型] = @处理类型,

       [处理费用ID] = @处理费用ID,

       [处理标志] = @处理标志,

       [销帐时间] = @销帐时间

    Where     

 

End

 

GO

 

 

--

-- Dropping stored procedure sp_费用表_DeleteRow :

--

 

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[sp_费用表_DeleteRow]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

  DROP PROCEDURE [dbo].[sp_费用表_DeleteRow]

 

GO

 

-- ==========================================================================================

-- Entity Name:   sp_费用表_DeleteRow

-- Author: Mehdi Keramati

-- Create date:   2011-10-5 13:08:26

-- Description:   This stored procedure is intended for deleting a specific row from 费用表table

-- ==========================================================================================

Create Procedure sp_费用表_DeleteRow

 

As

Begin

    Delete 费用表

    Where

 

 

End

 

GO

 

 

 

 

using System;
using System.Data;
using System.Data.SqlClient;
using System.ComponentModel;
using NovinMedia.Data;

namespace NovinMedia.Data.Layer
{
    [DataObject(true)]
    public class 费用表2
    {
  [DataObjectMethod(DataObjectMethodType.Fill)]
  public DataSet SelectAll()
        {
            DbObject dbo = new DbObject();
            SqlParameter[] parameters = new SqlParameter[]
                {
 
                };
            return dbo.RunProcedure("sp_费用表2_SelectAll", parameters, "费用表2");
        }

  [DataObjectMethod(DataObjectMethodType.Fill)]
  public DataSet SelectRow()
        {
            DbObject dbo = new DbObject();
            SqlParameter[] parameters = new SqlParameter[]
                {
 
                };
            return dbo.RunProcedure("sp_费用表2_SelectRow", parameters, "费用表2");
        }

  [DataObjectMethod(DataObjectMethodType.Insert)]
  public int InsertRow(string 费用ID,string 费用类型,int 户号,string 金额,int 生成工号,DateTime 生成日期,DateTime 滞纳金日期,string 滞纳金,int 销帐工号,DateTime 销帐日期,string 实收方式,string 供水公司,string 户名,string 地址,string 表位号,string 表身号,int 口径,string 收费方式,int 帐户编号,string 税号,bool 打印发票,string 标志,string 备注,DateTime 滞纳金结算日,string 处理类型,string 处理费用ID,string 处理标志,DateTime 销帐时间)
  {
   int RowsAffected = 0;
   int Result = 0;
   DbObject dbo = new DbObject();
   SqlParameter[] parameters = new SqlParameter[]
    {
     new SqlParameter("费用ID",费用ID),
     new SqlParameter("费用类型",费用类型),
     new SqlParameter("户号",户号),
     new SqlParameter("金额",金额),
     new SqlParameter("生成工号",生成工号),
     new SqlParameter("生成日期",生成日期),
     new SqlParameter("滞纳金日期",滞纳金日期),
     new SqlParameter("滞纳金",滞纳金),
     new SqlParameter("销帐工号",销帐工号),
     new SqlParameter("销帐日期",销帐日期),
     new SqlParameter("实收方式",实收方式),
     new SqlParameter("供水公司",供水公司),
     new SqlParameter("户名",户名),
     new SqlParameter("地址",地址),
     new SqlParameter("表位号",表位号),
     new SqlParameter("表身号",表身号),
     new SqlParameter("口径",口径),
     new SqlParameter("收费方式",收费方式),
     new SqlParameter("帐户编号",帐户编号),
     new SqlParameter("税号",税号),
     new SqlParameter("打印发票",打印发票),
     new SqlParameter("标志",标志),
     new SqlParameter("备注",备注),
     new SqlParameter("滞纳金结算日",滞纳金结算日),
     new SqlParameter("处理类型",处理类型),
     new SqlParameter("处理费用ID",处理费用ID),
     new SqlParameter("处理标志",处理标志),
     new SqlParameter("销帐时间",销帐时间)
    };
   Result = dbo.RunProcedure("sp_费用表2_Insert", parameters, out RowsAffected);
   return Result;
        }

  [DataObjectMethod(DataObjectMethodType.Update)]
  public int UpdateRow(string 费用ID,string 费用类型,int 户号,string 金额,int 生成工号,DateTime 生成日期,DateTime 滞纳金日期,string 滞纳金,int 销帐工号,DateTime 销帐日期,string 实收方式,string 供水公司,string 户名,string 地址,string 表位号,string 表身号,int 口径,string 收费方式,int 帐户编号,string 税号,bool 打印发票,string 标志,string 备注,DateTime 滞纳金结算日,string 处理类型,string 处理费用ID,string 处理标志,DateTime 销帐时间)
  {
   int RowsAffected = 0;
   int Result = 0;
   DbObject dbo = new DbObject();
   SqlParameter[] parameters = new SqlParameter[]
    {
     new SqlParameter("费用ID",费用ID),
     new SqlParameter("费用类型",费用类型),
     new SqlParameter("户号",户号),
     new SqlParameter("金额",金额),
     new SqlParameter("生成工号",生成工号),
     new SqlParameter("生成日期",生成日期),
     new SqlParameter("滞纳金日期",滞纳金日期),
     new SqlParameter("滞纳金",滞纳金),
     new SqlParameter("销帐工号",销帐工号),
     new SqlParameter("销帐日期",销帐日期),
     new SqlParameter("实收方式",实收方式),
     new SqlParameter("供水公司",供水公司),
     new SqlParameter("户名",户名),
     new SqlParameter("地址",地址),
     new SqlParameter("表位号",表位号),
     new SqlParameter("表身号",表身号),
     new SqlParameter("口径",口径),
     new SqlParameter("收费方式",收费方式),
     new SqlParameter("帐户编号",帐户编号),
     new SqlParameter("税号",税号),
     new SqlParameter("打印发票",打印发票),
     new SqlParameter("标志",标志),
     new SqlParameter("备注",备注),
     new SqlParameter("滞纳金结算日",滞纳金结算日),
     new SqlParameter("处理类型",处理类型),
     new SqlParameter("处理费用ID",处理费用ID),
     new SqlParameter("处理标志",处理标志),
     new SqlParameter("销帐时间",销帐时间)
    };
   Result = dbo.RunProcedure("sp_费用表2_Update", parameters, out RowsAffected);
   return Result;
        }

  [DataObjectMethod(DataObjectMethodType.Delete)]
  public int DeleteRow()
  {
   int RowsAffected = 0;
   int Result = 0;
   DbObject dbo = new DbObject();
   SqlParameter[] parameters = new SqlParameter[]
    {
 
    };
   Result = dbo.RunProcedure("sp_费用表2_DeleteRow", parameters, out RowsAffected);
   return Result;
        }
    }
}

 

posted @ 2011-10-05 13:18  qanholas  阅读(831)  评论(0编辑  收藏  举报