private void listViewProducts_SelectedIndexChanged(object sender, EventArgs e)
        {
            SupplierForm refreshFrom = new SupplierForm();

            refreshFrom.Refresh();
            //refreshFrom.Show();
        }
Example #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (Validator.IsNotEmpty(txtSupplierName, "Supplier Name"))
            {
                int    supId   = Convert.ToInt32(txtSupplierID.Text);
                string supName = txtSupplierName.Text;

                try
                {
                    TravelSupplierDB updateSuppliers = new TravelSupplierDB();
                    //updateSuppliers.EditSupplier(supId, supName, prodId, prodName);
                    updateSuppliers.EditSupplier(supId, supName);

                    this.Close();
                    SupplierForm refreshSupplier = new SupplierForm();
                    refreshSupplier.Show();
                    refreshSupplier.Refresh();
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, ex.GetType().ToString());
                }
            }
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int supplierID = Convert.ToInt32(lblSupID.Text);
            TravelSupplierDB deleteSupplier = new TravelSupplierDB();

            deleteSupplier.DeleteSupplier(lstViewSupplier, supplierID);

            this.Close();
            SupplierForm refreshFrom = new SupplierForm();

            refreshFrom.Refresh();
            refreshFrom.Show();
        }