コード例 #1
0
        public virtual ActionResult EditLeave(int id)
        {
            ViewBag.SupportRefundable = _settingRepository.GetSettingValue(SettingValue.SUPPORT_REFUNDABLE_LEAVE, "false");
            var leave = _leaveRepository.GetById(id);

            return(View(leave));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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();
        }
コード例 #4
0
ファイル: LeaveService.cs プロジェクト: ATZakir/AttendanceNew
        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);
        }