public GetDimensionReportQM GetDimensionReport(string InvoiceNumber, decimal InvoiceSerial, int IsReportFor) { var response = new GetDimensionReportQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetDimensionReportSelectCommand { Connection = connection }; response = command.Execute(InvoiceNumber, InvoiceSerial, IsReportFor); } return(response); }
public GetDimensionReportQM Execute(string InvoiceNumber, decimal InvoiceSerial, int IsReportFor) { var response = new GetDimensionReportQM(); using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspGetDimensionCardEntryReport]"; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.Add(AddParameter("@InvoiceNumber", SsDbType.NVarChar, ParameterDirection.Input, InvoiceNumber)); sqlCommand.Parameters.Add(AddParameter("@InvoiceSerial", SsDbType.Decimal, ParameterDirection.Input, InvoiceSerial)); sqlCommand.Parameters.Add(AddParameter("@IsReportFor", SsDbType.Int, ParameterDirection.Input, IsReportFor)); using (var reader = SsDbCommandHelper.ExecuteReader(sqlCommand)) { response.getDimensionReportModel = reader.ToList <GetDimensionReportModel>(); } } return(response); }