示例#1
0
        public async Task <IActionResult> EditTolerances(int id, [Bind("PcsToleranceParametersId,TolerancePercent,OutOfRangePercent")] PcsToleranceParameters pcsTolerance)
        {
            if (id != pcsTolerance.PcsToleranceParametersId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pcsTolerance);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PcsToleranceExists(pcsTolerance.PcsToleranceParametersId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pcsTolerance));
        }
        protected virtual void SetTolerances()
        {
            PcsToleranceParameters pcsToleranceParameters = _pcsToleranceRepository.GetTolerances();

            Tolerance           = pcsToleranceParameters.TolerancePercent;
            ToleranceOutOfRange = pcsToleranceParameters.OutOfRangePercent;
        }