public void ApdateDish(Dish d) { if (d.stars < 1 || d.stars > 5) { throw new Exception("the stars number is wrong"); } if (d.DishPrice < d.stars * 5) { throw new Exception("the price is too cheap compare to the stars"); } dal.ApdateDish(d); }