public GetInstrumentMasterQM GetInstrumentMaster() { var model = new GetInstrumentMasterQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new InstrumentMasterSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetInstrumentMasterQM Execute() { var response = new GetInstrumentMasterQM(); using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspGetInstrumentMaster]"; sqlCommand.CommandType = CommandType.StoredProcedure; //sqlCommand.Parameters.Add(AddParameter("@InstrumentCode", SsDbType.BigInt, ParameterDirection.Input, model.InstrumentCode)); //sqlCommand.Parameters.Add(AddParameter("@PageSize", SsDbType.Int, ParameterDirection.Input, model.PageSize)); //sqlCommand.Parameters.Add(AddParameter("@PageIndex", SsDbType.Int, ParameterDirection.Input, model.PageIndex)); sqlCommand.Parameters.Add(AddParameter("@RecordCount", SsDbType.Int, ParameterDirection.Output, default(int))); using (var reader = SsDbCommandHelper.ExecuteReader(sqlCommand)) { response.GetInstrumentMasterList = reader.ToList <InstrumentMasterModel>(); } response.RecordCount = Convert.ToInt32(sqlCommand.Parameters["@RecordCount"].Value); } return(response); }