Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 

State Machine Complier And Asp.net

By , 20 Oct 2008
 
SMC_Source.zip
SMC_Source
Smc.jar
SMC_Demo
DataAccess
DataAccess
Properties
Domain
Domain
bin
Debug
Domain.dll
Properties
ServicesProvider
ServicesProvider
Properties
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
SMCWebsite
App_Data
Bin
DataAccess.dll
Domain.dll
ServicesProvider.dll
StateMachineWorkflowActivity.dll
statemap.dll
SQL Database Script
SMC_Source_1.zip
Smc.jar
Domain.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
DataAccess.dll
Domain.dll
ServicesProvider.dll
StateMachineWorkflowActivity.dll
statemap.dll
    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 use 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)

About the Author

santosh poojari
Technical Lead
India India
Member
He is presently working as tech arch in one of the leading IT company.He has total 10 years of experience in C#.net. He is a B.E graduate in Computers from Bombay University.
 
Most of his experiences are in designing architect for end to end solutions. His interest areas are WCF,Spring.net,Architecture- Model View Presenter,UML,Webservice,Performance Engineering/tuning,Design patterns,Generics,Enterprise Library,Regular expressions,Silverlight and WWF.
www.santoshpoojari.blogspot.com

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