Ejemplo n.º 1
0
        protected override object ExecuteScalarCommand(ExecuteScalarCmdDelegate proc)
        {
            try
            {
                return(proc.Invoke());
            }
            catch (Npgsql.NpgsqlException e)
            {
                if (MessagePrinter != null)
                {
                    MessagePrinter.PrintMessage(e.Message, ErrorsManager.Messages.DBErrorMsg, 1, 1);
                }

                _last_error = e.ErrorCode;
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Обертка для выполнения DbCommand.ExecuteScalar
        /// </summary>
        /// <param name="proc"></param>
        protected override object ExecuteScalarCommand(ExecuteScalarCmdDelegate proc)
        {
            try
            {
                _last_error = 0;
                return(proc.Invoke());
            }
            catch (SqlException e)
            {
                string msg = GetErrorMessage(e);
                if (MessagePrinter != null)
                {
                    MessagePrinter.PrintMessage(msg, ErrorsManager.Messages.DBErrorMsg, 1, 1);
                }
            }

            return(null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Обертка для выполнения DbCommand.ExecuteScalar
        /// </summary>
        /// <param name="proc"></param>
        protected override object ExecuteScalarCommand(ExecuteScalarCmdDelegate proc)
        {
            try
            {
                _last_error = 0;
                return proc.Invoke();
            }
            catch (MySqlException e)
            {
                if (MessagePrinter != null)
                    MessagePrinter.PrintMessage(e.Message, ErrorsManager.Messages.DBErrorMsg, 1, 1);

                _last_error = e.ErrorCode;
            }

            return null;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Обертка для выполнения DbCommand.ExecuteScalar
        /// </summary>
        /// <param name="proc"></param>
        protected override object ExecuteScalarCommand(ExecuteScalarCmdDelegate proc)
        {
            try
            {
                _last_error = 0;
                return proc.Invoke();
            }
            catch (SqlException e)
            {
                string msg = GetErrorMessage(e);
                if (MessagePrinter != null)
                    MessagePrinter.PrintMessage(msg, ErrorsManager.Messages.DBErrorMsg, 1, 1);
            }

            return null;
        }
Ejemplo n.º 5
0
 protected abstract object ExecuteScalarCommand(ExecuteScalarCmdDelegate proc);
Ejemplo n.º 6
0
 protected abstract object ExecuteScalarCommand(ExecuteScalarCmdDelegate proc);