コード例 #1
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            _selectedClient = ClientsDataGridView.SelectedRows[0].DataBoundItem as CLIENTS;
            var form = new EditForm(this, _selectedClient);

            form.ShowDialog();
        }
コード例 #2
0
 public EditForm(IParent parent, CLIENTS clientToEdit)
 {
     _parent = parent;
     _client = clientToEdit;
     InitializeComponent();
     NameTextBox.Text    = clientToEdit.C_NAME;
     SurnameTextBox.Text = clientToEdit.SURNAME;
     PhoneNrTextBox.Text = clientToEdit.PHONE_NUMBER.ToString();
     AddressTextBox.Text = clientToEdit.ADRESS;
 }
コード例 #3
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            _selectedClient = ClientsDataGridView.SelectedRows[0].DataBoundItem as CLIENTS;
            DialogResult result = MessageBox.Show("Client will be permanently removed from the database.", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

            if (result == DialogResult.OK)
            {
                _db.RemoveClient(_selectedClient);
                LoadData();
            }
        }
コード例 #4
0
 public void NewClientCreated(CLIENTS newClient)
 {
     _db.AddClient(newClient.C_NAME, newClient.SURNAME, (int)newClient.PHONE_NUMBER, newClient.ADRESS);
     LoadData();
 }