示例#1
0
 private void AddRecipients()
 {
     AddRecipients newRecipient = new AddRecipients();
     newRecipient.Text = "Добавить";
     newRecipient.ShowDialog();
     LoadRecipients();
 }
示例#2
0
 private void EditRecipients()
 {
     if (recipientsInfoDataGridView.SelectedRows.Count>0)
     {
         int recipID = (int)recipientsInfoDataGridView.SelectedRows[0].Cells[0].Value;
         foreach (RecipientsInfo recipient in _recipientsList)
         {
             if (recipient.RecipientID == recipID)
             {
                 AddRecipients newRecip = new AddRecipients();
                 newRecip.Text = "Изменить";
                 newRecip.recInfo = recipient;
                 newRecip.ShowDialog();
                 break;
             }
         }
         LoadRecipients();
     }
     else
     {
         if (MessageBox.Show(this, "Ничего не выбрано!", "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error) == System.Windows.Forms.DialogResult.OK) return;
     }
 }