Пример #1
0
        public virtual string ProcessDbExcetion(int returnCode)
        {
            MessageBoxs msg     = new MessageBoxs();
            IvsMessage  message = null;

            switch (returnCode)
            {
            case CommonData.DbReturnCode.AccessDenied:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_ACCESS_DENIED);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.InvalidHost:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_INVALID_HOST);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.InvalidDatabase:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_INVALID_DATABASE);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.LostConnection:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_CONNECTION_LOST);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.DuplicateKey:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_DUPPLICATE_KEY);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.ForgeignKeyNotExist:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_FOREIGN_KEY_NOT_EXIST);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.ForeignKeyViolation:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_FOREIGN_KEY_VIOLATION);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.DataNotFound:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_DATA_NOT_FOUND);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.DeadlockFound:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_DEADLOCK_FOUND);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.LockWaitTimeoutExceeded:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_LOCK_WAIT_TIMEOUT_EXCEEDED);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.ExceptionOccured:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_GENERAL_EXCEPTION);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;

            case CommonData.DbReturnCode.ConcurrencyViolation:
                message = new IvsMessage(CommonConstantMessage.COM_MSG_CONCURRENCY_VIOLATION);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);

                break;
            }
            return(msg.DisplayMessage);
        }
Пример #2
0
        public virtual string ProcessCommonExcetion(int returnCode)
        {
            MessageBoxs msg     = new MessageBoxs();
            IvsMessage  message = null;

            switch (returnCode)
            {
            case CommonData.ImportReturnCode.PathNotExist:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_DATA_OR_FILE_NOT_FOUND);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.ImportReturnCode.FileFormatInvalid:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_FILE_FORMAT_INVALID);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.ImportReturnCode.NumRowInvalid:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_FILE_NUM_OF_ROW_INVALID);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.ImportReturnCode.NumFieldInvalid:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_FILE_NUM_OF_COLUMN_INVALID);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.ImportReturnCode.SystemError:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_GENERAL_EXCEPTION);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.IOReturnCode.PrinterInValid:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_PRINTER_INVALID);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.IOReturnCode.RPCServerUnavailable:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_RPC_SERVER_UNAVAILABLE);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.IOReturnCode.AccessDenied:

                message = new IvsMessage(CommonConstantMessage.COM_MSG_ACCESS_DENIED);
                msg.Add(message);
                msg.Display(CommonData.MessageType.Ok);
                break;

            case CommonData.IOReturnCode.CancelExport:
                message             = new IvsMessage(CommonConstantMessage.COM_MSG_EXPORT_NOT_FLOW);
                message.MessageIcon = CommonData.MessageIcon.Error;
                msg.Add(message);

                msg.Display(CommonData.MessageType.Ok);
                break;
            }
            return(msg.DisplayMessage);
        }