public IHttpActionResult Delete(string id)
        {
            if (!servicio.ExisteNifPersona(id))
            {
                return(NotFound());
            }

            servicio.Eliminar(id);
            return(Ok());
        }
示例#2
0
 protected void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         var nif = lblNif.Text;
         personaServicio.Eliminar(nif);
         Response.Redirect("Index.aspx", true);
     }
     catch (Exception)
     {
         CustomValidator err = new CustomValidator();
         err.IsValid      = false;
         err.ErrorMessage = "Ocurrio un error al eliminar el registro";
         Page.Validators.Add(err);
     }
 }