public ActionResult Delete(int id) { ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id); EmployeeSkillsDTO Record = new EmployeeSkillsDTO(); try { Record.EmpId = _EmployeeSkillService.GetEmpCode(id); _EmployeeSkillService.Delete(id); Session["Success"] = "Successfully Deleted Employee Skill"; } catch (Exception Exception) { ViewBag.Error = Exception.Message; } return(RedirectToAction("Index", "Skill", new { id = Record.EmpId })); }
public IHttpActionResult Delete(int id, EmployeeSkillDTO emplSkill) { if (id != emplSkill.Id) { return(BadRequest()); } try { emplSkillService.Delete(Mapper.Map <EmployeeSkillDTO, EmployeeSkill>(emplSkill)); } catch (Exception ex) { return(NotFound()); } return(Ok()); }