예제 #1
0
        /// <summary>
        /// Angelito: Edit Supplier data
        /// </summary>
        private void btnEditSupplier_Click(object sender, EventArgs e)
        {
            frmAddModifySupplier addForm = new frmAddModifySupplier();

            addForm.addSupplier = false;
            addForm.currentSup  = currentSup;
            DialogResult result = addForm.ShowDialog(); //display frmAddModifySupplier

            if (result == DialogResult.OK)
            {
                currentSup = addForm.currentSup;
                MessageBox.Show("Successfully modified supplier: " + currentSup.SupplierId.ToString());
            }
            this.DisplayCurrentSupData();
        }
예제 #2
0
        /// <summary>
        /// Angelito: ADD Supplier
        /// </summary>
        private void btnAddSupplier_Click(object sender, EventArgs e)
        {
            frmAddModifySupplier addForm = new frmAddModifySupplier();

            addForm.addSupplier = true;
            addForm.supIDs      = supplierIds;
            DialogResult result = addForm.ShowDialog(); // displays new modal form

            if (result == DialogResult.OK)
            {
                currentSup = addForm.supplier;
                supplierIdComboBox.Text = currentSup.SupplierId.ToString();
                this.DisplayCurrentSupData();
                RefreshSupComboBox(true);
                MessageBox.Show("New supplier has been added.");
            }
        }