public virtual ActionResult EditLeave(int id) { ViewBag.SupportRefundable = _settingRepository.GetSettingValue(SettingValue.SUPPORT_REFUNDABLE_LEAVE, "false"); var leave = _leaveRepository.GetById(id); return(View(leave)); }
public async Task DeleteLeave(Guid id) { var leave = await _leaveRepository.GetById(id); var soldier = await _soldierRepository.GetById((Guid)leave.SoldierId); soldier.Status = "X"; await _soldierRepository.UpdateSoldier(soldier); await _leaveRepository.DeleteLeave(id); }
public async Task UpdateLeaveInfo(Leave leave) { var leavePO = _leaveRepository.GetById(leave.Id); if (leavePO == null) { throw new SampleDomainException("Leave does not exists!"); } _leaveRepository.Save(_leaveFactory.CreateLeavePO(leave)); await _leaveRepository.UnitOfWork.SaveChangesAsync(); }
public bool DeleteLeave(string id) { bool isSuccess = true; var leave = leaveRepository.GetById(id); try { leaveRepository.Delete(leave); SaveRecord(); ServiceUtil <Leave> .WriteActionLog(id, ENUMOperation.DELETE); } catch (Exception ex) { isSuccess = false; logger.Error("Error in deleting Leave", ex); } return(isSuccess); }