public async Task <ActionResult <Maintains> > PostMaintains(Maintains maintains) { _context.maintains.Add(maintains); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetMaintains), new { id = maintains.MaintainsID }, maintains)); }
public async Task <IActionResult> PutMaintains(int id, Maintains maintains) { if (id != maintains.MaintainsID) { return(BadRequest()); } _context.Entry(maintains).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MaintainsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
//******************************************************************************************************************// /// <summary> /// 重载物料信息 /// </summary> private void ResetMaterial() { if (WindowHelper.WorkShopType.Equals(EnumManager.WorkShopTypeEnum.BlankingShop)) { return; } ApiManager.GetMaterialInfo(); Maintains.Clear(); if (StoreInfo.MaterialOneSelf.IsCastingOrForging) { Maintains.Add(new MaterialModel() { LineNum = maintains.Count + 1, PartCode = StoreInfo.MaterialOneSelf.MaterialInfo.PartCode, PartName = StoreInfo.MaterialOneSelf.MaterialInfo.PartName, BarCode = StoreInfo.MaterialOneSelf.MaterialInfo.ExtraInfo.PartInfo.CorrespondingBarcode, PartFigureCode = StoreInfo.MaterialOneSelf.MaterialInfo.FigureNo, MaterialCode = StoreInfo.MaterialOneSelf.MaterialInfo.MaterialCode, AlreadyScanQuantity = StoreInfo.MaterialOneSelf.MaterialInfo.AlreadyScanQuantity, TotalQuantity = StoreInfo.MaterialOneSelf.MaterialInfo.TotalQuantity, Proportion = $"{StoreInfo.MaterialOneSelf.MaterialInfo.AlreadyScanQuantity}/{StoreInfo.MaterialOneSelf.MaterialInfo.TotalQuantity}" }); } foreach (var item in StoreInfo.MaterialChild.MaterialInfos) { Maintains.Add(new MaterialModel() { LineNum = maintains.Count + 1, PartCode = item.PartCode, PartName = item.PartName, BarCode = item.ExtraInfo.PartInfo.CorrespondingBarcode, PartFigureCode = item.FigureNo, MaterialCode = item.MaterialCode, AlreadyScanQuantity = item.AlreadyScanQuantity, TotalQuantity = item.TotalQuantity, Proportion = $"{item.AlreadyScanQuantity}/{item.TotalQuantity}" }); } MaintainSelectIndex = Maintains.Count > 0 ? 0 : -1; }