Пример #1
0
        public int CheckEnquiryStages(EnquiryStatusUpdateInput input)
        {
            var title = (from c in _EnquiryStatusRepository.GetAll()
                         join d in _StageDetailRepository.GetAll() on c.Id equals d.StageId
                         where d.MileStones.Id == input.StatusId
                         select c).ToArray();

            return(title.Count());
        }
Пример #2
0
        public void EnquiryStatusUpdate(EnquiryStatusUpdateInput input)
        {
            var inquiry          = (from r in _inquiryRepository.GetAll() where r.Id == input.EnquiryId select r).FirstOrDefault();
            var CurrentStatusId  = inquiry.MileStoneId;
            var UpdateStatusName = (from r in _milestoneRepository.GetAll() where r.Id == input.StatusId select r).FirstOrDefault();

            var inquirys = inquiry.MapTo <Inquiry>();

            inquirys.MileStoneId = input.StatusId;
            inquirys.StatusId    = input.StageId;
            _inquiryRepository.UpdateAsync(inquirys);

            if (input.LastActivity != null)
            {
                var enquiryDetail = _enquiryDetailRepository.GetAll().Where(p => p.InquiryId == input.EnquiryId).FirstOrDefault();
                var enqdetail     = enquiryDetail.MapTo <EnquiryDetail>();
                enqdetail.LastActivity = input.LastActivity;
                _enquiryDetailRepository.UpdateAsync(enqdetail);
            }
        }