示例#1
0
        protected string GetTransactionTextForProcedure <T>(TransactionTypes transactionType, bool doAlter) where T : Cope <T>, IManageable, new()
        {
            Logger.Info(string.Format("Getting {0} transaction for type {1}. DoAlter = {2}", transactionType.ToString(), typeof(T), doAlter));
            switch (transactionType)
            {
            case TransactionTypes.Delete:
                return(_creator.CreateDeleteStoredProcedure <T>(doAlter));

            case TransactionTypes.DeleteMassive:
                return(_creator.CreateMassiveOperationStoredProcedure <T>(doAlter));

            case TransactionTypes.Insert:
                return(_creator.CreateInsertStoredProcedure <T>(doAlter));

            case TransactionTypes.InsertMassive:
                return(_creator.CreateMassiveOperationStoredProcedure <T>(doAlter));

            case TransactionTypes.Update:
                return(_creator.CreateUpdateStoredProcedure <T>(doAlter));

            case TransactionTypes.UpdateMassive:
                return(_creator.CreateMassiveOperationStoredProcedure <T>(doAlter));

            default:
                ArgumentException argumentException = new ArgumentException("El tipo de transaccion no es valido para generar un nuevo procedimiento almacenado.");
                Logger.Error(argumentException);
                throw argumentException;
            }
        }