public void InsertOrganisationKey(OrganisationKey organisationKey)
 {
     try
     {
         Tuple <string, SqlParameter[]> query = InsertOrganisationQuery(organisationKey);
         using (MssqlDbEngine dbEngine = GetMssqlDbEngine(query.Item1, query.Item2,
                                                          connectionString))
         {
             dbEngine.ExecuteQueryInsertCallback(organisationKey, OnPopulateIdCallBack);
         }
     }
     catch (Exception exception)
     {
         string message = string.Format("Error encountered when executing {0} function in OrganisationKeyRepositoryMsSql. Error\n{1}",
                                        "Inser-OrganisationKey", exception.ToString());
         WriteErrorLog(message);
         throw;
     }
 }
Exemple #2
0
 public void InsertAccess(Access access)
 {
     try
     {
         QueryBody query = GetInsertAccessQuery(access);
         using (MssqlDbEngine dbEngine = GetMssqlDbEngine(query.Query, query.Parameters,
                                                          connectionString))
         {
             dbEngine.ExecuteQueryInsertCallback(access, OnPopulateIdCallBack);
         }
     }
     catch (Exception exception)
     {
         string message = string.Format("Error encountered when executing {0} function in AccessRepositoryMsSql. Error\n{1}",
                                        "Inser-Access", exception.ToString());
         WriteErrorLog(message);
         throw;
     }
 }
Exemple #3
0
 public void InsertMessage(Message message)
 {
     try
     {
         Tuple <string, SqlParameter[]> query = GetInsertQuery(message);
         using (MssqlDbEngine mssqlDbEngine = GetMssqlDbEngine(query.Item1, query.Item2,
                                                               connectionString))
         {
             mssqlDbEngine.ExecuteQueryInsertCallback(message, OnPopulateIdCallBack);
         }
     }
     catch (Exception exception)
     {
         string eMessage = string.Format("Error encountered when executing {0} function in MessageRepositoryMsSql. Error\n{1}",
                                         "InsertMessage", exception.Message);
         WriteErrorLog(eMessage);
         throw;
     }
 }
Exemple #4
0
        public void InsertDispatch(MessageDispatch dispatch)
        {
            try
            {
                QueryBody queryBody = GetDispatchInsertQuery(dispatch);

                using (MssqlDbEngine mssqlDbEngine = GetMssqlDbEngine(queryBody.Query, queryBody.Parameters,
                                                                      connectionString))
                {
                    mssqlDbEngine.ExecuteQueryInsertCallback(dispatch, OnPopulateIdCallBack);
                }
            }
            catch (Exception exception)
            {
                string message = string.Format("Error encountered when executing {0} function in MessageDispatchRepositoryMsSql. Error\n{1}",
                                               "Insertdispatch", exception.Message);
                WriteErrorLog(message);
                throw;
            }
        }