コード例 #1
0
        public RedirectToRouteResult AddGasbillToCheckout(Checkout order, GasBill gasBill, string returnUrl)
        {
            if (gasBill != null)
            {
                if (order.chosenTariff == null)
                {
                    order.chosenTariff = tariffRepo.Tariffs
                        .FirstOrDefault(p => p.Id != null);

                }

                order.InitCalc(new ValueCalculator());
                order.SetGas(gasBill);
            }
            return RedirectToAction("Index", new { returnUrl });
        }
コード例 #2
0
 public RedirectToRouteResult AddTariffToCheckout(Checkout order, int TariffId, string returnUrl)
 {
     Tariff chosenTariff = tariffRepo.Tariffs
     .FirstOrDefault(p => p.Id == TariffId);
     if (chosenTariff != null)
     {
         order.InitCalc(new ValueCalculator());
         order.SetTariff(chosenTariff);
     }
     return RedirectToAction("Index", new { returnUrl });
 }