示例#1
0
        /// <summary>
        /// 领导同意或驳回借阅
        /// </summary>
        /// <param name="docmengId"></param>
        /// <param name="borrowId"></param>
        /// <param name="agree"></param>
        /// <returns></returns>
        public async Task <bool> Agree(AgreeInput input)
        {
            var borr = _docmentBorrowRepository.Get(input.BorrowId);

            var subs = _docmentBorrowSubRepository.GetAll().Where(ite => ite.BorrowId == input.BorrowId);

            foreach (var s in subs)
            {
                if (s.Status != BorrowSubStatus.审核中)
                {
                    continue;
                }
                if (input.DocmentIds.Contains(s.DocmentId))
                {
                    if (borr.IsOut.HasValue && borr.IsOut.Value)
                    {
                        s.Status = BorrowSubStatus.待领取;
                    }
                    else
                    {
                        s.Status = BorrowSubStatus.意;
                    }
                }
                else
                {
                    s.Status = BorrowSubStatus.驳回;
                }
            }
            return(true);
        }
示例#2
0
        /// <summary>
        /// 档案管理员借出
        /// </summary>
        /// <param name="docmengId"></param>
        /// <param name="borrowId"></param>
        /// <returns></returns>
        public async Task <bool> SureBorrow(AgreeInput input)
        {
            var subs = _docmentBorrowSubRepository.GetAll().Where(ite => ite.BorrowId == input.BorrowId).ToList();

            foreach (var s in subs)
            {
                if (s.Status == BorrowSubStatus.意 || s.Status == BorrowSubStatus.审核中)
                {
                    s.Status = BorrowSubStatus.待领取;
                }
            }
            return(true);
        }