62,040
社区成员
发帖
与我相关
我的任务
分享
public ArrayList GetEDMHotelInformation(String sName)
{
//填充数据///
}
if (ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow _row in ds.Tables[0].Rows)
{
//数据表对应的模型实体类
Entity en = new Entity();
en.PropertyId = row["htl_propertyid"].ToString();
en.Eat = row["htl_eat2eat"].ToString();
......
//列表收录该实体,进入下一条数据循环
arrHotellist.Add(en);
}
}
public ArrayList GetEDMHotelInformation(String sName)
{
ArrayList arrHotellist = new ArrayList();
mysqldatabase mysql = new mysqldatabase();
DataSet ds;
if (!String.IsNullOrEmpty(sName))
{
ds = mysql.Select("select * from cm_hotel where htl_name ='" + sName + "' AND sys_deleted<>'Y' ", null);
if (ds.Tables[0].Rows.Count > 0)
{
arrHotellist.Add(ds.Tables[0].Rows[0]["htl_propertyid"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[1]["htl_eat2eat"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[2]["htl_allowreservation"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[3]["htl_brand"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[4]["htl_address"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[5]["htl_country"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[6]["htl_city"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[7]["htl_postcode"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[8]["htl_phone"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[9]["htl_fax"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[10]["htl_email"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[11]["htl_website"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[12]["htl_brief"].ToString());
arrHotellist.Add(ds.Tables[0].Rows[13]["htl_overview"].ToString());
}
}
return arrHotellist;
}
EdmWebReference.Service1 edmservice = new EdmWebReference.Service1();