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 }); } }
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(); } }
public IHttpActionResult GetNewEquipment() { EquipmentDataDO equipmentData = new EquipmentDataDO(); return Ok(equipmentData); }