public GetOperationMasterQM GetOperationMaster() { var model = new GetOperationMasterQM(); using (var connection = new DbConnectionProvider().CreateConnection()) { connection.Open(); var command = new OperationMasterSelectCommand { Connection = connection }; model = command.Execute(); } return(model); }
public GetOperationMasterQM Execute() { var response = new GetOperationMasterQM(); using (var sqlCommand = CreateCommand()) { sqlCommand.Connection = Connection; sqlCommand.CommandText = "[dbo].[uspGetOperationMaster]"; sqlCommand.CommandType = CommandType.StoredProcedure; //sqlCommand.Parameters.Add(AddParameter("@OperationCode", SsDbType.Decimal, ParameterDirection.Input, Convert.ToInt32(model.OperationCode))); //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.GetOperationMasterList = reader.ToList <OperationMasterModel>(); } response.RecordCount = Convert.ToInt32(sqlCommand.Parameters["@RecordCount"].Value); } return(response); }