//This constructor is only for repeated events (i.e. the original event will not use this constructor but any repeats of it will use this) public ViewEvent(BUS_WFMDashboard_Event item, DateTime inputDate) { OriginalStartDate = item.StartTime.ToShortDateString(); OriginalEndDate = item.EndTime.ToShortDateString(); ColorId = item.Color; Id = item.Id; title = item.Description; TeamName = item.TeamName; LastName = item.LastName; FirstName = item.FirstName; allDay = item.FullDay; EventType = item.EventType; Notes = item.Notes; CalendarEventId = item.CalendarEventId; repeatedEvent = true; Cancelled = item.Cancelled; var daysDifference = (inputDate - item.StartTime.Date).Days; if (allDay) { StartDate = start = inputDate.ToShortDateString(); end = item.EndTime.AddDays(daysDifference).ToShortDateString(); EndDate = item.EndTime.AddDays(daysDifference).AddDays(-1).ToShortDateString(); OriginalEndDate = item.EndTime.AddDays(-1).ToShortDateString(); } else { StartDate = inputDate.ToShortDateString(); EndDate = item.EndTime.AddDays(daysDifference).ToShortDateString(); StartTime = item.StartTime.ToShortTimeString(); EndTime = item.EndTime.ToShortTimeString(); start = StartDate + " " + StartTime; end = EndDate + " " + EndTime; } if (item.Color != null) { textColor = "black"; borderColor = "black"; backgroundColor = colorList[item.Color]; } else { backgroundColor = "#3a87ad"; } }
public static string PrintEvent(BUS_WFMDashboard_Event eventItem, BUS_WFMDashboard_Repeating_Event repeatingItem) { StringBuilder outputString = new StringBuilder("Event:"); outputString.AppendLine("AgentNo: " + eventItem.AgentNo); outputString.AppendLine("CalendarEventId: " + eventItem.CalendarEventId); outputString.AppendLine("Color: " + eventItem.Color); outputString.AppendLine("CreatedBy: " + eventItem.CreatedBy); outputString.AppendLine("CreatedAt: " + eventItem.CreatedAt); outputString.AppendLine("Description: " + eventItem.Description); outputString.AppendLine("StartTime: " + eventItem.StartTime.ToString("MM/dd/yyyy HH:mm")); outputString.AppendLine("EndTime: " + eventItem.EndTime.ToString("MM/dd/yyyy HH:mm")); outputString.AppendLine("EventType: " + eventItem.EventType); outputString.AppendLine("FirstName: " + eventItem.FirstName); outputString.AppendLine("LastName: " + eventItem.LastName); outputString.AppendLine("FullDay: " + eventItem.FullDay); outputString.AppendLine("Notes: " + eventItem.Notes); outputString.AppendLine("TeamName: " + eventItem.TeamName); outputString.AppendLine("TeamId: " + eventItem.TeamId); if (repeatingItem != null) { outputString.AppendLine("Repeating Event: "); outputString.AppendLine("Repeat Type: " + repeatingItem.RepeatType); outputString.AppendLine("Repeat Every Number: " + repeatingItem.RepeatEveryNumber); outputString.AppendLine("Repeat On Days: " + repeatingItem.RepeatOnDays); outputString.AppendLine("Start Date: " + repeatingItem.StartDate.ToShortDateString()); outputString.AppendLine("End After Occurences: " + repeatingItem.EndAfterOccurences); if (repeatingItem.EndDate != null) { outputString.AppendLine("End Date: " + repeatingItem.EndDate.Value.ToShortDateString()); } outputString.AppendLine("Repeat Summary: " + repeatingItem.RepeatSummary); outputString.AppendLine("End Type: " + repeatingItem.EndType); if (repeatingItem.CalculatedEndDate != null) { outputString.AppendLine("Calculated End Date: " + repeatingItem.CalculatedEndDate.Value.ToShortDateString()); } } return(outputString.ToString()); }
public ViewEvent(BUS_WFMDashboard_Event item, bool past, bool Repeating, List <BUS_WFMDashboard_Event_Notification> notifications, List <BUS_WFMDashboard_Event_Invitee> invitees) { repeating = Repeating; Cancelled = item.Cancelled; ColorId = item.Color; Id = item.Id; title = item.Description; TeamName = item.TeamName; LastName = item.LastName; FirstName = item.FirstName; allDay = item.FullDay; EventType = item.EventType; Notes = item.Notes; CalendarEventId = item.CalendarEventId; if (allDay) { start = StartDate = item.StartTime.ToShortDateString(); end = item.EndTime.ToShortDateString(); EndDate = item.EndTime.AddDays(-1).ToShortDateString(); } else { StartDate = item.StartTime.ToShortDateString(); EndDate = item.EndTime.ToShortDateString(); StartTime = item.StartTime.ToShortTimeString(); EndTime = item.EndTime.ToShortTimeString(); start = StartDate + " " + StartTime; end = EndDate + " " + EndTime; } if (item.Color != null) { if (past) { textColor = "grey"; borderColor = "grey"; backgroundColor = colorListPast[item.Color]; } else { textColor = "black"; borderColor = "black"; backgroundColor = colorList[item.Color]; } } else { backgroundColor = "#3a87ad"; } Notifications = new List <ViewNotificationItem>(); foreach (var notification in notifications) { Notifications.Add(new ViewNotificationItem() { Id = notification.Id, notificationTime = notification.NotificationTime, notificationType = notification.NotificationType }); } Invitees = new List <ViewInviteeItem>(); foreach (var invitee in invitees) { if (invitee.AgentNo == 0) { Invitees.Add(new ViewInviteeItem() { Id = invitee.Id, agentNo = invitee.AgentNo.Value, email = invitee.Email, firstName = invitee.FirstName, lastName = "" }); } else { Invitees.Add(new ViewInviteeItem() { Id = invitee.Id, agentNo = invitee.AgentNo.Value, email = invitee.Email, firstName = invitee.FirstName, lastName = invitee.LastName }); } } }