//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// DataHelpers.SQL satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using u = user_rtx;

namespace DataHelpers.SQL {

/// <summary>
/// </summary>
[h_db_orm_type]
public static class HDBExceptionsSP {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static HDatabaseException ExpectedResultSetWasNotReceived( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExpectedResultSetWasNotReceived, procedureName );

//--------------------------------------------------------------------------------------------------

public static HDatabaseException NotMoreThanOneRecordWasExpectedInRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.NotMoreThanOneRecordWasExpectedInRSet, procedureName );

public static HDatabaseException NotMoreThanOneRecordWasExpectedIn1stRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.NotMoreThanOneRecordWasExpectedIn1stRSet, procedureName );

public static HDatabaseException NotMoreThanOneRecordWasExpectedIn2ndRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.NotMoreThanOneRecordWasExpectedIn2ndRSet, procedureName );

public static HDatabaseException NotMoreThanOneRecordWasExpectedIn3rdRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.NotMoreThanOneRecordWasExpectedIn3rdRSet, procedureName );

public static HDatabaseException NotMoreThanOneRecordWasExpectedIn4thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.NotMoreThanOneRecordWasExpectedIn4thRSet, procedureName );

public static HDatabaseException NotMoreThanOneRecordWasExpectedIn5thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.NotMoreThanOneRecordWasExpectedIn5thRSet, procedureName );

//--------------------------------------------------------------------------------------------------

public static HDatabaseException ExactlyOneRecordWasExpectedInRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExactlyOneRecordWasExpectedInRSet, procedureName );

public static HDatabaseException ExactlyOneRecordWasExpectedIn1stRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExactlyOneRecordWasExpectedIn1stRSet, procedureName );

public static HDatabaseException ExactlyOneRecordWasExpectedIn2ndRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExactlyOneRecordWasExpectedIn2ndRSet, procedureName );

public static HDatabaseException ExactlyOneRecordWasExpectedIn3rdRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExactlyOneRecordWasExpectedIn3rdRSet, procedureName );

public static HDatabaseException ExactlyOneRecordWasExpectedIn4thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExactlyOneRecordWasExpectedIn4thRSet, procedureName );

public static HDatabaseException ExactlyOneRecordWasExpectedIn5thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ExactlyOneRecordWasExpectedIn5thRSet, procedureName );

//--------------------------------------------------------------------------------------------------

public static HDatabaseException AtLeastOneRecordWasExpectedInRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.AtLeastOneRecordWasExpectedInRSet, procedureName );

public static HDatabaseException AtLeastOneRecordWasExpectedIn1stRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.AtLeastOneRecordWasExpectedIn1stRSet, procedureName );

public static HDatabaseException AtLeastOneRecordWasExpectedIn2ndRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.AtLeastOneRecordWasExpectedIn2ndRSet, procedureName );

public static HDatabaseException AtLeastOneRecordWasExpectedIn3rdRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.AtLeastOneRecordWasExpectedIn3rdRSet, procedureName );

public static HDatabaseException AtLeastOneRecordWasExpectedIn4thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.AtLeastOneRecordWasExpectedIn4thRSet, procedureName );

public static HDatabaseException AtLeastOneRecordWasExpectedIn5thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.AtLeastOneRecordWasExpectedIn5thRSet, procedureName );

//--------------------------------------------------------------------------------------------------

public static HDatabaseException MoreThanOneRecordWereExpectedInRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.MoreThanOneRecordWereExpectedInRSet, procedureName );

public static HDatabaseException MoreThanOneRecordWereExpectedIn1stRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.MoreThanOneRecordWereExpectedIn1stRSet, procedureName );

public static HDatabaseException MoreThanOneRecordWereExpectedIn2ndRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.MoreThanOneRecordWereExpectedIn2ndRSet, procedureName );

public static HDatabaseException MoreThanOneRecordWereExpectedIn3rdRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.MoreThanOneRecordWereExpectedIn3rdRSet, procedureName );

public static HDatabaseException MoreThanOneRecordWereExpectedIn4thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.MoreThanOneRecordWereExpectedIn4thRSet, procedureName );

public static HDatabaseException MoreThanOneRecordWereExpectedIn5thRSet( string procedureName ) =>
   AppendProcedureName( HDBExceptions.MoreThanOneRecordWereExpectedIn5thRSet, procedureName );

//==================================================================================================

public static HDatabaseException SecondResultSetWasExpected( string procedureName ) =>
   AppendProcedureName( HDBExceptions.SecondResultSetWasExpected, procedureName );

public static HDatabaseException ThirdResultSetWasExpected( string procedureName ) =>
   AppendProcedureName( HDBExceptions.ThirdResultSetWasExpected, procedureName );

public static HDatabaseException FourthResultSetWasExpected( string procedureName ) =>
   AppendProcedureName( HDBExceptions.FourthResultSetWasExpected, procedureName );

public static HDatabaseException FifthResultSetWasExpected( string procedureName ) =>
   AppendProcedureName( HDBExceptions.FifthResultSetWasExpected, procedureName );

//==================================================================================================

public static HDatabaseException InconsistentResult( string procedureName ) =>
   AppendProcedureName( HDBExceptions.InconsistentQueryResult, procedureName );

//==================================================================================================

static HDatabaseException AppendProcedureName( HDatabaseException e, string procedureName ) =>
   HDBExceptionCreator.New(
      "{0}\n"+
      "({1}: [{2}].)",
      e.Message,
      u.local.T( "Stored procedure", "Хранимая процедура" ),
      procedureName );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HDBExceptionsSP

} // DataHelpers.SQL
