C2026-010 Add Audit History to Setting Change Bars
This commit is contained in:
72
PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs
Normal file
72
PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Csla.Data;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
//CSM - C2026-010 - Minimal Class for Managing Change Bar Audit History
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public static class ChangeBarAuditHistory
|
||||
{
|
||||
|
||||
#region Add Audit Record for ChangeBar History
|
||||
public static void AddAudit(int itemID, string description, DateTime dts, string userID, int unitIndex)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "AddChangeBarAuditHistory";
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
cm.Parameters.AddWithValue("@Description", description);
|
||||
cm.Parameters.AddWithValue("@DTS", dts);
|
||||
cm.Parameters.AddWithValue("@UserID", userID);
|
||||
if (unitIndex != 0) cm.Parameters.AddWithValue("@UnitIndex", unitIndex);
|
||||
|
||||
cm.CommandTimeout = 0;
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error in ChangeBarAuditHistory.AddAudit: ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get Change Bar Audit History
|
||||
public static DataTable GetChangeBarAuditHistory(int itemID)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "GetChangeBarAuditHistoryByItem";
|
||||
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SqlDataAdapter da = new SqlDataAdapter(cm))
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
da.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error in ChangeBarAuditHistory.GetChangeBarAuditHistoryByItem: retrieving data failed", ex);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -389,6 +389,7 @@
|
||||
<Compile Include="Generated\ZTransition.cs" />
|
||||
<Compile Include="Generated\ZTransitionInfo.cs" />
|
||||
<Compile Include="Minimal\AnnotationstypeSections.cs" />
|
||||
<Compile Include="Minimal\ChangeBarAuditHistory.cs" />
|
||||
<Compile Include="Minimal\Maintenance.cs" />
|
||||
<Compile Include="Minimal\GeneralReports.cs" />
|
||||
<Compile Include="Minimal\RevisionData.cs" />
|
||||
|
||||
Reference in New Issue
Block a user