Esempio n. 1
0
        private bool UpdateMISHotlist(IMISHotlistUpdate update, string encryptedIdentifier)
        {
            Log.LogInfoMessage($"[Enter] {System.Reflection.MethodBase.GetCurrentMethod().Name}");

            try
            {
                using (IfxConnection connection = EstablishConnection())
                {
                    IfxCommand command = connection.CreateCommand();

                    if (update.Change == "Add")
                    {
                        command.CommandText = $"INSERT INTO Hotlist VALUES ('{encryptedIdentifier}') ";
                    }
                    else if (update.Change == "Delete")
                    {
                        command.CommandText = $"DELETE FROM Hotlist WHERE ac_nr = '{encryptedIdentifier}'";
                    }
                }
            }
            catch (Exception ex)
            {
                Log.LogException(ex);
                Log.LogTrace(ex.Message + ". Check error log for more details.");

                return(false);
            }

            Log.LogInfoMessage($"[Exit] {System.Reflection.MethodBase.GetCurrentMethod().Name}");

            return(true);
        }
Esempio n. 2
0
        public void SetSentMISHolistUpdate(IMISHotlistUpdate update)
        {
            using (var ctx = new DataImportEntities())
            {
                var updateRecord = ctx.StagingMISHotlistUpdates.FirstOrDefault(x => x.Id == update.Id);

                if (updateRecord != null)
                {
                    updateRecord.DateSentToMIS = DateTime.Now;
                    ctx.SaveChanges();
                }
            }
        }