public static string BindShortTimeSpan(DataRow Container, string Item, string OccupancyStateItem, CustomerConfig customerCfg) { string ReturnValue = string.Empty; try { if (Container[OccupancyStateItem] == DBNull.Value) ReturnValue = "N/A"; else if (((Duncan.PEMS.SpaceStatus.Models.OccupancyState)(Container[OccupancyStateItem])) == Duncan.PEMS.SpaceStatus.Models.OccupancyState.OutOfDate) ReturnValue = "N/A"; else if (((Duncan.PEMS.SpaceStatus.Models.OccupancyState)(Container[OccupancyStateItem])) == Duncan.PEMS.SpaceStatus.Models.OccupancyState.NotAvailable) ReturnValue = "N/A"; else { if (Container[Item] == System.DBNull.Value) ReturnValue = "N/A"; else ReturnValue = SpaceStatusProvider.FormatShortTimeSpan((TimeSpan)Container[Item], customerCfg); } } catch { return "N/A"; } return ReturnValue; }
public static string BindShortTimeSpan(TimeSpan Item, OccupancyState OccupancyStateItem, CustomerConfig customerCfg) { string ReturnValue = string.Empty; try { if (OccupancyStateItem == Duncan.PEMS.SpaceStatus.Models.OccupancyState.Unknown) ReturnValue = "N/A"; else if (OccupancyStateItem == Duncan.PEMS.SpaceStatus.Models.OccupancyState.OutOfDate) ReturnValue = "N/A"; else if (OccupancyStateItem == Duncan.PEMS.SpaceStatus.Models.OccupancyState.NotAvailable) ReturnValue = "N/A"; else { if (Item == null) ReturnValue = "N/A"; else ReturnValue = SpaceStatusProvider.FormatShortTimeSpan(Item, customerCfg); } } catch { return "N/A"; } return ReturnValue; }