Beispiel #1
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            ValidatePanel();
            if (lblContactNameWarning.Visible || lblPhoneNumberWarning.Visible ||
                lblAddressWarning.Visible)
            {
                return;
            }

            Supplier selectedSupplier = GetSelectedSupplier(RgvSuppliers.CurrentRow);

            selectedSupplier.ContactName = txtContactName.Text;
            selectedSupplier.Address     = txtAddress.Text;
            selectedSupplier.PhoneNumber = txtPhoneNumber.Text;

            SupplierViewModel.ModifyEntity(selectedSupplier);
            MessageBox.Show("تامین کننده با موفقیت تغییر کرد");
            UpdateSupplierGridView();
        }