public GetJigsMasterQM GetJigsMaster() { var model = new GetJigsMasterQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new JigsMasterSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetJigsMasterQM Execute() { var response = new GetJigsMasterQM(); using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspGetJigsMaster]"; sqlCommand.CommandType = CommandType.StoredProcedure; //sqlCommand.Parameters.Add(AddParameter("@JigsCode", SsDbType.Decimal, ParameterDirection.Input, Convert.ToInt32(model.JigsCode))); //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.GetJigsMasterList = reader.ToList <JigsMasterModel>(); } response.RecordCount = Convert.ToInt32(sqlCommand.Parameters["@RecordCount"].Value); } return(response); }