protected async void LoadEvents(object sender, EventArgs e)
        {
            PortCallMessageGrouper pcmg = new PortCallMessageGrouper();

            callID = Request.QueryString["portCallID"];
            List <portCallMessage> list;

            if (!string.IsNullOrEmpty(callID))
            {
                list = await RestHandler.getEvents(callID);

                vesselDDList.SelectedValue = callID;
                Isreadonly.SetValue(Request.QueryString, false, null);
                Request.QueryString.Clear();
            }
            else
            {
                list = await RestHandler.getEvents(vesselDDList.SelectedItem.Value);
            }

            pcmg = new PortCallMessageGrouper(list);

            eventListBox.DataSource = pcmg.getGroups();
            eventListBox.DataBind();
        }
        protected void rptr_ItemDataBound(Object Sender, RepeaterItemEventArgs e)
        {
            Literal boxHeader = (Literal)e.Item.FindControl("boxHeader");

            List <portCallMessage> list = (List <portCallMessage>)e.Item.DataItem;

            portCallMessage pcm = list[0];

            if (PortCallMessageGrouper.isLocationState(pcm))
            {
                if (pcm.locationState.arrivalLocation != null)
                {
                    if (pcm.locationState.arrivalLocation.to != null)
                    {
                        boxHeader.Text += "To: " + getLocationName(fixTrafficAreaBug(pcm.locationState.arrivalLocation.to.locationMRN));
                        if (pcm.locationState.arrivalLocation.from != null)
                        {
                            boxHeader.Text += "<br />";
                        }
                    }
                    if (pcm.locationState.arrivalLocation.from != null)
                    {
                        boxHeader.Text += "From: " + getLocationName(fixTrafficAreaBug(pcm.locationState.arrivalLocation.from.locationMRN)).ToString();
                    }
                }
                else if (pcm.locationState.departureLocation != null)
                {
                    if (pcm.locationState.departureLocation.to != null)
                    {
                        boxHeader.Text += "To: " + getLocationName(fixTrafficAreaBug(pcm.locationState.departureLocation.to.locationMRN));
                        if (pcm.locationState.departureLocation.from != null)
                        {
                            boxHeader.Text += "<br />";
                        }
                    }
                    if (pcm.locationState.departureLocation.from != null)
                    {
                        boxHeader.Text += "From: " + getLocationName(fixTrafficAreaBug(pcm.locationState.departureLocation.from.locationMRN));
                    }
                }
            }
            else
            {
                boxHeader.Text += FirstCharToUpper(pcm.serviceState.serviceObject.ToString()) + "<br />";
                if (pcm.serviceState.at != null)
                {
                    boxHeader.Text += "At: " + getLocationName(fixTrafficAreaBug(pcm.serviceState.at.locationMRN));
                }
                else
                {
                    boxHeader.Text += "To: " + getLocationName(fixTrafficAreaBug(pcm.serviceState.between.to.locationMRN));
                    boxHeader.Text += "<br />From: " + getLocationName(fixTrafficAreaBug(pcm.serviceState.between.from.locationMRN));
                }
            }


            Repeater timeRepeater = (Repeater)e.Item.FindControl("timeRepeater");
            Repeater boxRepeater  = (Repeater)e.Item.FindControl("boxRepeater");

            timeRepeater.DataSource = e.Item.DataItem;
            timeRepeater.DataBind();
            boxRepeater.DataSource = e.Item.DataItem;
            boxRepeater.DataBind();
        }