Esempio n. 1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            var a = dtgProviders.SelectedRows[0].Cells[4].Value;
            ProviderAddForm providerForm = new ProviderAddForm(_providerService.GetById((long)a));
            providerForm.Text = "Atualizar";
            providerForm.btnAddProvider.Text = "Atualizar";
            providerForm.ShowDialog();

            _providerService.Update(providerForm.Provider);
            UpdateList();
        }
Esempio n. 2
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            ProviderAddForm providerAddForm = new ProviderAddForm();
            var result = providerAddForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                _providerService.Add(providerAddForm.Provider);
                UpdateList();
            }
        }