public IList <T> GetUnitByBuild <T>(string buildId, out List <string> rows, out List <string> cols) where T : CentaUnitType { string funMsg = "function: GetUnitByBuild<T>(string buildId)" + FileUtility.NewLine + _ClassMsg; try { IList <DataTable> table = _DbService.GetUnitByBuild(buildId); DataTable room = table[0]; List <string> rs = new List <string>(); if (room != null && room.Rows.Count > 0) { foreach (DataRow row in room.Rows) { rs.Add(ConvertUtility.Trim(row[0])); } UnitColSort sort = new UnitColSort(); rs.Sort(sort.Compare); cols = rs; } else { cols = rs; } DataTable floor = table[1]; if (floor != null && floor.Rows.Count > 0) { rs = new List <string>(); foreach (DataRow row in floor.Rows) { rs.Add(ConvertUtility.Trim(row[0])); } UnitRowSort sort = new UnitRowSort(); rs.Sort(sort.Compare); rows = rs; } else { rows = rs; } DataTable all = table[2]; return(ConvertUtility.Table2Model <T>(all)); } catch (Exception ex) { string exMsg = "Exception: " + ex.Message + FileUtility.NewLine + funMsg; throw new Exception(exMsg, ex.InnerException); } }
public IList <string> GetUnitFloorByBuild(string buildId) { string funMsg = "function: GetUnitFloorByBuild(string buildId)" + FileUtility.NewLine + _ClassMsg; try { DataTable table = _DbService.GetUnitFloorByBuild(buildId); List <string> rs = ConvertUtility.Table2Model <string>(table).ToList(); if (rs != null && rs.Count > 0) { UnitRowSort sort = new UnitRowSort(); rs.Sort(sort.Compare); } return(rs); } catch (Exception ex) { string exMsg = "Exception: " + ex.Message + FileUtility.NewLine + funMsg; throw new Exception(exMsg, ex.InnerException); } }
public List <string> ListFloor(string buildId) { string funMsg = "function: ListFloor(string buildId)" + FileUtility.NewLine + _ClassMsg; try { DataTable table = base.ListFloor(buildId); List <string> rs = new List <string>(); if (table != null && table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { rs.Add(ConvertUtility.Trim(row[0])); } UnitRowSort sort = new UnitRowSort(); rs.Sort(sort.Compare); } return(rs); } catch (Exception ex) { throw ex; } }