Initial Comit
This commit is contained in:
288
Database/DB/clsConnectionProvider.cs
Normal file
288
Database/DB/clsConnectionProvider.cs
Normal file
@@ -0,0 +1,288 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections;
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public class clsConnectionProvider : IDisposable
|
||||
{
|
||||
#region Class Member Declarations
|
||||
private SqlConnection m_scoDBConnection;
|
||||
private bool m_bIsTransactionPending, m_bIsDisposed;
|
||||
private SqlTransaction m_stCurrentTransaction;
|
||||
private ArrayList m_alSavePoints;
|
||||
#endregion
|
||||
|
||||
|
||||
public clsConnectionProvider()
|
||||
{
|
||||
// Init the class
|
||||
InitClass();
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
|
||||
protected virtual void Dispose(bool bIsDisposing)
|
||||
{
|
||||
// Check to see if Dispose has already been called.
|
||||
if(!m_bIsDisposed)
|
||||
{
|
||||
if(bIsDisposing)
|
||||
{
|
||||
// Dispose managed resources.
|
||||
if(m_stCurrentTransaction != null)
|
||||
{
|
||||
m_stCurrentTransaction.Dispose();
|
||||
m_stCurrentTransaction = null;
|
||||
}
|
||||
if(m_scoDBConnection != null)
|
||||
{
|
||||
// closing the connection will abort (rollback) any pending transactions
|
||||
m_scoDBConnection.Close();
|
||||
m_scoDBConnection.Dispose();
|
||||
m_scoDBConnection = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_bIsDisposed = true;
|
||||
}
|
||||
|
||||
|
||||
private void InitClass()
|
||||
{
|
||||
// create all the objects and initialize other members.
|
||||
m_scoDBConnection = new SqlConnection();
|
||||
m_bIsDisposed = false;
|
||||
m_stCurrentTransaction = null;
|
||||
m_bIsTransactionPending = false;
|
||||
m_alSavePoints = new ArrayList();
|
||||
}
|
||||
|
||||
|
||||
public bool OpenConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
if((m_scoDBConnection.State & ConnectionState.Open) > 0)
|
||||
{
|
||||
// it's already open.
|
||||
throw new Exception("OpenConnection::Connection is already open.");
|
||||
}
|
||||
m_scoDBConnection.Open();
|
||||
m_bIsTransactionPending = false;
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// bubble exception
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool BeginTransaction(string sTransactionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(m_bIsTransactionPending)
|
||||
{
|
||||
// no nested transactions allowed.
|
||||
throw new Exception("BeginTransaction::Already transaction pending. Nesting not allowed");
|
||||
}
|
||||
if((m_scoDBConnection.State & ConnectionState.Open) == 0)
|
||||
{
|
||||
// no open connection
|
||||
throw new Exception("BeginTransaction::Connection is not open.");
|
||||
}
|
||||
// begin the transaction and store the transaction object.
|
||||
m_stCurrentTransaction = m_scoDBConnection.BeginTransaction(IsolationLevel.ReadCommitted, sTransactionName);
|
||||
m_bIsTransactionPending = true;
|
||||
m_alSavePoints.Clear();
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// bubble error
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool CommitTransaction()
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!m_bIsTransactionPending)
|
||||
{
|
||||
// no transaction pending
|
||||
throw new Exception("CommitTransaction::No transaction pending.");
|
||||
}
|
||||
if((m_scoDBConnection.State & ConnectionState.Open) == 0)
|
||||
{
|
||||
// no open connection
|
||||
throw new Exception("CommitTransaction::Connection is not open.");
|
||||
}
|
||||
// commit the transaction
|
||||
m_stCurrentTransaction.Commit();
|
||||
m_bIsTransactionPending = false;
|
||||
m_stCurrentTransaction.Dispose();
|
||||
m_stCurrentTransaction = null;
|
||||
m_alSavePoints.Clear();
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// bubble error
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool RollbackTransaction(string sTransactionToRollback)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!m_bIsTransactionPending)
|
||||
{
|
||||
// no transaction pending
|
||||
throw new Exception("RollbackTransaction::No transaction pending.");
|
||||
}
|
||||
if((m_scoDBConnection.State & ConnectionState.Open) == 0)
|
||||
{
|
||||
// no open connection
|
||||
throw new Exception("RollbackTransaction::Connection is not open.");
|
||||
}
|
||||
// rollback the transaction
|
||||
m_stCurrentTransaction.Rollback(sTransactionToRollback);
|
||||
// if this wasn't a savepoint, we've rolled back the complete transaction, so we
|
||||
// can clean it up.
|
||||
if(!m_alSavePoints.Contains(sTransactionToRollback))
|
||||
{
|
||||
// it's not a savepoint
|
||||
m_bIsTransactionPending = false;
|
||||
m_stCurrentTransaction.Dispose();
|
||||
m_stCurrentTransaction = null;
|
||||
m_alSavePoints.Clear();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// bubble error
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool SaveTransaction(string sSavePointName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!m_bIsTransactionPending)
|
||||
{
|
||||
// no transaction pending
|
||||
throw new Exception("SaveTransaction::No transaction pending.");
|
||||
}
|
||||
if((m_scoDBConnection.State & ConnectionState.Open) == 0)
|
||||
{
|
||||
// no open connection
|
||||
throw new Exception("SaveTransaction::Connection is not open.");
|
||||
}
|
||||
// save the transaction
|
||||
m_stCurrentTransaction.Save(sSavePointName);
|
||||
// Store the savepoint in the list.
|
||||
m_alSavePoints.Add(sSavePointName);
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// bubble error
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool CloseConnection(bool bCommitPendingTransaction)
|
||||
{
|
||||
try
|
||||
{
|
||||
if((m_scoDBConnection.State & ConnectionState.Open) == 0)
|
||||
{
|
||||
// no open connection
|
||||
return false;
|
||||
}
|
||||
if(m_bIsTransactionPending)
|
||||
{
|
||||
if(bCommitPendingTransaction)
|
||||
{
|
||||
// commit the pending transaction
|
||||
m_stCurrentTransaction.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// rollback the pending transaction
|
||||
m_stCurrentTransaction.Rollback();
|
||||
}
|
||||
m_bIsTransactionPending = false;
|
||||
m_stCurrentTransaction.Dispose();
|
||||
m_stCurrentTransaction = null;
|
||||
m_alSavePoints.Clear();
|
||||
}
|
||||
// close the connection
|
||||
m_scoDBConnection.Close();
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// bubble error
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Class Property Declarations
|
||||
public SqlTransaction stCurrentTransaction
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool bIsTransactionPending
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bIsTransactionPending;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlConnection scoDBConnection
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_scoDBConnection;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string sConnectionString
|
||||
{
|
||||
set
|
||||
{
|
||||
m_scoDBConnection.ConnectionString = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
187
Database/DB/clsDBInteractionBase.cs
Normal file
187
Database/DB/clsDBInteractionBase.cs
Normal file
@@ -0,0 +1,187 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public enum LLBLError
|
||||
{
|
||||
AllOk
|
||||
// Add more here (check the comma's!)
|
||||
}
|
||||
|
||||
|
||||
public interface ICommonDBAccess
|
||||
{
|
||||
bool Insert();
|
||||
bool Update();
|
||||
bool Delete();
|
||||
DataTable SelectOne();
|
||||
DataTable SelectAll();
|
||||
}
|
||||
|
||||
|
||||
public abstract class clsDBInteractionBase : IDisposable, ICommonDBAccess
|
||||
{
|
||||
#region Class Member Declarations
|
||||
protected SqlConnection m_scoMainConnection;
|
||||
protected int m_iRowsAffected;
|
||||
protected SqlInt32 m_iErrorCode;
|
||||
protected bool m_bMainConnectionIsCreatedLocal;
|
||||
protected clsConnectionProvider m_cpMainConnectionProvider;
|
||||
private string m_sConnectionString;
|
||||
private bool m_bIsDisposed;
|
||||
#endregion
|
||||
|
||||
|
||||
public clsDBInteractionBase()
|
||||
{
|
||||
// Initialize the class' members.
|
||||
InitClass();
|
||||
}
|
||||
|
||||
|
||||
private void InitClass()
|
||||
{
|
||||
// create all the objects and initialize other members.
|
||||
m_scoMainConnection = new SqlConnection();
|
||||
m_bMainConnectionIsCreatedLocal = true;
|
||||
m_cpMainConnectionProvider = null;
|
||||
m_iErrorCode = (int)LLBLError.AllOk;
|
||||
m_bIsDisposed = false;
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
|
||||
protected virtual void Dispose(bool bIsDisposing)
|
||||
{
|
||||
// Check to see if Dispose has already been called.
|
||||
if(!m_bIsDisposed)
|
||||
{
|
||||
if(bIsDisposing)
|
||||
{
|
||||
// Dispose managed resources.
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Object is created in this class, so destroy it here.
|
||||
m_scoMainConnection.Close();
|
||||
m_scoMainConnection.Dispose();
|
||||
m_bMainConnectionIsCreatedLocal = false;
|
||||
}
|
||||
m_cpMainConnectionProvider = null;
|
||||
m_scoMainConnection = null;
|
||||
}
|
||||
}
|
||||
m_bIsDisposed = true;
|
||||
}
|
||||
|
||||
|
||||
public virtual bool Insert()
|
||||
{
|
||||
// No implementation, throw exception
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public virtual bool Delete()
|
||||
{
|
||||
// No implementation, throw exception
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public virtual bool Update()
|
||||
{
|
||||
// No implementation, throw exception
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public virtual DataTable SelectOne()
|
||||
{
|
||||
// No implementation, throw exception
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
public virtual DataTable SelectAll()
|
||||
{
|
||||
// No implementation, throw exception
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
#region Class Property Declarations
|
||||
public clsConnectionProvider cpMainConnectionProvider
|
||||
{
|
||||
set
|
||||
{
|
||||
if(value==null)
|
||||
{
|
||||
// Invalid value
|
||||
throw new ArgumentNullException("cpMainConnectionProvider", "Null passed as value to this property which is not allowed.");
|
||||
}
|
||||
|
||||
// A connection provider object is passed to this class.
|
||||
// Retrieve the SqlConnection object, if present and create a
|
||||
// reference to it. If there is already a MainConnection object
|
||||
// referenced by the membervar, destroy that one or simply
|
||||
// remove the reference, based on the flag.
|
||||
if(m_scoMainConnection!=null)
|
||||
{
|
||||
// First get rid of current connection object. Caller is responsible
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Is local created object, close it and dispose it.
|
||||
m_scoMainConnection.Close();
|
||||
m_scoMainConnection.Dispose();
|
||||
}
|
||||
// Remove reference.
|
||||
m_scoMainConnection = null;
|
||||
}
|
||||
m_cpMainConnectionProvider = (clsConnectionProvider)value;
|
||||
m_scoMainConnection = m_cpMainConnectionProvider.scoDBConnection;
|
||||
m_bMainConnectionIsCreatedLocal = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iErrorCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string sConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sConnectionString;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sConnectionString = value;
|
||||
m_scoMainConnection.ConnectionString = m_sConnectionString;
|
||||
}
|
||||
}
|
||||
public int iRowsAffected
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iRowsAffected;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
1580
Database/DB/clsDokument.cs
Normal file
1580
Database/DB/clsDokument.cs
Normal file
File diff suppressed because it is too large
Load Diff
525
Database/DB/clsDokument_status.cs
Normal file
525
Database/DB/clsDokument_status.cs
Normal file
@@ -0,0 +1,525 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public class clsDokument_status : clsDBInteractionBase
|
||||
{
|
||||
#region Class Member Declarations
|
||||
private SqlBoolean m_bFolgestatus_durch_anderen_verantwortlichen, m_bDokument_bearbeitung_moeglich, m_bDokument_ausgangsarchivierung, m_bDokument_bearbeitung_abgeschlossen, m_bAktiv;
|
||||
private SqlDateTime m_daErstellt_am;
|
||||
private SqlInt32 m_iDokument_statusnr, m_iStatus_bezeichnungnr, m_iErledigung_ab, m_iMutierer;
|
||||
private SqlString m_sDokumenitid, m_sBezeichnung, m_sReihenfolge;
|
||||
#endregion
|
||||
|
||||
|
||||
public clsDokument_status()
|
||||
{
|
||||
// Nothing for now.
|
||||
}
|
||||
|
||||
|
||||
public override bool Insert()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokument_status_Insert]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sdokumenitid", SqlDbType.VarChar, 22, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sDokumenitid));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatus_bezeichnungnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatus_bezeichnungnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sbezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sreihenfolge", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sReihenfolge));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bfolgestatus_durch_anderen_verantwortlichen", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bFolgestatus_durch_anderen_verantwortlichen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_bearbeitung_moeglich", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_moeglich));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ierledigung_ab", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iErledigung_ab));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_ausgangsarchivierung", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_ausgangsarchivierung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_bearbeitung_abgeschlossen", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_abgeschlossen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iDokument_statusnr = (Int32)scmCmdToExecute.Parameters["@idokument_statusnr"].Value;
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokument_status_Insert' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokument_status::Insert::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Update()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokument_status_Update]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sdokumenitid", SqlDbType.VarChar, 22, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sDokumenitid));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatus_bezeichnungnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatus_bezeichnungnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sbezeichnung", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sBezeichnung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sreihenfolge", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sReihenfolge));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bfolgestatus_durch_anderen_verantwortlichen", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bFolgestatus_durch_anderen_verantwortlichen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_bearbeitung_moeglich", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_moeglich));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ierledigung_ab", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iErledigung_ab));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_ausgangsarchivierung", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_ausgangsarchivierung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_bearbeitung_abgeschlossen", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_abgeschlossen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokument_status_Update' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokument_status::Update::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Delete()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokument_status_Delete]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokument_status_Delete' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokument_status::Delete::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectOne()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokument_status_SelectOne]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("dokument_status");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokument_statusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokument_statusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokument_status_SelectOne' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
if(dtToReturn.Rows.Count > 0)
|
||||
{
|
||||
m_iDokument_statusnr = (Int32)dtToReturn.Rows[0]["dokument_statusnr"];
|
||||
m_sDokumenitid = dtToReturn.Rows[0]["dokumenitid"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["dokumenitid"];
|
||||
m_iStatus_bezeichnungnr = dtToReturn.Rows[0]["status_bezeichnungnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["status_bezeichnungnr"];
|
||||
m_sBezeichnung = dtToReturn.Rows[0]["bezeichnung"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["bezeichnung"];
|
||||
m_sReihenfolge = dtToReturn.Rows[0]["reihenfolge"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["reihenfolge"];
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = dtToReturn.Rows[0]["folgestatus_durch_anderen_verantwortlichen"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["folgestatus_durch_anderen_verantwortlichen"];
|
||||
m_bDokument_bearbeitung_moeglich = dtToReturn.Rows[0]["dokument_bearbeitung_moeglich"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["dokument_bearbeitung_moeglich"];
|
||||
m_iErledigung_ab = dtToReturn.Rows[0]["erledigung_ab"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["erledigung_ab"];
|
||||
m_bDokument_ausgangsarchivierung = dtToReturn.Rows[0]["dokument_ausgangsarchivierung"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["dokument_ausgangsarchivierung"];
|
||||
m_bDokument_bearbeitung_abgeschlossen = dtToReturn.Rows[0]["dokument_bearbeitung_abgeschlossen"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["dokument_bearbeitung_abgeschlossen"];
|
||||
m_bAktiv = dtToReturn.Rows[0]["aktiv"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["aktiv"];
|
||||
m_daErstellt_am = dtToReturn.Rows[0]["erstellt_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["erstellt_am"];
|
||||
m_iMutierer = dtToReturn.Rows[0]["mutierer"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mutierer"];
|
||||
}
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokument_status::SelectOne::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectAll()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokument_status_SelectAll]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("dokument_status");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokument_status_SelectAll' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokument_status::SelectAll::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Class Property Declarations
|
||||
public SqlInt32 iDokument_statusnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iDokument_statusnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iDokument_statusnrTmp = (SqlInt32)value;
|
||||
if(iDokument_statusnrTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iDokument_statusnr", "iDokument_statusnr can't be NULL");
|
||||
}
|
||||
m_iDokument_statusnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sDokumenitid
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sDokumenitid;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sDokumenitid = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iStatus_bezeichnungnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iStatus_bezeichnungnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iStatus_bezeichnungnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sBezeichnung
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sBezeichnung;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sBezeichnung = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sReihenfolge
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sReihenfolge;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sReihenfolge = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bFolgestatus_durch_anderen_verantwortlichen
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bFolgestatus_durch_anderen_verantwortlichen;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bDokument_bearbeitung_moeglich
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDokument_bearbeitung_moeglich;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bDokument_bearbeitung_moeglich = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iErledigung_ab
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iErledigung_ab;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iErledigung_ab = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bDokument_ausgangsarchivierung
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDokument_ausgangsarchivierung;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bDokument_ausgangsarchivierung = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bDokument_bearbeitung_abgeschlossen
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDokument_bearbeitung_abgeschlossen;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bDokument_bearbeitung_abgeschlossen = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bAktiv
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bAktiv;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bAktiv = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daErstellt_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daErstellt_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daErstellt_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMutierer
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMutierer;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMutierer = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
591
Database/DB/clsDokumentstatus.cs
Normal file
591
Database/DB/clsDokumentstatus.cs
Normal file
@@ -0,0 +1,591 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public class clsDokumentstatus : clsDBInteractionBase
|
||||
{
|
||||
#region Class Member Declarations
|
||||
private SqlBoolean m_bFolgestatus_durch_anderen_verantwortlichen, m_bDokumentbearbeitung_moeglich, m_bDokument_ausgangsarchivieren, m_bDokument_bearbeitung_abgeschlossen, m_bAktiv;
|
||||
private SqlDateTime m_daErstellt_am, m_daMutiert_am;
|
||||
private SqlInt32 m_iDokumentstatusnr, m_iDokumenttypnr, m_iStatustypnr, m_iStatus_bezeichnungnr, m_iReihenfolge, m_iErledigung_ab, m_iMandantnr, m_iMutierer, m_iStatustyp;
|
||||
#endregion
|
||||
|
||||
|
||||
public clsDokumentstatus()
|
||||
{
|
||||
// Nothing for now.
|
||||
}
|
||||
|
||||
|
||||
public override bool Insert()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentstatus_Insert]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokumentstatusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokumentstatusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iDokumenttypnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatustypnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatustypnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatus_bezeichnungnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatus_bezeichnungnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ireihenfolge", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iReihenfolge));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bfolgestatus_durch_anderen_verantwortlichen", SqlDbType.Bit, 1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_bFolgestatus_durch_anderen_verantwortlichen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokumentbearbeitung_moeglich", SqlDbType.Bit, 1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_bDokumentbearbeitung_moeglich));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ierledigung_ab", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iErledigung_ab));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_ausgangsarchivieren", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_ausgangsarchivieren));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_bearbeitung_abgeschlossen", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_abgeschlossen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatustyp", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatustyp));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokumentstatus_Insert' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokumentstatus::Insert::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Update()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentstatus_Update]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokumentstatusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokumentstatusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokumenttypnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iDokumenttypnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatustypnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatustypnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatus_bezeichnungnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatus_bezeichnungnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ireihenfolge", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iReihenfolge));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bfolgestatus_durch_anderen_verantwortlichen", SqlDbType.Bit, 1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_bFolgestatus_durch_anderen_verantwortlichen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokumentbearbeitung_moeglich", SqlDbType.Bit, 1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_bDokumentbearbeitung_moeglich));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ierledigung_ab", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iErledigung_ab));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_ausgangsarchivieren", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_ausgangsarchivieren));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bdokument_bearbeitung_abgeschlossen", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bDokument_bearbeitung_abgeschlossen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@istatustyp", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iStatustyp));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokumentstatus_Update' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokumentstatus::Update::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Delete()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentstatus_Delete]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokumentstatusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokumentstatusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokumentstatus_Delete' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokumentstatus::Delete::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectOne()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentstatus_SelectOne]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("dokumentstatus");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@idokumentstatusnr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iDokumentstatusnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokumentstatus_SelectOne' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
if(dtToReturn.Rows.Count > 0)
|
||||
{
|
||||
m_iDokumentstatusnr = (Int32)dtToReturn.Rows[0]["dokumentstatusnr"];
|
||||
m_iDokumenttypnr = dtToReturn.Rows[0]["dokumenttypnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["dokumenttypnr"];
|
||||
m_iStatustypnr = dtToReturn.Rows[0]["statustypnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["statustypnr"];
|
||||
m_iStatus_bezeichnungnr = dtToReturn.Rows[0]["status_bezeichnungnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["status_bezeichnungnr"];
|
||||
m_iReihenfolge = (Int32)dtToReturn.Rows[0]["reihenfolge"];
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = (bool)dtToReturn.Rows[0]["folgestatus_durch_anderen_verantwortlichen"];
|
||||
m_bDokumentbearbeitung_moeglich = (bool)dtToReturn.Rows[0]["dokumentbearbeitung_moeglich"];
|
||||
m_iErledigung_ab = (Int32)dtToReturn.Rows[0]["erledigung_ab"];
|
||||
m_bDokument_ausgangsarchivieren = dtToReturn.Rows[0]["dokument_ausgangsarchivieren"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["dokument_ausgangsarchivieren"];
|
||||
m_bDokument_bearbeitung_abgeschlossen = dtToReturn.Rows[0]["dokument_bearbeitung_abgeschlossen"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["dokument_bearbeitung_abgeschlossen"];
|
||||
m_iMandantnr = dtToReturn.Rows[0]["mandantnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mandantnr"];
|
||||
m_bAktiv = dtToReturn.Rows[0]["aktiv"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["aktiv"];
|
||||
m_daErstellt_am = dtToReturn.Rows[0]["erstellt_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["erstellt_am"];
|
||||
m_daMutiert_am = dtToReturn.Rows[0]["mutiert_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["mutiert_am"];
|
||||
m_iMutierer = dtToReturn.Rows[0]["mutierer"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mutierer"];
|
||||
m_iStatustyp = dtToReturn.Rows[0]["statustyp"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["statustyp"];
|
||||
}
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokumentstatus::SelectOne::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectAll()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_dokumentstatus_SelectAll]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("dokumentstatus");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_dokumentstatus_SelectAll' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsDokumentstatus::SelectAll::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Class Property Declarations
|
||||
public SqlInt32 iDokumentstatusnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iDokumentstatusnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iDokumentstatusnrTmp = (SqlInt32)value;
|
||||
if(iDokumentstatusnrTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iDokumentstatusnr", "iDokumentstatusnr can't be NULL");
|
||||
}
|
||||
m_iDokumentstatusnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iDokumenttypnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iDokumenttypnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iDokumenttypnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iStatustypnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iStatustypnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iStatustypnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iStatus_bezeichnungnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iStatus_bezeichnungnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iStatus_bezeichnungnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iReihenfolge
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iReihenfolge;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iReihenfolgeTmp = (SqlInt32)value;
|
||||
if(iReihenfolgeTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iReihenfolge", "iReihenfolge can't be NULL");
|
||||
}
|
||||
m_iReihenfolge = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bFolgestatus_durch_anderen_verantwortlichen
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bFolgestatus_durch_anderen_verantwortlichen;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlBoolean bFolgestatus_durch_anderen_verantwortlichenTmp = (SqlBoolean)value;
|
||||
if(bFolgestatus_durch_anderen_verantwortlichenTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("bFolgestatus_durch_anderen_verantwortlichen", "bFolgestatus_durch_anderen_verantwortlichen can't be NULL");
|
||||
}
|
||||
m_bFolgestatus_durch_anderen_verantwortlichen = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bDokumentbearbeitung_moeglich
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDokumentbearbeitung_moeglich;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlBoolean bDokumentbearbeitung_moeglichTmp = (SqlBoolean)value;
|
||||
if(bDokumentbearbeitung_moeglichTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("bDokumentbearbeitung_moeglich", "bDokumentbearbeitung_moeglich can't be NULL");
|
||||
}
|
||||
m_bDokumentbearbeitung_moeglich = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iErledigung_ab
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iErledigung_ab;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iErledigung_abTmp = (SqlInt32)value;
|
||||
if(iErledigung_abTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iErledigung_ab", "iErledigung_ab can't be NULL");
|
||||
}
|
||||
m_iErledigung_ab = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bDokument_ausgangsarchivieren
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDokument_ausgangsarchivieren;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bDokument_ausgangsarchivieren = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bDokument_bearbeitung_abgeschlossen
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bDokument_bearbeitung_abgeschlossen;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bDokument_bearbeitung_abgeschlossen = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMandantnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMandantnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMandantnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bAktiv
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bAktiv;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bAktiv = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daErstellt_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daErstellt_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daErstellt_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daMutiert_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daMutiert_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daMutiert_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMutierer
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMutierer;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMutierer = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iStatustyp
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iStatustyp;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iStatustyp = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
1430
Database/DB/clsDokumenttyp.cs
Normal file
1430
Database/DB/clsDokumenttyp.cs
Normal file
File diff suppressed because it is too large
Load Diff
455
Database/DB/clsKey_tabelle.cs
Normal file
455
Database/DB/clsKey_tabelle.cs
Normal file
@@ -0,0 +1,455 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public class clsKey_tabelle : clsDBInteractionBase
|
||||
{
|
||||
#region Class Member Declarations
|
||||
private SqlBoolean m_bAktiv;
|
||||
private SqlDateTime m_daErstellt_am, m_daMutiert_am;
|
||||
private SqlInt32 m_iKeynr, m_iKey_wert, m_iMandantnr, m_iMutierer;
|
||||
private SqlString m_sBeschreibung;
|
||||
#endregion
|
||||
|
||||
|
||||
public clsKey_tabelle()
|
||||
{
|
||||
// Nothing for now.
|
||||
}
|
||||
|
||||
|
||||
public override bool Insert()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Insert]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikey_wert", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iKey_wert));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iKeynr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iKeynr = (Int32)scmCmdToExecute.Parameters["@ikeynr"].Value;
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_key_tabelle_Insert' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsKey_tabelle::Insert::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Update()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Update]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iKeynr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sbeschreibung", SqlDbType.VarChar, 255, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_sBeschreibung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikey_wert", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iKey_wert));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_key_tabelle_Update' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsKey_tabelle::Update::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Delete()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_Delete]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iKeynr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_key_tabelle_Delete' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsKey_tabelle::Delete::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectOne()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_SelectOne]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("key_tabelle");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ikeynr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iKeynr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_key_tabelle_SelectOne' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
if(dtToReturn.Rows.Count > 0)
|
||||
{
|
||||
m_iKeynr = (Int32)dtToReturn.Rows[0]["keynr"];
|
||||
m_sBeschreibung = (string)dtToReturn.Rows[0]["beschreibung"];
|
||||
m_iKey_wert = (Int32)dtToReturn.Rows[0]["key_wert"];
|
||||
m_iMandantnr = dtToReturn.Rows[0]["mandantnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mandantnr"];
|
||||
m_bAktiv = dtToReturn.Rows[0]["aktiv"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["aktiv"];
|
||||
m_daErstellt_am = dtToReturn.Rows[0]["erstellt_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["erstellt_am"];
|
||||
m_daMutiert_am = dtToReturn.Rows[0]["mutiert_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["mutiert_am"];
|
||||
m_iMutierer = dtToReturn.Rows[0]["mutierer"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mutierer"];
|
||||
}
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsKey_tabelle::SelectOne::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectAll()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_key_tabelle_SelectAll]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("key_tabelle");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_key_tabelle_SelectAll' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsKey_tabelle::SelectAll::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Class Property Declarations
|
||||
public SqlInt32 iKeynr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iKeynr;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iKeynrTmp = (SqlInt32)value;
|
||||
if(iKeynrTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iKeynr", "iKeynr can't be NULL");
|
||||
}
|
||||
m_iKeynr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sBeschreibung
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sBeschreibung;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlString sBeschreibungTmp = (SqlString)value;
|
||||
if(sBeschreibungTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("sBeschreibung", "sBeschreibung can't be NULL");
|
||||
}
|
||||
m_sBeschreibung = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iKey_wert
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iKey_wert;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iKey_wertTmp = (SqlInt32)value;
|
||||
if(iKey_wertTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iKey_wert", "iKey_wert can't be NULL");
|
||||
}
|
||||
m_iKey_wert = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMandantnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMandantnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMandantnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bAktiv
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bAktiv;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bAktiv = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daErstellt_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daErstellt_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daErstellt_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daMutiert_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daMutiert_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daMutiert_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMutierer
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMutierer;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMutierer = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
843
Database/DB/clsMitarbeiter.cs
Normal file
843
Database/DB/clsMitarbeiter.cs
Normal file
@@ -0,0 +1,843 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public class clsMitarbeiter : clsDBInteractionBase
|
||||
{
|
||||
#region Class Member Declarations
|
||||
private SqlBoolean m_bGebMeldung, m_bJournalisierung, m_bEdoka_mail, m_bMailDokumentrueckgang, m_bMailDirektVersenden, m_bEdokaMesasge, m_bMailempfang, m_bAktiv, m_bShowtip;
|
||||
private SqlDateTime m_daValidto, m_daMutiert_am, m_daErstellt_am;
|
||||
private SqlInt32 m_iKlassifizierung, m_iMutierer, m_iMandantnr, m_iMitarbeiternr, m_iFuermandant, m_iSprache, m_iFunktionnr, m_iPartnernr;
|
||||
private SqlString m_sVorname, m_sName, m_sKurzzeichen, m_sAnrede, m_sTgnummer, m_sEmail, m_sFunktion, m_sFax, m_sTelefon, m_sUnterschrift_text, m_sRang, m_sMail_1;
|
||||
#endregion
|
||||
|
||||
|
||||
public clsMitarbeiter()
|
||||
{
|
||||
// Nothing for now.
|
||||
}
|
||||
|
||||
|
||||
public override bool Insert()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Insert]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sVorname));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sName));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@skurzzeichen", SqlDbType.VarChar, 10, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sKurzzeichen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sanrede", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sAnrede));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sEmail));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sfax", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sFax));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@stelefon", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sTelefon));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sunterschrift_text", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sUnterschrift_text));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifunktionnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iFunktionnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iSprache));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifuermandant", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iFuermandant));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bshowtip", SqlDbType.Bit, 1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_bShowtip));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ipartnernr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bMailempfang", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bMailempfang));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bEdokaMesasge", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bEdokaMesasge));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sfunktion", SqlDbType.VarChar, 255, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sFunktion));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bMailDirektVersenden", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bMailDirektVersenden));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sRang", SqlDbType.VarChar, 255, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sRang));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bMailDokumentrueckgang", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bMailDokumentrueckgang));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bedoka_mail", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bEdoka_mail));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bjournalisierung", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bJournalisierung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bGebMeldung", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bGebMeldung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sMail_1", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sMail_1));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@davalidto", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daValidto));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_mitarbeiter_Insert' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsMitarbeiter::Insert::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Update()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Update]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@svorname", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sVorname));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sname", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sName));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@skurzzeichen", SqlDbType.VarChar, 10, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sKurzzeichen));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sanrede", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sAnrede));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@stgnummer", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sTgnummer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@semail", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sEmail));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sfax", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sFax));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@stelefon", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sTelefon));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sunterschrift_text", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sUnterschrift_text));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifunktionnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iFunktionnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@isprache", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iSprache));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ifuermandant", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iFuermandant));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bshowtip", SqlDbType.Bit, 1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, m_bShowtip));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@ipartnernr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iPartnernr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imandantnr", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMandantnr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@baktiv", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bAktiv));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@daerstellt_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daErstellt_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@damutiert_am", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daMutiert_am));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imutierer", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iMutierer));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bMailempfang", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bMailempfang));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bEdokaMesasge", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bEdokaMesasge));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sfunktion", SqlDbType.VarChar, 255, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sFunktion));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bMailDirektVersenden", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bMailDirektVersenden));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sRang", SqlDbType.VarChar, 255, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sRang));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bMailDokumentrueckgang", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bMailDokumentrueckgang));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iklassifizierung", SqlDbType.Int, 4, ParameterDirection.Input, true, 10, 0, "", DataRowVersion.Proposed, m_iKlassifizierung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bedoka_mail", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bEdoka_mail));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bjournalisierung", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bJournalisierung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@bGebMeldung", SqlDbType.Bit, 1, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_bGebMeldung));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@sMail_1", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_sMail_1));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@davalidto", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, m_daValidto));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_mitarbeiter_Update' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsMitarbeiter::Update::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool Delete()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_Delete]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
m_iRowsAffected = scmCmdToExecute.ExecuteNonQuery();
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_mitarbeiter_Delete' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsMitarbeiter::Delete::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectOne()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectOne]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("mitarbeiter");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@imitarbeiternr", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, m_iMitarbeiternr));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_mitarbeiter_SelectOne' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
if(dtToReturn.Rows.Count > 0)
|
||||
{
|
||||
m_iMitarbeiternr = (Int32)dtToReturn.Rows[0]["mitarbeiternr"];
|
||||
m_sVorname = dtToReturn.Rows[0]["vorname"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["vorname"];
|
||||
m_sName = dtToReturn.Rows[0]["name"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["name"];
|
||||
m_sKurzzeichen = dtToReturn.Rows[0]["kurzzeichen"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["kurzzeichen"];
|
||||
m_sAnrede = dtToReturn.Rows[0]["anrede"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["anrede"];
|
||||
m_sTgnummer = dtToReturn.Rows[0]["tgnummer"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["tgnummer"];
|
||||
m_sEmail = dtToReturn.Rows[0]["email"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["email"];
|
||||
m_sFax = dtToReturn.Rows[0]["fax"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["fax"];
|
||||
m_sTelefon = dtToReturn.Rows[0]["telefon"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["telefon"];
|
||||
m_sUnterschrift_text = dtToReturn.Rows[0]["unterschrift_text"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["unterschrift_text"];
|
||||
m_iFunktionnr = dtToReturn.Rows[0]["funktionnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["funktionnr"];
|
||||
m_iSprache = dtToReturn.Rows[0]["sprache"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["sprache"];
|
||||
m_iFuermandant = (Int32)dtToReturn.Rows[0]["fuermandant"];
|
||||
m_bShowtip = (bool)dtToReturn.Rows[0]["showtip"];
|
||||
m_iPartnernr = (Int32)dtToReturn.Rows[0]["partnernr"];
|
||||
m_iMandantnr = dtToReturn.Rows[0]["mandantnr"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mandantnr"];
|
||||
m_bAktiv = dtToReturn.Rows[0]["aktiv"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["aktiv"];
|
||||
m_daErstellt_am = dtToReturn.Rows[0]["erstellt_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["erstellt_am"];
|
||||
m_daMutiert_am = dtToReturn.Rows[0]["mutiert_am"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["mutiert_am"];
|
||||
m_iMutierer = dtToReturn.Rows[0]["mutierer"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["mutierer"];
|
||||
m_bMailempfang = dtToReturn.Rows[0]["Mailempfang"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["Mailempfang"];
|
||||
m_bEdokaMesasge = dtToReturn.Rows[0]["EdokaMesasge"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["EdokaMesasge"];
|
||||
m_sFunktion = dtToReturn.Rows[0]["funktion"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["funktion"];
|
||||
m_bMailDirektVersenden = dtToReturn.Rows[0]["MailDirektVersenden"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["MailDirektVersenden"];
|
||||
m_sRang = dtToReturn.Rows[0]["Rang"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["Rang"];
|
||||
m_bMailDokumentrueckgang = dtToReturn.Rows[0]["MailDokumentrueckgang"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["MailDokumentrueckgang"];
|
||||
m_iKlassifizierung = dtToReturn.Rows[0]["klassifizierung"] == System.DBNull.Value ? SqlInt32.Null : (Int32)dtToReturn.Rows[0]["klassifizierung"];
|
||||
m_bEdoka_mail = dtToReturn.Rows[0]["edoka_mail"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["edoka_mail"];
|
||||
m_bJournalisierung = dtToReturn.Rows[0]["journalisierung"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["journalisierung"];
|
||||
m_bGebMeldung = dtToReturn.Rows[0]["GebMeldung"] == System.DBNull.Value ? SqlBoolean.Null : (bool)dtToReturn.Rows[0]["GebMeldung"];
|
||||
m_sMail_1 = dtToReturn.Rows[0]["Mail_1"] == System.DBNull.Value ? SqlString.Null : (string)dtToReturn.Rows[0]["Mail_1"];
|
||||
m_daValidto = dtToReturn.Rows[0]["validto"] == System.DBNull.Value ? SqlDateTime.Null : (DateTime)dtToReturn.Rows[0]["validto"];
|
||||
}
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsMitarbeiter::SelectOne::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override DataTable SelectAll()
|
||||
{
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[pr_mitarbeiter_SelectAll]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
DataTable dtToReturn = new DataTable("mitarbeiter");
|
||||
SqlDataAdapter sdaAdapter = new SqlDataAdapter(scmCmdToExecute);
|
||||
|
||||
// Use base class' connection object
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Open connection.
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
// Execute query.
|
||||
sdaAdapter.Fill(dtToReturn);
|
||||
m_iErrorCode = (Int32)scmCmdToExecute.Parameters["@iErrorCode"].Value;
|
||||
|
||||
if(m_iErrorCode != (int)LLBLError.AllOk)
|
||||
{
|
||||
// Throw error.
|
||||
throw new Exception("Stored Procedure 'pr_mitarbeiter_SelectAll' reported the ErrorCode: " + m_iErrorCode);
|
||||
}
|
||||
|
||||
return dtToReturn;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
// some error occured. Bubble it to caller and encapsulate Exception object
|
||||
throw new Exception("clsMitarbeiter::SelectAll::Error occured.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
// Close connection.
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
sdaAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region Class Property Declarations
|
||||
public SqlInt32 iMitarbeiternr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMitarbeiternr;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iMitarbeiternrTmp = (SqlInt32)value;
|
||||
if(iMitarbeiternrTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iMitarbeiternr", "iMitarbeiternr can't be NULL");
|
||||
}
|
||||
m_iMitarbeiternr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sVorname
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sVorname;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sVorname = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sName;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sName = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sKurzzeichen
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sKurzzeichen;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sKurzzeichen = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sAnrede
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sAnrede;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sAnrede = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sTgnummer
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sTgnummer;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sTgnummer = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sEmail
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sEmail;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sEmail = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sFax
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sFax;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sFax = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sTelefon
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sTelefon;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sTelefon = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sUnterschrift_text
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sUnterschrift_text;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sUnterschrift_text = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iFunktionnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iFunktionnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iFunktionnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iSprache
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iSprache;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iSprache = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iFuermandant
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iFuermandant;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iFuermandantTmp = (SqlInt32)value;
|
||||
if(iFuermandantTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iFuermandant", "iFuermandant can't be NULL");
|
||||
}
|
||||
m_iFuermandant = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bShowtip
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bShowtip;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlBoolean bShowtipTmp = (SqlBoolean)value;
|
||||
if(bShowtipTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("bShowtip", "bShowtip can't be NULL");
|
||||
}
|
||||
m_bShowtip = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iPartnernr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iPartnernr;
|
||||
}
|
||||
set
|
||||
{
|
||||
SqlInt32 iPartnernrTmp = (SqlInt32)value;
|
||||
if(iPartnernrTmp.IsNull)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("iPartnernr", "iPartnernr can't be NULL");
|
||||
}
|
||||
m_iPartnernr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMandantnr
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMandantnr;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMandantnr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bAktiv
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bAktiv;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bAktiv = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daErstellt_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daErstellt_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daErstellt_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daMutiert_am
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daMutiert_am;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daMutiert_am = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iMutierer
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iMutierer;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iMutierer = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bMailempfang
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bMailempfang;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bMailempfang = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bEdokaMesasge
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bEdokaMesasge;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bEdokaMesasge = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sFunktion
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sFunktion;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sFunktion = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bMailDirektVersenden
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bMailDirektVersenden;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bMailDirektVersenden = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sRang
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sRang;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sRang = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bMailDokumentrueckgang
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bMailDokumentrueckgang;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bMailDokumentrueckgang = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlInt32 iKlassifizierung
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_iKlassifizierung;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_iKlassifizierung = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bEdoka_mail
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bEdoka_mail;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bEdoka_mail = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bJournalisierung
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bJournalisierung;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bJournalisierung = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlBoolean bGebMeldung
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bGebMeldung;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bGebMeldung = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlString sMail_1
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sMail_1;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sMail_1 = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SqlDateTime daValidto
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_daValidto;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_daValidto = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
70
Database/DB/clsMyKey_Tabelle.cs
Normal file
70
Database/DB/clsMyKey_Tabelle.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using edoka_dms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace edoka_dms
|
||||
{
|
||||
public class clsMyKey_Tabelle : edoka_dms.clsKey_tabelle
|
||||
{
|
||||
public string connectionstring = "";
|
||||
public string get_dbkey(string Tablename)
|
||||
{
|
||||
string m_dbkey = "";
|
||||
SqlCommand scmCmdToExecute = new SqlCommand();
|
||||
scmCmdToExecute.CommandText = "dbo.[sp_get_dbkey]";
|
||||
scmCmdToExecute.CommandType = CommandType.StoredProcedure;
|
||||
scmCmdToExecute.Connection = m_scoMainConnection;
|
||||
scmCmdToExecute.Connection.ConnectionString = connectionstring;
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@Tablename", SqlDbType.VarChar, 255, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, Tablename));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@dbkey", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_dbkey));
|
||||
scmCmdToExecute.Parameters.Add(new SqlParameter("@iErrorCode", SqlDbType.Int, 4, ParameterDirection.Output, true, 10, 0, "", DataRowVersion.Proposed, m_iErrorCode));
|
||||
if (m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
m_scoMainConnection.Open();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_cpMainConnectionProvider.bIsTransactionPending)
|
||||
{
|
||||
scmCmdToExecute.Transaction = m_cpMainConnectionProvider.stCurrentTransaction;
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
scmCmdToExecute.Connection.Open();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
scmCmdToExecute.ExecuteNonQuery();
|
||||
m_dbkey =scmCmdToExecute.Parameters[1].Value.ToString();
|
||||
scmCmdToExecute.Connection.Close();
|
||||
return m_dbkey;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("clsKey_tabelle::get_dbkey::Error occured." + ex.Message, ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (m_bMainConnectionIsCreatedLocal)
|
||||
{
|
||||
m_scoMainConnection.Close();
|
||||
}
|
||||
scmCmdToExecute.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1222
Database/DB/clsPartner.cs
Normal file
1222
Database/DB/clsPartner.cs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user