Exemplo n.º 1
0
        private void SetEventDetails(SavedEvent @event)
        {
            DateAndTime currDate       = new DateAndTime(TimeAndDateUtility.GetCurrentDate(), TimeAndDateUtility.GetCurrentTime());
            DateAndTime eventStartDate = @event.ActivationDate;
            DateAndTime eventEndDate   = @event.DeactivationDate;

            Exp_Start_Date.SetText(TimeAndDateUtility.ConvertDate_String(@event.ActivationDate.Date, true));
            Exp_Start_Time.SetText(TimeAndDateUtility.ConvertTime_String(@event.ActivationDate.Time));
            Exp_End_Date.SetText(TimeAndDateUtility.ConvertDate_String(@event.DeactivationDate.Date, true));
            Exp_End_Time.SetText(TimeAndDateUtility.ConvertTime_String(@event.DeactivationDate.Time));
            Created_Date.SetText(
                $"{TimeAndDateUtility.ConvertDate_String(@event.CreatedDate.Date, true)} {TimeAndDateUtility.ConvertTime_String(@event.CreatedDate.Time)}");

            Completion_Date.SetText(
                @event.Completed && @event.CompletedDate != null && @event.CompletedDate.Date != null && @event.CompletedDate.Time != null ?
                $"{TimeAndDateUtility.ConvertDate_String(@event.CompletedDate.Date, true)} {TimeAndDateUtility.ConvertTime_String(@event.CompletedDate.Time)}"
                    : DASH);

            Event_Status.SetText(
                @event.Completed ? "Complete"
                    : TimeAndDateUtility.IsBeforeRange(eventStartDate, currDate) ?
                "Upcoming"
                        : TimeAndDateUtility.IsWithinRange(eventStartDate, currDate, eventEndDate) ?
                "In Progress" : "Overdue");
            Event_Status.SetBackColor(
                @event.Completed ? Color.DarkGreen
                    : TimeAndDateUtility.IsBeforeRange(eventStartDate, currDate) ?
                Color.DarkGray
                        : TimeAndDateUtility.IsWithinRange(eventStartDate, currDate, eventEndDate) ?
                Color.DarkBlue : Color.DarkRed);

            User_Title.SetText(@event.Title);

            User_Comment.SetText(!string.IsNullOrEmpty(@event.Comment) ? @event.Comment : NO_COMMENT);
        }
Exemplo n.º 2
0
        private void ClearEventDetails()
        {
            Exp_Start_Date.SetText(DASH);
            Exp_Start_Time.SetText(DASH);
            Exp_End_Date.SetText(DASH);
            Exp_End_Time.SetText(DASH);
            Created_Date.SetText(DASH);
            Completion_Date.SetText(DASH);
            User_Title.SetText(DASH);
            Event_Status.SetText(DASH);
            Event_Status.SetBackColor(Color.DarkGray);

            User_Comment.SetText(NO_COMMENT);
        }