public override List <PaymentService> GetPaymentServiceList() { List <PaymentService> list = new List <PaymentService>(); using (SqlConnection connection = this.GetSqlConnection()) { string cmdText = "select * from SuCommerce_PaymentServices where paymentServiceID > 0 order by PaymentServiceID"; SqlCommand command = new SqlCommand(cmdText, connection) { CommandType = CommandType.Text }; connection.Open(); using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection)) { PaymentService service = null; while (reader.Read()) { service = new PaymentService(); CommerceDataProvider.PopulatePaymentServiceList(reader, service, false); list.Add(service); } reader.Close(); connection.Close(); } } return(list); }
public override PaymentService GetPaymentService(int _paymentServiceID, bool _getPrimaryService) { PaymentService service = new PaymentService(); using (SqlConnection connection = this.GetSqlConnection()) { SqlCommand command = new SqlCommand("SuCommerce_PaymentService_Get", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.Add("@paymentServiceID", SqlDbType.Int, 4).Value = _paymentServiceID; command.Parameters.Add("@getPrimaryService", SqlDbType.Bit, 1).Value = _getPrimaryService; connection.Open(); using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection)) { while (reader.Read()) { CommerceDataProvider.PopulatePaymentServiceList(reader, service, true); } reader.Close(); connection.Close(); } } return(service); }