示例#1
0
        public IHttpActionResult GetAdmission(int lotId)
        {
            var admission = this.admissionRepository.GetAdmission(lotId);
            AdmissionViewDO returnValue = new AdmissionViewDO(admission);

            return Ok(returnValue);
        }
示例#2
0
        public IHttpActionResult GetPart(int lotId, string path)
        {
            var part = this.lotRepository.GetLotIndex(lotId, true).Index.GetPart<AdmissionDO>(path);

            var admission = this.admissionRepository.GetAdmission(lotId);
            AdmissionViewDO admissionDO = new AdmissionViewDO(admission);

            if (admissionDO.ApplicationDocId.HasValue)
            {
                var dr = unitOfWork.DbContext.Set<Docs.Api.Models.DocRelation>()
                     .Include(e => e.Doc.DocCasePartType)
                     .Include(e => e.Doc.DocCasePartMovements.Select(dc => dc.User))
                     .Include(e => e.Doc.DocDirection)
                     .Include(e => e.Doc.DocType)
                     .Include(e => e.Doc.DocStatus)
                     .FirstOrDefault(e => e.DocId == admissionDO.ApplicationDocId.Value);

                admissionDO.ApplicationDocRelation = new Docs.Api.DataObjects.DocRelationDO(dr);
            }

            return Ok(new
            {
                data = admissionDO,
                partData = new PartVersionDO<AdmissionDO>(part)
            });
        }
示例#3
0
        public IHttpActionResult FastSaveAdmission(int id, AdmissionViewDO data)
        {
            using (var transaction = this.unitOfWork.BeginTransaction())
            {
                var admission = this.admissionRepository.GetAdmission(id);
                admission.ApplicationDocId = data.ApplicationDocId;

                this.unitOfWork.Save();

                transaction.Commit();

                return Ok(new { id = id });
            }
        }