public ActionResult EditScoreForIndicator1(string id, string name, string minValue, string maxValue, string point) { var num = Convert.ToInt32(id); var score = _scoreService.Get(x => x.Id == num); if (!string.IsNullOrEmpty(name) || !string.IsNullOrWhiteSpace(name)) { score.Name = name; } if (!string.IsNullOrEmpty(minValue) || !string.IsNullOrWhiteSpace(minValue)) { score.MinValue = Convert.ToDecimal(minValue); } else { score.MinValue = null; } if (!string.IsNullOrEmpty(maxValue) || !string.IsNullOrWhiteSpace(maxValue)) { score.MaxValue = Convert.ToDecimal(maxValue); } else { score.MaxValue = null; } //if (!string.IsNullOrEmpty(upperBound) || !string.IsNullOrWhiteSpace(upperBound)) // score.UpperBound = Convert.ToInt32(upperBound); //else // score.UpperBound = null; //if (!string.IsNullOrEmpty(lowerBound) || !string.IsNullOrWhiteSpace(lowerBound)) // score.LowerBound = Convert.ToInt32(lowerBound); if (!string.IsNullOrEmpty(point) || !string.IsNullOrWhiteSpace(point)) { score.Point = Convert.ToInt32(point); } else { score.Point = 0; } score.LastModifiedDate = DateTime.Now; var indicator = _indicatorService.Get(x => x.Id == score.Indicator.Id); foreach (var s in indicator.Scores) { if (s.Id == score.Id) { //s.LowerBound = score.LowerBound; //s.UpperBound = score.UpperBound; s.MaxValue = score.MaxValue; s.MinValue = score.MinValue; s.Point = score.Point; s.Name = score.Name; } } ; _indicatorService.Update(indicator); return(RedirectToAction("AddOrUpdateProfessorIndicator", new { id = score.Indicator.Id })); //return Json(new { }); }