// api/Employer/Delete public IHttpActionResult Post(string id) { if (!_employerService.DeleteEmployer(id)) { return(InternalServerError()); } return(Ok()); }
public IActionResult Delete(string EmployerId) { var result = service.DeleteEmployer(EmployerId); return(Ok(new SuccessResponse <string> { Code = 200, Data = result })); }
private void btDeleteEmployer_Click(object sender, RoutedEventArgs e) { var result = MessageBox.Show("Вы уверены?", "Удалить запись", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { var employerModel = (EmployerViewModels)dGridEmployer.SelectedItem; employerService.DeleteEmployer(employerModel.EmployerId); ResetCollectionWithFilters("EmployersViewModel");//нужно ли reset делать для др viewmodel ResetCollection("VacanciesViewModel"); dGridEmployer.SelectedIndex = 0; } }
public IActionResult DeleteEmployer(int id) { _employerService.DeleteEmployer(id); return(RedirectToAction("Index")); }