Rapid Agile Development for Prototyping and Rapid Application Development

Navigation: <Root level>

Sample Output

 

 

 

 

Sample Output

 

Using the kissOrders.Customer Table as an example

 

SQL

 

MS SQL Server

 

-- SQL Create, Read, Update, Delete (C.R.U.D) Stored Procedures for MS SQL Server
-- Author: Glynn Yates
-- Copyright: Cove Bay Software Limited 2015
-- Date: 30/12/2015 Time: 03:46
-- File Name: C:\CBS\kissOrders\SQL\Generated\Customer.CRUD.Manifest.sql
-- Version: 0.0.0.4


USE [<#_TARGET_DATABASE_NAME_#>];

SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
SET NOCOUNT ON;

-- Insert

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[CustomerInsert]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[CustomerInsert];
GO

CREATE PROCEDURE [dbo].[CustomerInsert]
          (
          @Name varchar(25), @Surname varchar(25), @DoB date, @UserName username
          )
          AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        INSERT INTO [dbo].[Customer]
                                        ([Name], [Surname], [DoB], [UserName])
                                        VALUES(@Name, @Surname, @DoB, @UserName)                              
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH
          END
GO

-- InsertOutputIDENTITY

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[CustomerInsertOutputIdentity]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[CustomerInsertOutputIdentity];
GO

CREATE PROCEDURE [dbo].[CustomerInsertOutputIdentity]
          (
          @OUT_IDENTITY int OUTPUT, @Name varchar(25), @Surname varchar(25), @DoB date, @UserName username
          )
          AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        INSERT INTO [dbo].[Customer]
                                        ([Name], [Surname], [DoB], [UserName])
                                        VALUES(@Name, @Surname, @DoB, @UserName)
                              
                                        SELECT @OUT_IDENTITY = SCOPE_IDENTITY();
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH                    
          END
GO

-- SelectID

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[CustomerSelect]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[CustomerSelect];
GO

CREATE PROCEDURE [dbo].[CustomerSelect]
(
@ID Int
)
AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        SELECT [ID], [Name], [Surname], [DoB], [UserName]
                                        FROM [dbo].[Customer]
                                        WHERE [ID] = @ID
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH
          END
GO


-- SelectAll

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[CustomerSelectAll]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[CustomerSelectAll];
GO

CREATE PROCEDURE [dbo].[CustomerSelectAll]
AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        SELECT [ID], [Name], [Surname], [DoB], [UserName]
                                        FROM [dbo].[Customer]
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH
          END
GO

-- SelectAllOrderByPrimaryKey

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.CustomerSelectAllOrderByPrimaryKey') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE dbo.CustomerSelectAllOrderByPrimaryKey;
GO

CREATE PROCEDURE dbo.CustomerSelectAllOrderByPrimaryKey
AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        SELECT [ID], [Name], [Surname], [DoB], [UserName]
                                        FROM [dbo].[Customer]
                                        ORDER BY [ID]
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH
          END
GO

-- Update

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[CustomerUpdate]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[CustomerUpdate];
GO

CREATE PROCEDURE [dbo].[CustomerUpdate]
(
          @ID int, @Name varchar(25), @Surname varchar(25), @DoB date, @UserName username
)
AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        UPDATE [dbo].[Customer]
                                        SET [Name] = @Name, [Surname] = @Surname, [DoB] = @DoB, [UserName] = @UserName
                                        WHERE [ID] = @ID
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH
          END
GO


-- Delete

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[CustomerDelete]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[CustomerDelete];
GO

CREATE PROCEDURE [dbo].[CustomerDelete]
(
@ID Int
)
AS
          BEGIN
                    BEGIN TRY
                              BEGIN TRANSACTION;
                                        DELETE FROM [dbo].[Customer]
                                        WHERE [ID] = @ID
                              COMMIT TRANSACTION;
                    END TRY
                    BEGIN CATCH
                              ROLLBACK TRANSACTION;
                    END CATCH
          END
GO
 

 

MySQL

 

-- SQL Create, Read, Update, Delete (C.R.U.D) Stored Procedures for MySQL
-- Author: Glynn Yates
-- Copyright: Cove Bay Software Limited 2015
-- Date: 25/12/2015 Time: 01:30
-- File Name: C:\CBS\kissOrdersMySQLVB\SQL\Generated\customer.CRUD.Manifest.sql
-- Version: 0.0.0.95


USE <#_TARGET_DATABASE_NAME_#>;

DELIMITER $$

-- Insert

DROP PROCEDURE IF EXISTS `sptCustomerInsert` $$

          CREATE PROCEDURE `sptCustomerInsert`
          (
          `@Name` varchar (50), `@Surname` varchar (50), `@DoB` date, `@New1` varchar (45)
          )
          BEGIN
                    START TRANSACTION;
                              INSERT INTO `customer`
                              (`Name`, `Surname`, `DoB`, `New1`)
                              VALUES(`@Name`, `@Surname`, `@DoB`, `@New1`);
                    COMMIT;
          END$$

-- InsertOutputIdentity

DROP PROCEDURE IF EXISTS `sptCustomerInsertOutputIdentity` $$

          CREATE PROCEDURE `sptCustomerInsertOutputIdentity`
          (
          OUT `@OUT_IDENTITY` bigint, `@Name` varchar (50), `@Surname` varchar (50), `@DoB` date, `@New1` varchar (45)
          )
          BEGIN
                    START TRANSACTION;
                              INSERT INTO `customer`
                              (`Name`, `Surname`, `DoB`, `New1`)
                              VALUES(`@Name`, `@Surname`, `@DoB`, `@New1`);

                              SET `@OUT_IDENTITY` = LAST_INSERT_ID();
                    COMMIT;
          END$$

-- SelectID

DROP PROCEDURE IF EXISTS `sptCustomerSelect` $$

          CREATE PROCEDURE `sptCustomerSelect`
          (
          `@ID` int
          )
          BEGIN
                    START TRANSACTION;
                              SELECT `ID`, `Name`, `Surname`, `DoB`, `New1`
                              FROM `customer`
                              WHERE `ID` = `@ID`;
                    COMMIT;
          END$$

-- SelectAll

DROP PROCEDURE IF EXISTS `sptCustomerSelectAll` $$

          CREATE PROCEDURE `sptCustomerSelectAll`
          ()
          BEGIN
                    START TRANSACTION;
                              SELECT `ID`, `Name`, `Surname`, `DoB`, `New1`
                              FROM `customer`;
                    COMMIT;
          END$$

-- SelectAllOrderByPrimaryKey

DROP PROCEDURE IF EXISTS `sptCustomerSelectAllOrderByPrimaryKey` $$
          CREATE PROCEDURE `sptCustomerSelectAllOrderByPrimaryKey`
          ()
          BEGIN
                    START TRANSACTION;
                              SELECT `ID`, `Name`, `Surname`, `DoB`, `New1`
                              FROM `customer`
                              ORDER BY `ID`;
                    COMMIT;
          END$$

-- Update

DROP PROCEDURE IF EXISTS `sptCustomerUpdate` $$

          CREATE PROCEDURE `sptCustomerUpdate`
          (
          `@ID` int, `@Name` varchar (50), `@Surname` varchar (50), `@DoB` date, `@New1` varchar (45)
          )
          BEGIN
                    START TRANSACTION;
                              UPDATE `customer`
                              SET `Name` = `@Name`, `Surname` = `@Surname`, `DoB` = `@DoB`, `New1` = `@New1`
                              WHERE `ID` = `@ID`;
                    COMMIT;
          END$$

-- Delete

DROP PROCEDURE IF EXISTS `sptCustomerDelete` $$

          CREATE PROCEDURE `sptCustomerDelete`

          (
          `@ID` int
          )
          BEGIN
                    START TRANSACTION;
                              DELETE FROM `customer`
                              WHERE `ID` = `@ID`;
                    COMMIT;
          END$$



DELIMITER ;

 

 

C#

// C# Data Access Layer for MS SQL Server that returns Value Objcet results

// Author:

// Copyright:  2015

// Date: 30/12/2015 Time: 11:57

// File Name: C:\CBS\kissOrders\DAL\Generated\CustomerMSSQLDAO.MSSQLDAL.Manifest.cs

// Version: 0.0.0.1

 

 

using System;

using System.Collections.Generic;

using System.Data;

using System.Data.SqlClient;

using System.Linq;

using System.Text;

using System.Xml;

 

using System.Diagnostics; //For CustomErrorManager

using CoveBaySoftware.kiss.CustomErrors; //For CustomErrorManager

                                                     

using kissOrders.SQLServer2014.ValueObjects;

                                                                                                                           

namespace kissOrders.SQLServer2014.DataAccessLayer

{

          public partial class CustomerMSSQLDAO : CS_DAL_Base

          {

                    public CustomerMSSQLDAO()

                    {

                    

                    }

 

//Insert

                    public bool Insert(String name, String surname, DateTime doB, String userName)

                    {

                              bool result = false;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlCommand sqlCommand = new SqlCommand("[CustomerInsert]", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

 

                                        sqlCommand.Parameters.Add("@Name", SqlDbType.VarChar, 25).Value = name;

                                        sqlCommand.Parameters.Add("@Surname", SqlDbType.VarChar, 25).Value = surname;

 

                                        if (doB == DateTime.MinValue)

                                        {

                                                  sqlCommand.Parameters.AddWithValue("@DoB", DBNull.Value);

                                        }

                                        else

                                        {

                                                  sqlCommand.Parameters.AddWithValue("@DoB", doB);

                                        }

 

                                        sqlCommand.Parameters.Add("@UserName", SqlDbType.NVarChar, 25).Value = userName;

 

 

                                        result = (sqlCommand.ExecuteNonQuery() == 1);

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

//InsertOutputIdentity

                    public bool InsertOutputIdentity(ref Int64 OUT_Identity, String name, String surname, DateTime doB, String userName)

                    {

                              bool result = false;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlCommand sqlCommand = new SqlCommand("[CustomerInsertOutputIdentity]", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

 

                                        sqlCommand.Parameters.Add("@Name", SqlDbType.VarChar, 25).Value = name;

                                        sqlCommand.Parameters.Add("@Surname", SqlDbType.VarChar, 25).Value = surname;

 

                                        if (doB == DateTime.MinValue)

                                        {

                                                  sqlCommand.Parameters.AddWithValue("@DoB", DBNull.Value);

                                        }

                                        else

                                        {

                                                  sqlCommand.Parameters.AddWithValue("@DoB", doB);

                                        }

 

                                        sqlCommand.Parameters.Add("@UserName", SqlDbType.NVarChar, 25).Value = userName;

 

                                        sqlCommand.Parameters.Add("@OUT_IDENTITY", SqlDbType.Int).Direction = ParameterDirection.Output;

 

                                        result = (sqlCommand.ExecuteNonQuery() == 1);

 

                                        OUT_Identity = Convert.ToInt64(sqlCommand.Parameters["@OUT_IDENTITY"].Value);

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

//SelectID

                    public CustomerVO SelectID(Int32 iD)

                    {

                              CustomerVO result = null;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlDataReader sqlDataReader = null;

 

                                        SqlCommand sqlCommand = new SqlCommand("[CustomerSelect]", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

 

                                        sqlCommand.Parameters.Add("@ID", SqlDbType.Int).Value = iD;

 

 

                                        sqlDataReader = sqlCommand.ExecuteReader();

 

                                        if (sqlDataReader.HasRows)

                                        {

                                                  while (sqlDataReader.Read())

                                                  {

                                                            result = new CustomerVO(sqlDataReader[0] as int? ?? default(Int32), sqlDataReader[1] as string ?? default(String), sqlDataReader[2] as string ?? default(String), sqlDataReader[3] as DateTime? ?? default(DateTime), sqlDataReader[4] as string ?? default(String));

                                                  }

                                        }

 

                                        sqlDataReader.Close();

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

//SelectAll

                    public List<CustomerVO> SelectAll()

                    {

                              List<CustomerVO> result = new List<CustomerVO>();

                              SqlDataReader sqlDataReader = null;

                              CustomerVO CustomerVOIndex = null;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlCommand sqlCommand = new SqlCommand("[CustomerSelectAll]", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

 

                                        sqlDataReader = sqlCommand.ExecuteReader();

 

                                        if (sqlDataReader.HasRows)

                                        {

                                                  while (sqlDataReader.Read())

                                                  {

                                                            CustomerVOIndex = new CustomerVO(sqlDataReader[0] as int? ?? default(Int32), sqlDataReader[1] as string ?? default(String), sqlDataReader[2] as string ?? default(String), sqlDataReader[3] as DateTime? ?? default(DateTime), sqlDataReader[4] as string ?? default(String));

 

                                                            result.Add(CustomerVOIndex);

                                                  }

                                        }

 

                                        sqlDataReader.Close();

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

//SelectAllOrderByPrimaryKey

                    public List<CustomerVO> SelectAllOrderByPrimaryKey()

                    {

                              List<CustomerVO> result = new List<CustomerVO>();

                              CustomerVO CustomerVOIndex = null;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlDataReader sqlDataReader = null;

 

                                        SqlCommand sqlCommand = new SqlCommand("CustomerSelectAllOrderByPrimaryKey", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

 

                                        sqlDataReader = sqlCommand.ExecuteReader();

 

                                        if (sqlDataReader.HasRows)

                                        {

                                                  while (sqlDataReader.Read())

                                                  {

                                                            CustomerVOIndex = new CustomerVO(sqlDataReader[0] as int? ?? default(Int32), sqlDataReader[1] as string ?? default(String), sqlDataReader[2] as string ?? default(String), sqlDataReader[3] as DateTime? ?? default(DateTime), sqlDataReader[4] as string ?? default(String));

 

                                                            result.Add(CustomerVOIndex);

                                                  }

                                        }

 

                                        sqlDataReader.Close();

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

//Update

                    public bool Update(Int32 iD, String name, String surname, DateTime doB, String userName)

                    {

                              bool result = false;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlCommand sqlCommand = new SqlCommand("[CustomerUpdate]", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

                              

 

                                        sqlCommand.Parameters.Add("@ID", SqlDbType.Int).Value = iD;

                                        sqlCommand.Parameters.Add("@Name", SqlDbType.VarChar, 25).Value = name;

                                        sqlCommand.Parameters.Add("@Surname", SqlDbType.VarChar, 25).Value = surname;

 

                                        if (doB == DateTime.MinValue)

                                        {

                                                  sqlCommand.Parameters.AddWithValue("@DoB", DBNull.Value);

                                        }

                                        else

                                        {

                                                  sqlCommand.Parameters.AddWithValue("@DoB", doB);

                                        }

 

                                        sqlCommand.Parameters.Add("@UserName", SqlDbType.NVarChar, 25).Value = userName;

 

 

                                        result = (sqlCommand.ExecuteNonQuery() != 0);

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

//Delete

                    public bool Delete(Int32 iD)

                    {

                              bool result = false;

 

                              try

                              {

                                        SqlConnection sqlConnection = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=kissOrdersTest;Data Source=CBS1\\SQLSERVER2012");

                                        sqlConnection.Open();

 

                                        SqlCommand sqlCommand = new SqlCommand("[CustomerDelete]", sqlConnection);

                                        sqlCommand.CommandType = CommandType.StoredProcedure;

                              

                                        sqlCommand.Parameters.Add("@ID", SqlDbType.Int).Value = iD;

 

 

                                        result = (sqlCommand.ExecuteNonQuery() == 1);

                              }

                              catch (System.Exception ex)

                              {

                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);

                              }

 

                              return result;

                    }

 

          

          }

}

 

 

// C# Business Logic Layer that returns Dataset results
// Author:
// Copyright:  2015
// Date: 30/12/2015 Time: 11:57
// File Name: C:\CBS\kissOrders\BLL\Generated\CustomerMSSQLBLO.MSSQLBLL.Manifest.cs
// Version: 0.0.0.1


using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Diagnostics; //For CustomErrorManager
using CoveBaySoftware.kiss.CustomErrors; //For CustomErrorManager

using kissOrders.SQLServer2014.DataAccessLayer;
using kissOrders.SQLServer2014.ValueObjects;

namespace kissOrders.SQLServer2014.BusinessLogicLayer
{
          public partial class CustomerMSSQLBLO : CS_BLL_Base
          {                    
                    private CustomerVO _CustomerVO;
                    private CustomerMSSQLDAO _CustomerMSSQLDAO;

                    public CustomerMSSQLBLO()
                    {
                              _CustomerMSSQLDAO = new CustomerMSSQLDAO();
                    }

                    public CustomerVO CustomerVO
                    {
                              get { return _CustomerVO; }
                              set { _CustomerVO = value; }
                    }

                    public CustomerMSSQLDAO CustomerMSSQLDAO
                    {
                              get { return _CustomerMSSQLDAO; }
                              set { _CustomerMSSQLDAO = value; }
                    }

//Insert
                    public bool Insert(String name, String surname, DateTime doB, String userName )
                    {
                              bool result = false;
                    
                              try
                              {
                                        _CustomerVO = new CustomerVO(name, surname, doB, userName);
                              
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  if (BusinessRuleForInsert())
                                                  {
                                                            result = _CustomerMSSQLDAO.Insert(name, surname, doB, userName);
                                                  }
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }

                              return result;
                    }

//InsertOutputIdentity
                    public bool InsertOutputIdentity(ref Int64 OUT_Identity, String name, String surname, DateTime doB, String userName)
                    {
                              bool result = false;

                              try
                              {
                                        _CustomerVO = new CustomerVO(name, surname, doB, userName);
                              
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  if (BusinessRuleForInsert())
                                                  {
                                                            result = _CustomerMSSQLDAO.InsertOutputIdentity(ref OUT_Identity, name, surname, doB, userName);
                                                  }
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }

                              return result;
                    }

//SelectID
                    public DataSet SelectID(Int32 iD)          
                    {
                              DataSet result = null;

                              try
                              {                    
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  result = _CustomerMSSQLDAO.SelectID(iD);
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }

                              return result;
                    }

//SelectAll
                    public DataSet SelectAll()          
                    {
                              DataSet result = null;
                              
                              try
                              {                              
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  result = _CustomerMSSQLDAO.SelectAll();
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }
          
                              return result;
                    }

//SelectAllOrderByPrimaryKey
                    public DataSet SelectAllOrderByPrimaryKey()          
                    {
                              DataSet result = null;
                              
                              try
                              {                              
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  result = _CustomerMSSQLDAO.SelectAllOrderByPrimaryKey();
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }
          
                              return result;
                    }

//Update
                    public bool Update(Int32 iD, String name, String surname, DateTime doB, String userName)
                    {
                              bool result = false;
                              
                              try
                              {
                                        _CustomerVO = new CustomerVO(iD, name, surname, doB, userName);

                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  result = _CustomerMSSQLDAO.Update(iD, name, surname, doB, userName);
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }
          
                              return result;
                    }

//Save
                    public bool Save(Int32 iD, String name, String surname, DateTime doB, String userName)
                    {
                              bool result = false;

                              try
                              {
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  if (iD > 0)
                                                  {
                                                            result = _CustomerMSSQLDAO.Update(iD, name, surname, doB, userName);
                                                  }
                                                  else
                                                  {
                                                            result = _CustomerMSSQLDAO.Insert(name, surname, doB, userName);
                                                  }
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }

                              return result;
                    }

                    public bool Save(CustomerVO customerVO)
                    {
                              bool result = false;

                              try
                              {
                                        if ((_CustomerMSSQLDAO != null) && (customerVO != null))
                                        {
                                                  if (customerVO.ID > 0)
                                                  {
                                                            result = _CustomerMSSQLDAO.Update(customerVO.ID,customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.UserName);
                                                  }
                                                  else
                                                  {
                                                            result = _CustomerMSSQLDAO.Insert(customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.UserName);
                                                  }
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }

                              return result;
                    }

//Delete
                    public bool Delete(Int32 iD)          
                    {
                              bool result = false;

                              try
                              {                              
                                        if (_CustomerMSSQLDAO != null)
                                        {
                                                  result = _CustomerMSSQLDAO.Delete(iD);
                                        }
                              }
                              catch (System.Exception ex)
                              {
                                        CustomErrorDOManager.Instance().LogException(this.GetType().ToString(), new StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE);                              
                              }

                              return result;
                    }


          }
}

 

// C# Value Objects

// Author: Glynn Yates

// Copyright: Cove Bay Software Limited 2015

// Date: 30/12/2015 Time: 12:35

// File Name: C:\CBS\kissOrders\VO\Generated\CustomerVO.ValueObject.Manifest.cs

// Version: 0.0.0.2

 

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.ServiceModel.Web;

using System.Text;

 

namespace kissOrders.SQLServer2014.ValueObjects

{

          [DataContract]

          public partial class  CustomerVO : CS_Value_Objects_Base

          {

                    private Int32 _ID = 0;

                    private String _Name = String.Empty;

                    private String _Surname = String.Empty;

                    private DateTime _DoB = default(DateTime);

                    private String _UserName = String.Empty;

 

                    public CustomerVO()

                    {

                    

                    }

 

                    public CustomerVO(CustomerVO customerVO)

                    {

                              _ID = customerVO.ID;

                              _Name = customerVO.Name;

                              _Surname = customerVO.Surname;

                              _DoB = customerVO.DoB;

                              _UserName = customerVO.UserName;

 

                    }

                    

                      public CustomerVO(Int32 iD, String name, String surname, DateTime doB, String userName)

                    {

                              _ID = iD;

                              _Name = name;

                              _Surname = surname;

                              _DoB = doB;

                              _UserName = userName;

 

                    }

 

                    public CustomerVO(String name, String surname, DateTime doB, String userName)

                    {

                              _Name = name;

                              _Surname = surname;

                              _DoB = doB;

                              _UserName = userName;

 

                    }

 

                    [DataMember]

                    public Int32 ID

                    {

                              get{  return _ID; }

                              set{ _ID = value; }

                    }

 

                    [DataMember]

                    public String Name

                    {

                              get{  return _Name; }

                              set{ _Name = value; }

                    }

 

                    [DataMember]

                    public String Surname

                    {

                              get{  return _Surname; }

                              set{ _Surname = value; }

                    }

 

                    [DataMember]

                    public DateTime DoB

                    {

                              get{  return _DoB; }

                              set{ _DoB = value; }

                    }

 

                    [DataMember]

                    public String UserName

                    {

                              get{  return _UserName; }

                              set{ _UserName = value; }

                    }

 

          }

}

 

 

// C# Table and Field Enumerations

// Author: Glynn Yates

// Copyright: Cove Bay Software Limited 2015

// Date: 30/12/2015 Time: 03:46

// File Name: C:\CBS\kissOrders\Enums\Generated\TableAndFieldEnumerations.Manifest.cs

// Version: 0.0.0.1

 

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace kissOrders.SQLServer2014.TableAndFieldEnums

{

          public class kissOrders

          {

                    public enum Tables

                    {

                              customer = 0,

                              order = 1,

                              orderLine = 2,

                              product = 3,

                              tests = 4

                    }

 

                    public enum Customer

                    {

                              ID = 0,

                              Name = 1,

                              Surname = 2,

                              DoB = 3,

                              UserName = 4

                    }

 

                    public enum Order

                    {

                              ID = 0,

                              OrderNo = 1,

                              CustomerID = 2,

                              OrderDate = 3,

                              Notes = 4

                    }

 

                    public enum OrderLine

                    {

                              ID = 0,

                              OrderID = 1,

                              PoductID = 2,

                              Qty = 3

                    }

 

                    public enum Product

                    {

                              ID = 0,

                              Name = 1,

                              Description = 2,

                              Price = 3,

                              ProductImage = 4,

                              Code = 5

                    }

 

                    public enum Tests

                    {

                              ID = 0,

                              Test = 1,

                              Test4 = 2,

                              Test3 = 3

                    }

 

 

          }

}

 

          

VB.NET

 

' VB.Net Data Access Layer for MySQL that returns Value Object results

' Author: Glynn Yates

' Copyright: Cove Bay Software Limited 2015

' Date: 25/12/2015 Time: 01:30

' File Name: C:\CBS\kissOrdersMySQLVB\DAL\Generated\customerMYSQLDAO.MYSQLDAL.Manifest.vb

' Version: 0.0.0.95

 

 

Option Explicit On

Option Strict On

Option Infer On

Option Compare Binary

 

Imports System

Imports System.Collections.Generic

Imports System.Data

Imports MySql.Data.MySqlClient

Imports System.Linq

Imports System.Text

Imports System.Xml

 

Imports System.Diagnostics 'For CustomErrorManager

Imports CoveBaySoftware.kiss.CustomErrors 'For CustomErrorManager

 

Imports kissorders.MySQL56.ValueObjects

 

Namespace kissorders.MySQL56.DataAccessLayer

          Public Partial Class customerMYSQLDAO

                    Inherits VB_DAL_Base

                    

                    Private _customerVO As customerVO = Nothing

 

' Insert

 

                    Public Function Insert(name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean = False

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlCommand As MySqlCommand = New MySqlCommand("`sptCustomerInsert`", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlCommand.Parameters.Add("@Name", MySqlDbType.VarChar, 50).Value = name

                                        mySqlCommand.Parameters.Add("@Surname", MySqlDbType.VarChar, 50).Value = surname

 

                                        If doB = DateTime.MinValue Then

                                                  mySqlCommand.Parameters.AddWithValue("@DoB", DBNull.Value)

                                        Else

                                                  mySqlCommand.Parameters.AddWithValue("@DoB", doB)

                                        End If

                                        mySqlCommand.Parameters.Add("@New1", MySqlDbType.VarChar, 45).Value = new1

 

 

                                        result = (mySqlCommand.ExecuteNonQuery() = 1)

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

' InsertOutputIdentity

 

                    Public Function InsertOutputIdentity(ByRef OUT_Identity As Int64, name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean = False

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlCommand As MySqlCommand = New MySqlCommand("`sptCustomerInsertOutputIdentity`", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlCommand.Parameters.Add("@Name", MySqlDbType.VarChar, 50).Value = name

                                        mySqlCommand.Parameters.Add("@Surname", MySqlDbType.VarChar, 50).Value = surname

 

                                        If doB = DateTime.MinValue Then

                                                  mySqlCommand.Parameters.AddWithValue("@DoB", DBNull.Value)

                                        Else

                                                  mySqlCommand.Parameters.AddWithValue("@DoB", doB)

                                        End If

                                        mySqlCommand.Parameters.Add("@New1", MySqlDbType.VarChar, 45).Value = new1

 

                                        mySqlCommand.Parameters.Add("@OUT_IDENTITY", MySqlDbType.Int64).Direction = ParameterDirection.Output

 

                                        result = (mySqlCommand.ExecuteNonQuery() = 1)

 

                                        OUT_Identity = Convert.ToInt32(mySqlCommand.Parameters("@OUT_IDENTITY").Value)

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

                    

' SelectID

 

                    Public Function SelectID(iD As Int32) As customerVO

                              Dim result As customerVO = Nothing

                              Dim customerVOIndex As customerVO = Nothing

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlDataReader As MySqlDataReader = Nothing

                              Dim mySqlCommand As MySqlCommand  = New MySqlCommand("`sptCustomerSelect`", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlCommand.Parameters.Add("@ID", MySqlDbType.Int32).Value = iD

 

 

                                        mySqlDataReader = mySqlCommand.ExecuteReader()

 

                                        If (mySqlDataReader.HasRows) Then 

                                                  While (mySqlDataReader.Read())

                                                            result = New customerVO(If (Not IsDBNull(mySqlDataReader(0)), DirectCast(mySqlDataReader(0), Int32), Nothing), If (Not IsDBNull(mySqlDataReader(1)), DirectCast(mySqlDataReader(1), String), Nothing), If (Not IsDBNull(mySqlDataReader(2)), DirectCast(mySqlDataReader(2), String), Nothing), If (Not IsDBNull(mySqlDataReader(3)), DirectCast(mySqlDataReader(3), DateTime), Nothing), If (Not IsDBNull(mySqlDataReader(4)), DirectCast(mySqlDataReader(4), String), Nothing))

                                                  End While

                                        End If

 

                                        mySqlDataReader.Close()

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

' SelectAll

 

                    Public Function SelectAll() As List(Of customerVO)

                              Dim result As List(Of customerVO) = New List(Of customerVO)()

                              Dim customerVOIndex As customerVO = Nothing

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlDataReader As MySqlDataReader = Nothing

                              Dim mySqlCommand As MySqlCommand = New MySqlCommand("`sptCustomerSelectAll`", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlDataReader = mySqlCommand.ExecuteReader()

 

                                        If (mySqlDataReader.HasRows) Then

                                                  While (mySqlDataReader.Read())

                                                            customerVOIndex = New customerVO(If (Not IsDBNull(mySqlDataReader(0)), DirectCast(mySqlDataReader(0), Int32), Nothing), If (Not IsDBNull(mySqlDataReader(1)), DirectCast(mySqlDataReader(1), String), Nothing), If (Not IsDBNull(mySqlDataReader(2)), DirectCast(mySqlDataReader(2), String), Nothing), If (Not IsDBNull(mySqlDataReader(3)), DirectCast(mySqlDataReader(3), DateTime), Nothing), If (Not IsDBNull(mySqlDataReader(4)), DirectCast(mySqlDataReader(4), String), Nothing))

                                                            result.Add(customerVOIndex)

                                                  End While

                                        End IF

 

                                        mySqlDataReader.Close()

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

' SelectAllOrderByPrimaryKey

 

                    Public Function SelectAllOrderByPrimaryKey() As List(Of customerVO)

                              Dim result As List(Of customerVO) = New List(Of customerVO)()

                              Dim customerVOIndex As customerVO = Nothing

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlDataReader As MySqlDataReader = Nothing

                              Dim mySqlCommand As MySqlCommand = New MySqlCommand("sptCustomerSelectAllOrderByPrimaryKey", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlDataReader = mySqlCommand.ExecuteReader()

 

                                        If (mySqlDataReader.HasRows) Then

                                                  While (mySqlDataReader.Read())

                                                            customerVOIndex = New customerVO(If (Not IsDBNull(mySqlDataReader(0)), DirectCast(mySqlDataReader(0), Int32), Nothing), If (Not IsDBNull(mySqlDataReader(1)), DirectCast(mySqlDataReader(1), String), Nothing), If (Not IsDBNull(mySqlDataReader(2)), DirectCast(mySqlDataReader(2), String), Nothing), If (Not IsDBNull(mySqlDataReader(3)), DirectCast(mySqlDataReader(3), DateTime), Nothing), If (Not IsDBNull(mySqlDataReader(4)), DirectCast(mySqlDataReader(4), String), Nothing))

                                                            result.Add(customerVOIndex)

                                                  End While

                                        End IF

 

                                        mySqlDataReader.Close()

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

' Update

 

                    Public Function Update(iD As Int32, name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean = False

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlCommand As MySqlCommand  = New MySqlCommand("`sptCustomerUpdate`", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlCommand.Parameters.Add("@ID", MySqlDbType.Int32).Value = iD

                                        mySqlCommand.Parameters.Add("@Name", MySqlDbType.VarChar, 50).Value = name

                                        mySqlCommand.Parameters.Add("@Surname", MySqlDbType.VarChar, 50).Value = surname

 

                                        If doB = DateTime.MinValue Then

                                                  mySqlCommand.Parameters.AddWithValue("@DoB", DBNull.Value)

                                        Else

                                                  mySqlCommand.Parameters.AddWithValue("@DoB", doB)

                                        End If

                                        mySqlCommand.Parameters.Add("@New1", MySqlDbType.VarChar, 45).Value = new1

 

 

                                        result = (mySqlCommand.ExecuteNonQuery() > 0)

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

' Delete

 

                    Public Function Delete(iD As Int32) As Boolean

                              Dim result As Boolean = False

                              Dim mySqlConnection As MySqlConnection = New MySqlConnection("Server=localhost;Port=3306;Database=kissOrdersTest;Uid=root;Pwd=pass1234")

                              Dim mySqlCommand As MySqlCommand = New MySqlCommand("`sptCustomerDelete`", mySqlConnection)

 

                              Try

                                        mySqlConnection.Open()

                                        mySqlCommand.CommandType = System.Data.CommandType.StoredProcedure

 

                                        mySqlCommand.Parameters.Add("@ID", MySqlDbType.Int32).Value = iD

 

 

                                        result = (mySqlCommand.ExecuteNonQuery() = 1)

                              Catch ex As System.Exception

                                        CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

                    

          End Class

End Namespace

 

 

' VB.Net Business Logic Layer that returns Value Object results

' Author: Glynn Yates

' Copyright: Cove Bay Software Limited 2015

' Date: 25/12/2015 Time: 01:30

' File Name: C:\CBS\kissOrdersMySQLVB\BLL\Generated\customerMYSQLBLO.MYSQLBLL.Manifest.vb

' Version: 0.0.0.95

 

 

Option Explicit On

Option Strict On

Option Infer On

Option Compare Binary

 

Imports System

Imports System.Collections.Generic

Imports System.Data

Imports System.Linq

Imports System.Text

Imports System.Windows.Forms

 

Imports System.Diagnostics 'For CustomErrorManager

Imports CoveBaySoftware.kiss.CustomErrors 'For CustomErrorManager

 

Imports kissorders.MySQL56.ValueObjects

Imports kissorders.MySQL56.DataAccessLayer

 

Namespace kissorders.MySQL56.BusinessLogicLayer

          Public Partial Class customerMYSQLBLO

                    Inherits VB_BLL_Base

 

                    Private _customerVO As customerVO

                    Private _customerMYSQLDAO As customerMYSQLDAO

 

                    Public Sub New()

                              If (IsNothing(_customerMYSQLDAO)) Then

                                        _customerMYSQLDAO = new customerMYSQLDAO()

                              End If

                    End Sub

 

                    Public Property customerVO As customerVO

                              Get 

                                        Return _customerVO 

                              End Get

                              

                              Set ( value As customerVO )

                                        _customerVO = value

                              End Set                                                  

                    End Property

 

                    Public Property customerMYSQLDAO As customerMYSQLDAO

                              Get 

                                        Return _customerMYSQLDAO 

                              End Get

                              

                              Set ( value As customerMYSQLDAO )

                                        _customerMYSQLDAO = value

                              End Set                                                  

                    End Property

 

'Insert

                    Public Function Insert(name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean = False

 

                              Try 

                                        _customerVO = New customerVO(name, surname, doB, new1)

 

                                        If (BusinessRuleForInsert()) Then

                                                  result = _customerMYSQLDAO.Insert(name, surname, doB, new1)

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

                    Public Function Insert(customerVO As customerVO) As Boolean

                              Dim result As Boolean = False

 

                              Try 

                                        If Not IsNothing(customerVO) Then

                                                  _customerVO = New customerVO(customerVO)

          

                                                  If (BusinessRuleForInsert()) Then

                                                            result = _customerMYSQLDAO.Insert(customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.New1)

                                                  End If

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

'InsertOutputIdentity

                    Public Function InsertOutputIdentity(ByRef OUT_Identity As Int64, name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean = False

 

                              Try 

                                        _customerVO = New customerVO(name, surname, doB, new1)

 

                                        If (BusinessRuleForInsert()) Then

                                                  result = _customerMYSQLDAO.InsertOutputIdentity(OUT_Identity, name, surname, doB, new1)

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

                    

                    Public Function InsertOutputIdentity(ByRef OUT_Identity As Int64, customerVO As customerVO) As Boolean

                              Dim result As Boolean = False

 

                              Try 

                                        If Not IsNothing(customerVO) Then

                                                  _customerVO = New customerVO(customerVO)

          

                                                  If (BusinessRuleForInsert()) Then

                                                            result = _customerMYSQLDAO.InsertOutputIdentity(OUT_Identity, customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.New1)

                                                  End If

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function                    

 

'SelectID

                    Public Function SelectID(iD As Int32) As customerVO

                              Dim result As customerVO  = Nothing 

 

                              Try

                                        result = _customerMYSQLDAO.SelectID(iD)

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

'SelectAll

                    Public  Function SelectAll() As List(Of customerVO)

                              Dim result As List(Of customerVO)  = Nothing 

 

                              Try

                                        result = _customerMYSQLDAO.SelectAll()

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

'SelectAllOrderByPrimaryKey

                    Public  Function SelectAllOrderByPrimaryKey() As List(Of customerVO)

                              Dim result As List(Of customerVO)  = Nothing 

 

                              Try

                                        result = _customerMYSQLDAO.SelectAllOrderByPrimaryKey()

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

'Update

                    Public Function Update(iD As Int32, name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean  = False 

 

                              Try

                                        _customerVO = New customerVO(iD, name, surname, doB, new1)

 

                                        If (BusinessRuleForUpdate()) Then

                                                  result = _customerMYSQLDAO.Update(iD, name, surname, doB, new1)

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

                    Public Function Update(customerVO As customerVO) As Boolean

                              Dim result As Boolean  = False 

 

                              Try

                                        If Not IsNothing(customerVO) Then

                                                  _customerVO = New customerVO(customerVO)

          

                                                  If (BusinessRuleForUpdate()) Then

                                                            result = _customerMYSQLDAO.Update(customerVO.ID,customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.New1)

                                                  End If

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

'Save

                    Public Function Save(iD As Int32, name As String, surname As String, doB As DateTime, new1 As String) As Boolean

                              Dim result As Boolean = False

                              

                              Try

                                        If Not IsNothing(_customerMYSQLDAO) Then

                                                  If (iD > 0) Then

                                                            result = _customerMYSQLDAO.Update(iD, name, surname, doB, new1)

                                                  Else

                                                            result = _customerMYSQLDAO.Insert(name, surname, doB, new1)

                                                  End IF                    

                                        End If

                    Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                    End Try

                              Return result          

                    End Function

                    

                    Public Function Save(customerVO As customerVO) As Boolean

                              Dim result As Boolean = False

 

                              Try

                                        If Not IsNothing(_customerMYSQLDAO) And Not IsNothing(customerVO) Then

                                                  If customerVO.ID > 0

                                                            result = _customerMYSQLDAO.Update(customerVO.ID,customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.New1)

                                                  Else

                                                            result = _customerMYSQLDAO.Insert(customerVO.Name,customerVO.Surname,customerVO.DoB,customerVO.New1)

                                                  End If

                                        End If

                              Catch ex As System.Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function                                        

 

'Delete

                    Public Function Delete(iD As Int32) As Boolean

                              Dim result As Boolean  = False 

 

                              Try                    

                                        If (BusinessRuleForDelete(iD)) Then

                                                  result = _customerMYSQLDAO.Delete(iD)

                                        End If

                              Catch ex As Exception

                            CustomErrorDOManager.Instance().LogException(Me.GetType().ToString(), New StackTrace().GetFrame(0).GetMethod().ToString(), ex, DateTime.Now, CustomErrorDOManager.CONST_SAVE_TO_FILE)

                              End Try

 

                              Return result

                    End Function

 

 

          End Class

End Namespace

 

 

' VB.Net Value Object Class

' Author: Glynn Yates

' Copyright: Cove Bay Software Limited 2015

' Date: 25/12/2015 Time: 01:30

' File Name: C:\CBS\kissOrdersMySQLVB\VO\Generated\customerVO.ValueObject.Manifest.vb

' Version: 0.0.0.95

 

 

Option Explicit On

Option Strict On

Option Infer On

Option Compare Binary

 

Imports System

Imports System.Collections.Generic

Imports System.Linq

Imports System.Runtime.Serialization

Imports System.ServiceModel

Imports System.ServiceModel.Web

Imports System.Text

 

Namespace kissorders.MySQL56.ValueObjects

          <DataContract()> _

          Public Partial Class  customerVO

                    Inherits VB_Value_Objects_Base

                    

                    Private _ID As Int32 = 0

                    Private _Name As String = String.Empty

                    Private _Surname As String = String.Empty

                    Private _DoB As DateTime = DateTime.MinValue

                    Private _New1 As String = String.Empty

 

                    Public Sub New()

                    End Sub

                    

                    Public Sub New (customerVO As customerVO)

                              _ID = customerVO.ID

                              _Name = customerVO.Name

                              _Surname = customerVO.Surname

                              _DoB = customerVO.DoB

                              _New1 = customerVO.New1

 

                    End Sub

 

                    Public Sub New(iD As Int32, name As String, surname As String, doB As DateTime, new1 As String)

                              _ID = iD

                              _Name = name

                              _Surname = surname

                              _DoB = doB

                              _New1 = new1

 

                    End Sub

 

                    Public Sub New(name As String, surname As String, doB As DateTime, new1 As String)

                              _Name = name

                              _Surname = surname

                              _DoB = doB

                              _New1 = new1

 

                    End Sub

 

          <DataMember()>  _

          Public Property ID As Int32

                              Get

                                        Return _ID

                              End Get

                              Set(ByVal value As Int32)

                                        _ID = value

                              End Set

                    End Property

 

          <DataMember()>  _

          Public Property Name As String

                              Get

                                        Return _Name

                              End Get

                              Set(ByVal value As String)

                                        _Name = value

                              End Set

                    End Property

 

          <DataMember()>  _

          Public Property Surname As String

                              Get

                                        Return _Surname

                              End Get

                              Set(ByVal value As String)

                                        _Surname = value

                              End Set

                    End Property

 

          <DataMember()>  _

          Public Property DoB As DateTime

                              Get

                                        Return _DoB

                              End Get

                              Set(ByVal value As DateTime)

                                        _DoB = value

                              End Set

                    End Property

 

          <DataMember()>  _

          Public Property New1 As String

                              Get

                                        Return _New1

                              End Get

                              Set(ByVal value As String)

                                        _New1 = value

                              End Set

                    End Property

 

          End Class

End Namespace

 

 

' VB.Net Table and Field Enumerations

' Author: Glynn Yates

' Copyright: Cove Bay Software Limited 2015

' Date: 25/12/2015 Time: 01:30

' File Name: C:\CBS\kissOrdersMySQLVB\Enums\Generated\TableAndFieldEnumerations.Manifest.vb

' Version: 0.0.0.95

 

 

Option Explicit On

Option Strict On

Option Infer On

Option Compare Binary

 

Namespace kissorders.MySQL56.TableAndFieldEnums

          Public Class kissorders

                    Public Enum Tables

                              customer = 0

                              order = 1

                              orderline = 2

                              product = 3

                              test = 4

                    End Enum

 

                    Public Enum customer

                              ID = 0

                              Name = 1

                              Surname = 2

                              DoB = 3

                              New1 = 4

                    End Enum

 

                    Public Enum order

                              ID = 0

                              OrderNo = 1

                              CustomerID = 2

                              OrderDate = 3

                              Notes = 4

                    End Enum

 

                    Public Enum orderline

                              ID = 0

                              OrderID = 1

                              ProductID = 2

                              Qty = 3

                    End Enum

 

                    Public Enum product

                              ID = 0

                              Name = 1

                              Description = 2

                              Price = 3

                              ProductImage = 4

                              Notes = 5

                    End Enum

 

                    Public Enum test

                              ID = 0

                              testcol = 1

                              testcol1 = 2

                              testcol2 = 3

                              testcol3 = 4

                    End Enum

 

 

          End Class

End Namespace

 

 

 

www.rapidagiledevelopment.com by Cove Bay Software Limited Copyright © 2015