public static RemoveCertificationResponse RemoveCertification() { ApiDTO apiDTO; CustomCsodDTO customCsodDTO; ApiObjects(out apiDTO, out customCsodDTO); RemoveCertificationItem item = GetCertification(); var certificationApi = new CertificationApi(apiDTO, customCsodDTO); apiDTO.Resource = "/Services/api/Certification/Remove?format=json"; RemoveCertificationResponse response = certificationApi.RemoveCertification(item); return(response); }
private void RegistButton_Click(object sender, RoutedEventArgs e) { try { if (VerificateFields()) { CertificationApi certificationApi = new CertificationApi(); Certification certification = new Certification(credentialUrl: UrlTextBox.Text, issuingCompany: CorpNameTextBox.Text, expirationDate: dpEndDate.SelectedDate, expeditionDate: dpStartDate.SelectedDate, title: TitleTextBox.Text); var user = Configuration.Default.Username; certificationApi.AddCertification(certification, user); CustomMessageBox.ShowOK("La certificación ha sido registrada con éxito.", "Registro exitoso", "Aceptar"); BackIcon_Clicked(new object(), new RoutedEventArgs()); } } catch (ApiException ex) { if (ex.ErrorCode == 500) { CustomMessageBox.ShowOK("Error de conexión con la base de datos, intente mas tarde", "Error de conexión", "Aceptar"); } } }