public GetScDetailsAndSerialsQM GetSubContractDetailAndSerials(Int64 vendorCode, string DcNumber) { var model = new GetScDetailsAndSerialsQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new GetScDetailsAndSerialSelectCommand { Connection = connection }; model = command.Execute(vendorCode, DcNumber); } return(model); }
public GetScDetailsAndSerialsQM Execute(long vendorCode, string DcNumber) { var response = new GetScDetailsAndSerialsQM(); using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspGetSubContractDetailAndSerials]"; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.Add(AddParameter("@VendorCode", SsDbType.BigInt, ParameterDirection.Input, vendorCode)); sqlCommand.Parameters.Add(AddParameter("@DcNumber", SsDbType.VarChar, ParameterDirection.Input, DcNumber)); using (var reader = SsDbCommandHelper.ExecuteReader(sqlCommand)) { response.getScDetailsAndSerialsModel = reader.ToList <GetScDetailsAndSerialsModel>(); } } return(response); }