public static DataSet GetPPriceList(string aircompany, string departPort, string arrivePort, string cabin,Boolean flag=false)
{
string sql = "SELECT ID, AirCompany,DepartCode,ArriveCode,ServerGrade,Cabin,Price,Agio,SaleBeginTime,SaleEndTime,TravelBeginTime,TravelEndTime FROM PPrice WHERE `Status`=1 AND SaleEndTime>NOW() AND TravelEndTime>NOW() ";
if (aircompany != "")
{
sql += " and AirCompany='" + aircompany + "' ";
}
if (departPort != "")
{
sql += " and DepartCode='" + departPort + "' ";
}
if (arrivePort != "")
{
sql += " and ArriveCode='" + arrivePort + "' ";
}
if (cabin != "")
{
sql += " and Cabin='" + cabin + "'";
}
sql += " ORDER BY ModifyTime DESC ";
DataSet ds = null;
using (MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection(MySqlHelper.ConnectionString))
{
if (ConnectionState.Open != conn.State)
conn.Open();
if (flag)
{
MySql.Data.MySqlClient.MySqlTransaction tra = conn.BeginTransaction(IsolationLevel.ReadUncommitted);
ds = MySqlHelper.ExecuteDataset(tra, CommandType.Text, sql);
tra.Commit();
}
else
{
ds = MySqlHelper.ExecuteDataset(conn, CommandType.Text, sql);
}
}
return ds;
}