示例#1
0
        public IHttpActionResult PostEquipment(EquipmentDataDO equipmentData)
        {
            using (var transaction = this.unitOfWork.BeginTransaction())
            {
                var newLot = this.lotRepository.CreateLot("Equipment");

                var partVersion = newLot.CreatePart("equipmentData", equipmentData, this.userContext);

                int equipmentCaseTypeId = this.caseTypeRepository.GetCaseTypesForSet("Equipment").Single().GvaCaseTypeId;
                this.caseTypeRepository.AddCaseTypes(newLot, new int[] { equipmentCaseTypeId });

                newLot.Commit(this.userContext, lotEventDispatcher);

                this.unitOfWork.Save();

                this.lotRepository.ExecSpSetLotPartTokens(partVersion.PartId);

                transaction.Commit();

                return Ok(new { id = newLot.LotId });
            }
        }
示例#2
0
        public IHttpActionResult PostEquipmentData(int lotId, EquipmentDataDO equipmentData)
        {
            using (var transaction = this.unitOfWork.BeginTransaction())
            {
                var lot = this.lotRepository.GetLotIndex(lotId);
                var partVersion = lot.UpdatePart("equipmentData", equipmentData, this.userContext);

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

                this.unitOfWork.Save();

                this.lotRepository.ExecSpSetLotPartTokens(partVersion.PartId);

                transaction.Commit();

                return Ok();
            }
        }
示例#3
0
        public IHttpActionResult GetNewEquipment()
        {
            EquipmentDataDO equipmentData = new EquipmentDataDO();

            return Ok(equipmentData);
        }