﻿
// This file was automatically generated by the code gen tool - do not modify.

using System ;
using scg = System.Collections.Generic ;
using sd = System.Data ;
using sds = System.Data.SqlClient ;
using sr = System.Reflection ;
using mst = Microsoft.SqlServer.Types ;
using mss = Microsoft.SqlServer.Server ;
using acr = alby.codegen.runtime ;
using ns = alby.pantheon.codegen;

namespace alby.pantheon.codegen.storedProcedure
{
	public partial class StoredProcedureFactory : acr.StoredProcedureFactoryBase< ns.database.pantheonDatabaseSingletonHelper, ns.database.pantheonDatabase >
	{
		public int LeaseAdd
		(
			sds.SqlConnection connˡ, 
			int? LeaseID, 
			string LeaseStatus, 
			string PIMSUsageCode, 
			int? LeaseTypeID, 
			int? CostCentreStageID, 
			string StageNumber, 
			string ShopNo, 
			string Level, 
			decimal? Area, 
			string AreaType, 
			int? PrecinctID, 
			int? SectorID, 
			int? ShopTypeID, 
			int? LeaseExecutiveID, 
			int? LeaseGuarantorID, 
			int? LesseeID, 
			int? SolicitorID, 
			DateTime? CommenceDate, 
			DateTime? ExpiryDate, 
			int? LeaseTermYears, 
			int? LeaseTermMonths, 
			int? LeaseTermDays, 
			string LeaseTermText, 
			DateTime? LOIIssueDate, 
			DateTime? LOIDueDate, 
			string CompanyName, 
			string ACN, 
			string ABN, 
			string LesseeName, 
			string TradingName, 
			int? ChainID, 
			int? SalesCategoryID, 
			string PermittedUse, 
			int? ExpenseDetailID, 
			int? FitoutDetailID, 
			int? LeaseAdministrationID, 
			int? LeaseCommentID, 
			int? LeaseConditionID, 
			int? RentDetailID, 
			int? SurrenderDetailID, 
			int? VacantPossessionDetailID, 
			string UpdateUserCode, 
			DateTime? UpdateDateTime, 
			ref byte[] RowTimestamp, 
			sds.SqlTransaction tranˡ = null
		)
		{
			const string schemaˡ = "dbo" ; 
			const string spˡ = "LeaseAdd" ; 
			 
			scg.List<sds.SqlParameter> parametersˡ = new scg.List<sds.SqlParameter>() ;
			sds.SqlParameter paramˡLeaseID = base.AddParameterˡ( parametersˡ, "@LeaseID", LeaseID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseStatus = base.AddParameterˡ( parametersˡ, "@LeaseStatus", LeaseStatus, sd.SqlDbType.NVarChar, true, 20, null, null ) ; 
			sds.SqlParameter paramˡPIMSUsageCode = base.AddParameterˡ( parametersˡ, "@PIMSUsageCode", PIMSUsageCode, sd.SqlDbType.VarChar, true, 9, null, null ) ; 
			sds.SqlParameter paramˡLeaseTypeID = base.AddParameterˡ( parametersˡ, "@LeaseTypeID", LeaseTypeID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡCostCentreStageID = base.AddParameterˡ( parametersˡ, "@CostCentreStageID", CostCentreStageID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡStageNumber = base.AddParameterˡ( parametersˡ, "@StageNumber", StageNumber, sd.SqlDbType.NVarChar, true, 15, null, null ) ; 
			sds.SqlParameter paramˡShopNo = base.AddParameterˡ( parametersˡ, "@ShopNo", ShopNo, sd.SqlDbType.NVarChar, true, 15, null, null ) ; 
			sds.SqlParameter paramˡLevel = base.AddParameterˡ( parametersˡ, "@Level", Level, sd.SqlDbType.NVarChar, true, 15, null, null ) ; 
			sds.SqlParameter paramˡArea = base.AddParameterˡ( parametersˡ, "@Area", Area, sd.SqlDbType.Decimal, true, null, 28, 10 ) ; 
			sds.SqlParameter paramˡAreaType = base.AddParameterˡ( parametersˡ, "@AreaType", AreaType, sd.SqlDbType.NVarChar, true, 20, null, null ) ; 
			sds.SqlParameter paramˡPrecinctID = base.AddParameterˡ( parametersˡ, "@PrecinctID", PrecinctID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡSectorID = base.AddParameterˡ( parametersˡ, "@SectorID", SectorID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡShopTypeID = base.AddParameterˡ( parametersˡ, "@ShopTypeID", ShopTypeID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseExecutiveID = base.AddParameterˡ( parametersˡ, "@LeaseExecutiveID", LeaseExecutiveID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseGuarantorID = base.AddParameterˡ( parametersˡ, "@LeaseGuarantorID", LeaseGuarantorID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLesseeID = base.AddParameterˡ( parametersˡ, "@LesseeID", LesseeID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡSolicitorID = base.AddParameterˡ( parametersˡ, "@SolicitorID", SolicitorID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡCommenceDate = base.AddParameterˡ( parametersˡ, "@CommenceDate", CommenceDate, sd.SqlDbType.DateTime, true, null, null, null ) ; 
			sds.SqlParameter paramˡExpiryDate = base.AddParameterˡ( parametersˡ, "@ExpiryDate", ExpiryDate, sd.SqlDbType.DateTime, true, null, null, null ) ; 
			sds.SqlParameter paramˡLeaseTermYears = base.AddParameterˡ( parametersˡ, "@LeaseTermYears", LeaseTermYears, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseTermMonths = base.AddParameterˡ( parametersˡ, "@LeaseTermMonths", LeaseTermMonths, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseTermDays = base.AddParameterˡ( parametersˡ, "@LeaseTermDays", LeaseTermDays, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseTermText = base.AddParameterˡ( parametersˡ, "@LeaseTermText", LeaseTermText, sd.SqlDbType.NVarChar, true, 50, null, null ) ; 
			sds.SqlParameter paramˡLOIIssueDate = base.AddParameterˡ( parametersˡ, "@LOIIssueDate", LOIIssueDate, sd.SqlDbType.DateTime, true, null, null, null ) ; 
			sds.SqlParameter paramˡLOIDueDate = base.AddParameterˡ( parametersˡ, "@LOIDueDate", LOIDueDate, sd.SqlDbType.DateTime, true, null, null, null ) ; 
			sds.SqlParameter paramˡCompanyName = base.AddParameterˡ( parametersˡ, "@CompanyName", CompanyName, sd.SqlDbType.NVarChar, true, 50, null, null ) ; 
			sds.SqlParameter paramˡACN = base.AddParameterˡ( parametersˡ, "@ACN", ACN, sd.SqlDbType.NVarChar, true, 20, null, null ) ; 
			sds.SqlParameter paramˡABN = base.AddParameterˡ( parametersˡ, "@ABN", ABN, sd.SqlDbType.NVarChar, true, 20, null, null ) ; 
			sds.SqlParameter paramˡLesseeName = base.AddParameterˡ( parametersˡ, "@LesseeName", LesseeName, sd.SqlDbType.NVarChar, true, 200, null, null ) ; 
			sds.SqlParameter paramˡTradingName = base.AddParameterˡ( parametersˡ, "@TradingName", TradingName, sd.SqlDbType.NVarChar, true, 50, null, null ) ; 
			sds.SqlParameter paramˡChainID = base.AddParameterˡ( parametersˡ, "@ChainID", ChainID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡSalesCategoryID = base.AddParameterˡ( parametersˡ, "@SalesCategoryID", SalesCategoryID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡPermittedUse = base.AddParameterˡ( parametersˡ, "@PermittedUse", PermittedUse, sd.SqlDbType.NVarChar, true, 3000, null, null ) ; 
			sds.SqlParameter paramˡExpenseDetailID = base.AddParameterˡ( parametersˡ, "@ExpenseDetailID", ExpenseDetailID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡFitoutDetailID = base.AddParameterˡ( parametersˡ, "@FitoutDetailID", FitoutDetailID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseAdministrationID = base.AddParameterˡ( parametersˡ, "@LeaseAdministrationID", LeaseAdministrationID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseCommentID = base.AddParameterˡ( parametersˡ, "@LeaseCommentID", LeaseCommentID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡLeaseConditionID = base.AddParameterˡ( parametersˡ, "@LeaseConditionID", LeaseConditionID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡRentDetailID = base.AddParameterˡ( parametersˡ, "@RentDetailID", RentDetailID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡSurrenderDetailID = base.AddParameterˡ( parametersˡ, "@SurrenderDetailID", SurrenderDetailID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡVacantPossessionDetailID = base.AddParameterˡ( parametersˡ, "@VacantPossessionDetailID", VacantPossessionDetailID, sd.SqlDbType.Int, true, null, 10, 0 ) ; 
			sds.SqlParameter paramˡUpdateUserCode = base.AddParameterˡ( parametersˡ, "@UpdateUserCode", UpdateUserCode, sd.SqlDbType.VarChar, true, 50, null, null ) ; 
			sds.SqlParameter paramˡUpdateDateTime = base.AddParameterˡ( parametersˡ, "@UpdateDateTime", UpdateDateTime, sd.SqlDbType.DateTime, true, null, null, null ) ; 
			sds.SqlParameter paramˡRowTimestamp = base.AddParameterˡ( parametersˡ, "@RowTimestamp", RowTimestamp, sd.SqlDbType.Timestamp, false, null, null, null ) ; 
			sds.SqlParameter paramˡrcˡ = base.AddParameterReturnValueˡ( parametersˡ, "@rcˡ" ) ; 
			 
			sd.DataSet dsˡ = base.Executeˡ( connˡ, tranˡ, schemaˡ, spˡ, parametersˡ ) ;
			 
			RowTimestamp = base.GetParameterValueˡ<byte[]>( paramˡRowTimestamp ) ;
			return base.GetParameterValueˡ<int>( paramˡrcˡ ) ;
		}
	}

}

