private void RateEdit()
 {
     if (dgRates.SelectedItem != null)
     {
         int RateID = (dgRates.SelectedItem as currency_rate).id;
         CurrencyRateEditView v = new CurrencyRateEditView();
         v.RateID = RateID;
         v.CurrencyID = SelectedCurrencyID;
         v.CurrencyName = SelectedCurrencyCode;
         v.BasicCurrencyName = BasicCurencyCode();
         v.Rate = (float)(dgRates.SelectedItem as currency_rate).rate;
         v.CurrencyID = SelectedCurrencyID;
         v.ShowDialog();
         LoadRates();
     }
     else
     {
         MessageBox.Show("Выберите запись для редактирования!");
     }
 }
 private void RateAdd()
 {
     if (dgList.SelectedItem != null)
     {
         CurrencyRateEditView v = new CurrencyRateEditView();
         v.CurrencyID = SelectedCurrencyID;
         v.CurrencyName = SelectedCurrencyCode;
         v.BasicCurrencyName = BasicCurencyCode();
         v.ShowDialog();
         LoadRates();
     }
     else
     {
         MessageBox.Show("Выберите валютиу из списка!");
     }
 }