public IHttpActionResult GetAdmission(int lotId) { var admission = this.admissionRepository.GetAdmission(lotId); AdmissionViewDO returnValue = new AdmissionViewDO(admission); return Ok(returnValue); }
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) }); }
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 }); } }