Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //Add Suppliers
            if (AddSuppliers)
            {
                if (IsValidData())
                {
                    Supplier newSupp = new Supplier();
                    newSupp.SupName = txtSuppName.Text;
                    saveStatus      = true;
                    try
                    {
                        SupplierDB.AddSupplier(newSupp);
                        DialogResult = DialogResult.OK;
                    }

                    catch (Exception ex)

                    {
                        MessageBox.Show(ex.Message, ex.GetType().ToString());
                    }
                }
            }
            else //Update Suppliers
            {
                if (IsValidData())
                {
                    supplier.SupName = txtSuppName.Text;
                    saveStatus       = true;
                    try
                    {
                        supplier.UpdateSupp();
                        DialogResult = DialogResult.OK;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, ex.GetType().ToString());
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void DeleteSupp()//method to delete products
 {
     SupplierDB.DeleteSupplier(this);
 }
Ejemplo n.º 3
0
 public void UpdateSupp()//method to update products
 {
     SupplierDB.UpdateSupplier(this);
 }