public void EditPosition(Position Position) { positionRepository.Update(Position); SavePosition(); }
public void CreatePostion(Position Position) { positionRepository.Add(Position); SavePosition(); }
public void DeletePosition(Position Position) { positionRepository.Delete(Position); SavePosition(); }
public ActionResult PositionAdd(PositionConfigModel item) { if (ModelState.IsValid) { try { Position position = new Position() { PositionName = item.PositionName, InsuranceRate = item.InsuranceRate }; positionService.CreatePostion(position); } catch (Exception e) { ViewData["EditError"] = e.Message; } } else ViewData["EditError"] = "Xin vui lòng kiểm tra lại dữ liệu nhập."; var positions = positionService.GetPositions(); var positionView = Mapper.Map<IEnumerable<Position>, IEnumerable<PositionConfigModel>>(positions); return PartialView("Position/_PositionGridViewPartial", positionView); }