Exemple #1
0
        public IHttpActionResult PostSModeCode(int lotId, SModeCodeDO sModeCodeData)
        {
            using (var transaction = this.unitOfWork.BeginTransaction())
            {
                var lot = this.lotRepository.GetLotIndex(lotId);

                var partVersion = lot.UpdatePart("sModeCodeData", sModeCodeData, this.userContext);

                this.unitOfWork.Save();

                lot.Commit(this.userContext, this.lotEventDispatcher);

                this.lotRepository.ExecSpSetLotPartTokens(partVersion.PartId);

                transaction.Commit();

                return Ok();
            }
        }
Exemple #2
0
        public IHttpActionResult PostSModeCode(SModeCodeDO sModeCodeData)
        {
            using (var transaction = this.unitOfWork.BeginTransaction())
            {
                var newLot = this.lotRepository.CreateLot("SModeCode");
                int smodeCodeCaseTypeId = this.caseTypeRepository.GetCaseTypesForSet("SModeCode").Single().GvaCaseTypeId;
                this.caseTypeRepository.AddCaseTypes(newLot, new int[] { smodeCodeCaseTypeId });
                var sModeCodeDataPart = newLot.CreatePart("sModeCodeData", sModeCodeData, this.userContext);

                newLot.Commit(this.userContext, this.lotEventDispatcher);

                this.unitOfWork.Save();

                this.lotRepository.ExecSpSetLotPartTokens(sModeCodeDataPart.PartId);

                transaction.Commit();

                return Ok(new { id = newLot.LotId });
            }
        }