Exemplo n.º 1
0
        public int SaveException(string sErrorMessage)
        {
            SqlCommand command = new SqlCommand();
            int        result  = 0;

            try
            {
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = Constants.SP_SaveException;

                command.Parameters.AddWithValue("@errormessage", sErrorMessage);
                result = base.ExecuteNonQuery(command);
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                LogginOperations logger = new LogginOperations();
                logger.SaveException(ex.Message);
                throw new Exception("Oops! Something went wrong.");
            }
            catch (Exception ex)
            {
                //Do logging..
                LogginOperations logger = new LogginOperations();
                logger.SaveException(ex.Message);
            }
            finally
            {
                command.Dispose();
            }

            return(result);
        }
Exemplo n.º 2
0
 private new void initialize()
 {
     try
     {
         base.initialize();
     }
     catch (Exception ex)
     {
         //do logging.
         LogginOperations logger = new LogginOperations();
         logger.SaveException(ex.Message);
     }
 }