public IList <object> Find(Dictionary <FillParameters, string> parameters) { // Create Valid WHERE Clause for incoming request string whereClause = CreateWhereClause(parameters); // Incoming Clause should not be empty if (!string.IsNullOrEmpty(whereClause)) { // Create SQL Query string sqlQuery = "SELECT * FROM " + Table + whereClause; // Fetch Information from DB var result = CurrentSession.CreateSQLQuery(sqlQuery).List <object>(); // Return Information return(result); } return(null); }
public virtual bool CheckIfIdCombinationExists( int idTypeId, string idNumber, string countryCode, int excludeCustomerId) { Logger.Debug("CheckIfIdCombinationExists|ID: " + idTypeId + "|" + idNumber + "|" + countryCode); Logger.Debug("CheckIfIdCombinationExists|Exclude Customer: " + excludeCustomerId); int result = CurrentSession.CreateSQLQuery(CHECK_ID_ALREADY_EXISTS) .SetParameter("idTypeId", idTypeId) .SetParameter("IdNumber", idNumber) .SetParameter("IdCountry", countryCode) .SetParameter("CustomerId", excludeCustomerId) .SetParameter("Status", "ACTIVE") .UniqueResult <int>(); if (result > 0) { return(true); } return(false); }
public void DeleteAll() { CurrentSession.CreateSQLQuery("delete from Instruments").ExecuteUpdate(); }
private int RetrieveNextSequence() { return(Convert.ToInt32( CurrentSession.CreateSQLQuery(RETRIEVE_NEXT_SEQUENCE).UniqueResult <Int64>())); }
public void RollBack() { string sqlQuery = string.Format("DELETE FROM TRADE"); CurrentSession.CreateSQLQuery(sqlQuery).ExecuteUpdate(); }
public void RollBack() { string sqlQuery = string.Format("DELETE FROM COINEXCHANGE.ORDER"); CurrentSession.CreateSQLQuery(sqlQuery).ExecuteUpdate(); }
public void RecalcBalancesOnDocument(long documentId) { CurrentSession.CreateSQLQuery("exec UpdateBalances ?") .SetParameter(0, documentId) .ExecuteUpdate(); }