コード例 #1
0
        public void EditSetting(EditDeliverySettingViewModel viewModel)
        {
            var record = _deliverySettingsRepository.Get(f => f.Id == viewModel.Id);
            record.State = viewModel.State;
            // todo: (auth:juiceek) drop this 
            //setting.DeliveryCost = newSetting.DeliveryCost;
            record.Country = _countryRepository.Get(viewModel.CountryId);
            record.PostageCost = viewModel.PostageCost;
            record.CodCost = viewModel.CodCost;

            _deliverySettingsRepository.Update(record);
        }
コード例 #2
0
 public ActionResult AddSetting(int countryId)
 {
     var viewModel = new EditDeliverySettingViewModel() { CountryId = countryId };
     return View(viewModel);
 }
コード例 #3
0
        public ActionResult EditSetting(EditDeliverySettingViewModel viewModel)
        {
            _deliverySettingService.EditSetting(viewModel);

            _orchardServices.Notifier.Information(T("Record has been changed!"));
            return RedirectToAction("Index", new { countryId = viewModel.CountryId });
        }
コード例 #4
0
 public ActionResult EditSetting(int id, int countryId)
 {
     var setting = _deliverySettingService.GetSettingById(id);
     var model = new EditDeliverySettingViewModel()
     {
         Id = setting.Id,
         State = setting.State,
         //DeliveryCost = setting.DeliveryCost,
         CountryId = countryId,
         PostageCost = setting.PostageCost,
         CodCost = setting.CodCost
     };
     return View(model);
 }
コード例 #5
0
 public ActionResult AddSetting(EditDeliverySettingViewModel viewModel)
 {
     _deliverySettingService.
         AddSetting(viewModel.State, viewModel.PostageCost, viewModel.CodCost, viewModel.CountryId,
             //todo : (auth:juiceek) drop this param
             cultureUsed);
     return RedirectToAction("Index", new { countryId = viewModel.CountryId});
 }