/// <summary> /// 实例化单个返回给客户的展商信息 /// </summary> /// <param name="dr">展场信息datarow</param> /// <param name="table">展位的表格</param> /// <returns>展商的信息</returns> private ExhibitorToCustomerEntity GetExhibitorToCustomerEntity(DataRow dr, DataTable table) { ExhibitorToCustomerEntity item = null; if (dr != null) { item = new ExhibitorToCustomerEntity(); if (dr["ExhibitorID"] != null && dr["ExhibitorID"].ToString() != "") { item.ExhibitorID = int.Parse(dr["ExhibitorID"].ToString()); } if (dr["ExhibitionID"] != null && dr["ExhibitionID"].ToString() != "") { item.ExhibitionID = int.Parse(dr["ExhibitionID"].ToString()); } if (dr["ExhibitorName"] != null) { item.ExhibitorName = dr["ExhibitorName"].ToString(); } if (dr["ExhibitorPinYin"] != null) { item.ExhibitorPinYin = dr["ExhibitorPinYin"].ToString(); } if (dr["IsHadBookList"] != null && dr["IsHadBookList"].ToString() != "") { if ((dr["IsHadBookList"].ToString() == "1") || (dr["IsHadBookList"].ToString().ToLower() == "true")) { item.IsHadBookList = true; } else { item.IsHadBookList = false; } } DataRow[] drs = table.Select("ExhibitorID = " + item.ExhibitorID.ToString()); if (drs != null) { if (drs.Length > 0) { item.ExhibitorLocationList = new List <ExhibitorToCustomerLocationEntity>(); foreach (DataRow drl in drs) { ExhibitorToCustomerLocationEntity locationItem = this.GetExhibitorToCustomerLocationEntity(drl); if (locationItem != null) { item.ExhibitorLocationList.Add(locationItem); } } } } } return(item); }
/// <summary> /// 根据展位信息实例化展位对象 /// </summary> /// <param name="drl">展位datarow</param> /// <returns>展位对象</returns> private ExhibitorToCustomerLocationEntity GetExhibitorToCustomerLocationEntity(DataRow drl) { ExhibitorToCustomerLocationEntity item = null; if (drl != null) { item = new ExhibitorToCustomerLocationEntity(); if (drl["ExhibitorLocationID"] != null && drl["ExhibitorLocationID"].ToString() != "") { item.ExhibitorLocationID = int.Parse(drl["ExhibitorLocationID"].ToString()); } if (drl["ExhibitorLocation"] != null) { item.ExhibitorLocation = drl["ExhibitorLocation"].ToString(); } if (drl["ExhibitiorLocationOrder"] != null && drl["ExhibitiorLocationOrder"].ToString() != "") { item.ExhibitiorLocationOrder = int.Parse(drl["ExhibitiorLocationOrder"].ToString()); } } return(item); }