public GetSequenceNumberQM GetSequenceNumber(decimal PartCode) { GetSequenceNumberQM model = new GetSequenceNumberQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetSequenceNumberSelectCommand { Connection = connection }; model = command.Execute(PartCode); } return(model); }
public GetSequenceNumberQM Execute(decimal PartCode) { var response = new GetSequenceNumberQM(); using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspGetSequenceNumber]"; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.Add(AddParameter("@PartCode", SsDbType.Decimal, ParameterDirection.Input, PartCode)); using (var reader = SsDbCommandHelper.ExecuteReader(sqlCommand)) { response.SequenceNumberList = reader.ToList <GetSequenceNumberModel>(); } } return(response); }