public ActionResult Refuel(int gasPumpIndex, int tapIndex, float liter) { // get selected gas pump GasPump gasPump = Context.GetGasStation().GetGasPumps()[gasPumpIndex]; // get tap and call 'Fuel' Tap tap = gasPump.GetTaps()[tapIndex]; gasPump.Fuel(tap, liter); return(RedirectToAction("Index", new { gasPumpIndex })); }
public ActionResult SelectTap(int gasPumpIndex, int tapIndex) { // get selected gas pump GasPump gasPump = Context.GetGasStation().GetGasPumps()[gasPumpIndex]; // get requested tap and call 'SelectTap' Tap tap = gasPump.GetTaps()[tapIndex]; gasPump.SelectTap(tap); return(RedirectToAction("Index", new { gasPumpIndex })); }