Sunday, May 15, 2011

data layer

public Boolean ExecuteS1p(DataBO dbo)
{
Boolean flag = false;
DataConnection DC = new DataConnection(ConnString);
try
{
DC.OpenConnection();
DC.BegingTran();
DC.AppCommand.CommandType = CommandType.StoredProcedure;
DC.AppCommand.CommandText = "Sp_AppUsere1";
DC.AppCommand.Parameters.AddWithValue("@ActionID", dbo.ActionID1 );
DC.AppCommand.Parameters.AddWithValue("@Aref", dbo.Aref);
DC.AppCommand.Parameters.AddWithValue("@UserID", dbo.USerID1 );
DC.AppCommand.Parameters.AddWithValue("@Password", dbo.Password);
DC.AppCommand.Parameters.AddWithValue("@FirstName", dbo.FirstName );
DC.AppCommand.Parameters.AddWithValue("@LastName", dbo.LastName );
DC.AppCommand.Parameters.AddWithValue("@ImageData",dbo.Imagedata);
DC.AppDataAdapter.SelectCommand = DC.AppCommand;
DC.AppDataAdapter.Fill(DC.AppDataSet);
DC.CommitTran();
flag = true;
}
catch
{
DC.RollBackTran();
throw;
}
finally
{
DC.closeConnction();

}
return flag;

}

No comments:

Post a Comment