private void btnTariffShow_Click(object sender, EventArgs e) { var tariff = (sender == btnTariffPenaltyShow) ? Settings.Default.PenaltyTarif : String.Empty; if (String.IsNullOrEmpty(tariff)) { MessageBox.Show(this, "Необходимо задать тариф с мастер-карты!", ApplicationServices.GetApplicationName(), MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (tariffForm == null) { tariffForm = new TariffViewForm(); } try { tariffForm.Setup(CashDeskHelper.DeserializeTariff(tariff)); tariffForm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(this, "Ошибка чтения тарифа из файла конфигурации: \r\n" + ex.Message, ApplicationServices.GetApplicationName(), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public SettingsForm(ILogger logger, SmartCardManager smartCardManager) { InitializeComponent(); this.SetLogoIcon(); imgShow.Images.Add(Images.View); btnTariffPenaltyShow.ImageIndex = 0; btnTariffMetroShow.ImageIndex = 0; this.logger = logger; this.smartCardManager = smartCardManager; tariffForm = null; cboLanguage.SetEnum <CashDeskLanguage>(CashDeskHelper.GetString); cashDeskLanguage = Settings.Default.CashDeskLanguage; ApplyLanguage(); }