Example #1
0
        public IHttpActionResult GetPart(int lotId, string path)
        {
            var part = this.lotRepository.GetLotIndex(lotId, true).Index.GetPart<SuggestionDO>(path);

            var suggestion = this.suggestionRepository.GetSuggestion(lotId);
            SuggestionViewDO suggestionDO = new SuggestionViewDO(suggestion);

            if (suggestionDO.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 == suggestionDO.ApplicationDocId.Value);

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

            return Ok(new
            {
                data = suggestionDO,
                partData = new PartVersionDO<SuggestionDO>(part)
            });
        }
Example #2
0
        public IHttpActionResult FastSaveSignal(int id, SuggestionViewDO data)
        {
            using (var transaction = this.unitOfWork.BeginTransaction())
            {
                var suggestion = this.suggestionRepository.GetSuggestion(id);
                suggestion.ApplicationDocId = data.ApplicationDocId;

                this.unitOfWork.Save();

                transaction.Commit();

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