Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void DeleteAll()
 {
     CurrentSession.CreateSQLQuery("delete from Instruments").ExecuteUpdate();
 }
Exemplo n.º 4
0
 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();
        }
Exemplo n.º 7
0
 public void RecalcBalancesOnDocument(long documentId)
 {
     CurrentSession.CreateSQLQuery("exec UpdateBalances ?")
     .SetParameter(0, documentId)
     .ExecuteUpdate();
 }