public ActionResult EditSetting(EditDeliverySettingViewModel viewModel) { _deliverySettingService.EditSetting(viewModel); _orchardServices.Notifier.Information(T("Record has been changed!")); return(RedirectToAction("Index", new { countryId = viewModel.CountryId })); }
public ActionResult AddSetting(int countryId) { var viewModel = new EditDeliverySettingViewModel() { CountryId = countryId }; return(View(viewModel)); }
public void EditSetting(EditDeliverySettingViewModel viewModel) { var record = _deliverySettingsRepository.Get(f => f.Id == viewModel.Id); record.State = viewModel.State; record.Country = _countryRepository.Get(viewModel.CountryId); record.PostageCost = viewModel.PostageCost; record.CodCost = viewModel.CodCost; record.DeliveryTime = viewModel.DeliveryTime; _deliverySettingsRepository.Update(record); }
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, DeliveryTime = setting.DeliveryTime }; return(View(model)); }
public ActionResult AddSetting(EditDeliverySettingViewModel viewModel) { _deliverySettingService. AddSetting(viewModel.State, viewModel.PostageCost, viewModel.CodCost, viewModel.CountryId, viewModel.DeliveryTime); return(RedirectToAction("Index", new { countryId = viewModel.CountryId })); }