using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
namespace DAL
{
public class CustomersData
{
public DataTable GetCustomers()
{
string ConnectionString =
ConfigurationSettings.AppSettings
["ConnectionString"];
DatabaseType dbtype =
(DatabaseType)Enum.Parse
(typeof(DatabaseType),
ConfigurationSettings.AppSettings
["DatabaseType"]);
IDbConnection cnn =
DataFactory.CreateConnection
(ConnectionString,dbtype);
string cmdString = "SELECT CustomerID" +
",CompanyName,ContactName FROM Customers";
IDbCommand cmd =
DataFactory.CreateCommand(
cmdString, dbtype,cnn);
DbDataAdapter da =
DataFactory.CreateAdapter(cmd,dbtype);
DataTable dt = new DataTable("Customers");
da.Fill(dt);
return dt;
}
public CustomersDS GetCustomerOrders(string CustomerID)
{
// 待定
return null;
}
public CustomersList GetCustomersByCountry
(string CountryCode)
{
// 待定
return null;
}
public bool InsertCustomer()
{
// 待定
return false;
}
}
} |