public IActionResult Edit(int id) { var emp = descriptionRespository.Gets(id); var result = new DescriptionEditViewsModel { Id = emp.DescriptionId, Name = emp.OriginName }; return(View(result)); }
public IActionResult Edit(DescriptionEditViewsModel model) { if (ModelState.IsValid) { //var empl = descriptionRespository.Gets(model.Id); var em = new Description() { DescriptionId = model.Id, OriginName = model.Name }; var result = descriptionRespository.Edit(em); if (result != null) { return(RedirectToAction("Index", new { id = result.DescriptionId })); } } return(View(model)); }