//Method to add supplier
 private void btnAdd_Click(object sender, EventArgs e)
 {
     frmAddModifySupplier addSupplierForm = new frmAddModifySupplier();
     addSupplierForm.addSupplier = true;
     DialogResult result = addSupplierForm.ShowDialog();
     if (result == DialogResult.OK)
     {
         supplier = addSupplierForm.supplier;
         txtSupplierId.Text = supplier.SupplierId.ToString();
         this.DisplaySupplier();
     }
 }
 //Method to modify the existing supplier details
 private void btnModify_Click(object sender, EventArgs e)
 {
     frmAddModifySupplier modifySupplierForm = new frmAddModifySupplier();
     modifySupplierForm.addSupplier = false;
     modifySupplierForm.supplier = supplier;
     DialogResult result = modifySupplierForm.ShowDialog();
     if (result == DialogResult.OK)
     {
         supplier = modifySupplierForm.supplier;
         if (supplier != null)
         {
             this.DisplaySupplier();
         }
     }
     else if (result == DialogResult.Retry)
     {
         this.GetSupplier(supplier.SupplierId);
         if (supplier != null)
             this.DisplaySupplier();
         else
             this.ClearControls();
     }
 }