/// <summary> /// Maps the gangway history. /// </summary> /// <param name="musterHistory">The muster history.</param> /// <returns>Party Detail History</returns> public static PartyDetailHistoryInfo MapMusterHistory(DrillEventDetail musterHistory) { var partyDetailHistoryInfo = new PartyDetailHistoryInfo(); if (musterHistory != null) { partyDetailHistoryInfo.EventDateTime = musterHistory.EventDateTime; partyDetailHistoryInfo.EventDescription = musterHistory.EventName; partyDetailHistoryInfo.Location = musterHistory.LocationName; partyDetailHistoryInfo.Port = string.Empty; partyDetailHistoryInfo.UserName = musterHistory.AddedBy; partyDetailHistoryInfo.EventProcessType = string.Empty; partyDetailHistoryInfo.IsGangway = false; } return partyDetailHistoryInfo; }
/// <summary> /// Maps the gangway history. /// </summary> /// <param name="gangwayHistory">The gangway history.</param> /// <returns>Party Detail History</returns> public static PartyDetailHistoryInfo MapGangwayHistory(PersonEventHistory gangwayHistory) { var partyDetailHistoryInfo = new PartyDetailHistoryInfo(); if (gangwayHistory != null) { partyDetailHistoryInfo.EventDateTime = gangwayHistory.EventDateTime.HasValue ? gangwayHistory.EventDateTime.Value : default(DateTime?); partyDetailHistoryInfo.EventDescription = gangwayHistory.GangwayEventDescription; partyDetailHistoryInfo.Location = gangwayHistory.GangwayLocation; partyDetailHistoryInfo.Port = gangwayHistory.Port; partyDetailHistoryInfo.UserName = gangwayHistory.UserName; partyDetailHistoryInfo.EventProcessType = gangwayHistory.GangwayEventProcessType; partyDetailHistoryInfo.IsGangway = true; } return partyDetailHistoryInfo; }
/// <summary> /// Function to assign the gangway history data. /// </summary> /// <param name="worksheet">Instance of worksheet</param> /// <param name="personGangwayHistory">Instance of troll gangway event.</param> /// <param name="rowNumber">The row number.</param> private static void AssignGangwayHistoryData(Worksheet worksheet, PartyDetailHistoryInfo personGangwayHistory, int rowNumber) { worksheet.Cells[rowNumber, LastEventColumnIndex] = personGangwayHistory.EventDescription; worksheet.Cells[rowNumber, DateTimeColumnIndex] = personGangwayHistory.EventDateTime.HasValue ? personGangwayHistory.EventDateTime.Value.AddMilliseconds(-personGangwayHistory.EventDateTime.Value.Millisecond) : default(DateTime?); worksheet.Cells[rowNumber, LocationColumnIndex] = personGangwayHistory.Location; worksheet.Cells[rowNumber, PortColumnIndex] = personGangwayHistory.Port; worksheet.Cells[rowNumber, ProcessTypeColumnIndex] = personGangwayHistory.EventProcessType; worksheet.Cells[rowNumber, UserColumnIndex] = personGangwayHistory.UserName; }
/// <summary> /// Write the data into the Excel sheet /// </summary> /// <param name="worksheet">Excel WorkSheet</param> /// <param name="personGangwayEvent">Instance of PartyDetailHistoryInfo</param> /// <param name="rowNumber">Row Number Value </param> private static void WriteDataIntoExcelSheet(Worksheet worksheet, PartyDetailHistoryInfo personGangwayEvent, int rowNumber) { AssignGangwayHistoryData(worksheet, personGangwayEvent, rowNumber); }