private void LoadEventInView() { TitleEventLabel.Text = EventDetail.Titulo; DateLabel.Text = EventDetail.Fecha.ToString(AysaConstants.FormatDateToSendEvent); PlaceLabel.Text = EventDetail.Lugar; TypeLabel.Text = EventDetail.Tipo.Nombre; // Status 1 = Open // Status 2 = Close StatusLabel.Text = EventDetail.Estado == 1 ? "Abierto" : "Cerrado"; if (EventDetail.Tag.Length > 0) { TagLabel.Text = EventDetail.Tag; ViewTagConteiner.Hidden = false; } // Set deail event and setup format for DetailLabel LoadDetailLabel(); if (EventDetail.Observaciones != null) { // Load list of Observations LoadObservationsOfEvent(); } // Define confidential string nameImage = EventDetail.Confidencial ? "checked" : "unchecked"; CheckButton.SetImage(UIImage.FromBundle(nameImage), UIControlState.Normal); }
private void ChangeEventStatusCenfidential() { //Show a HUD with a progress spinner and the text BTProgressHUD.Show("Cargando...", -1, ProgressHUD.MaskType.Black); Task.Run(async() => { try { await AysaClient.Instance.SetEventConfidential(EventDetail.Id); InvokeOnMainThread(() => { // Set inverse image string nameImage = EventDetail.Confidencial ? "unchecked" : "checked"; CheckButton.SetImage(UIImage.FromBundle(nameImage), UIControlState.Normal); // Set inverse EventDetail.Confidencial = !EventDetail.Confidencial; // Remove progress BTProgressHUD.Dismiss(); }); } catch (HttpUnauthorized) { InvokeOnMainThread(() => { // Remove progress BTProgressHUD.Dismiss(); ShowSessionExpiredError(); }); } catch (Exception ex) { InvokeOnMainThread(() => { // Remove progress BTProgressHUD.Dismiss(); ShowErrorAlert(ex.Message); }); } }); }