Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 
Add your own
alternative version

State Machine Complier And Asp.net

, 20 Oct 2008 CPOL
This article demonstrate the implementation of State Machine Compiler in .NET. This is small proof of concept for developing state machine workflow activity.
SMC_Source.zip
SMC_Source
Smc.jar
SMC_Demo
DataAccess
DataAccess
Properties
Domain
Domain
bin
Debug
Domain.dll
Properties
ServicesProvider
ServicesProvider
Properties
SMCWebsite
App_Data
Bin
DataAccess.dll
Domain.dll
ServicesProvider.dll
StateMachineWorkflowActivity.dll
statemap.dll
SMC_Demo
SMC_Demo.suo
StateMachineWorkflowActivity
bin
Debug
DataAccess.dll
DataAccess.pdb
Domain.dll
Domain.pdb
ServicesProvider.dll
ServicesProvider.pdb
StateMachineWorkflowActivity.dll
StateMachineWorkflowActivity.pdb
statemap.dll
Interface
obj
Debug
Refactor
ResolveAssemblyReference.cache
StateMachineWorkflowActivity.dll
StateMachineWorkflowActivity.pdb
TempPE
Properties
StateDefination
CarWF.sm
StateMachineWorkflowActivity.csproj.user
SQL Database Script
SMC_Source_1.zip
Smc.jar
Domain.dll
DataAccess.dll
Domain.dll
ServicesProvider.dll
StateMachineWorkflowActivity.dll
statemap.dll
SMC_Demo.suo
DataAccess.dll
DataAccess.pdb
Domain.dll
Domain.pdb
ServicesProvider.dll
ServicesProvider.pdb
StateMachineWorkflowActivity.dll
StateMachineWorkflowActivity.pdb
statemap.dll
ResolveAssemblyReference.cache
StateMachineWorkflowActivity.dll
StateMachineWorkflowActivity.pdb
CarWF.sm
StateMachineWorkflowActivity.csproj.user
    using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using Domain;
using System.Data;

namespace DataAccess
{
    public partial class DataProvider
    {
        public static void PersistWorkFlowStateMachine(Car car,Domain.Utilities.CarState currentState,Domain.Utilities.CarState previousState)
        {
            int isSuccess;
            SqlConnection sqlCon=null;
            try
            {
                sqlCon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"].ToString());
                sqlCon.Open();

                SqlCommand sqlCmd = new SqlCommand();                
                sqlCmd.CommandText = "isp_WorkFlowStatePersistence";
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.Connection = sqlCon;

                SqlParameter param1 = new SqlParameter();
                param1.ParameterName = "@Car_ID";
                param1.Value = car.CarID;
                sqlCmd.Parameters.Add(param1);

                SqlParameter param2 = new SqlParameter();
                param2.ParameterName = "@Updated_By";
                param2.Value = car.User;
                sqlCmd.Parameters.Add(param2);

                SqlParameter param3 = new SqlParameter();
                param3.ParameterName = "@Current_State_ID";
                param3.Value = Convert.ToInt32(currentState);
                sqlCmd.Parameters.Add(param3);

                SqlParameter param4 = new SqlParameter();
                param4.ParameterName = "@Previous_State_ID";
                param4.Value = Convert.ToInt32(previousState);
                sqlCmd.Parameters.Add(param4);

                SqlParameter param5 = new SqlParameter();
                param5.ParameterName = "@Remarks";
                param5.Value = car.Remark;
                sqlCmd.Parameters.Add(param5);
                              
                isSuccess = sqlCmd.ExecuteNonQuery();
                sqlCon.Close();
                sqlCmd.Dispose();
            }
            catch (Exception ex)
            {
                sqlCon.Close();
                throw ex;
            }        
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

santosh poojari
Technical Lead
India India
Whatsup-->Exploring--> MVC/HTML5/Javascript & Virtualization.......!
www.santoshpoojari.blogspot.com

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141220.1 | Last Updated 21 Oct 2008
Article Copyright 2008 by santosh poojari
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid