Beispiel #1
0
        private void btnSupplier_Click(object sender, EventArgs e)
        {
            MaintainClientController c             = new MaintainClientController();
            SupplierForm             supplier_form = new SupplierForm(c);

            supplier_form.TopLevel = false;
            pnlPage.Controls.Add(supplier_form);
            supplier_form.Show();
        }
Beispiel #2
0
 public void delete_supplier_btn_click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want Delete this Supplier", "Confirm Deletion", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         _supForm = (SupplierForm)((Button)(sender)).GetContainerControl();
         String   supID     = _supForm.GetSupplierBox();
         Supplier _supplier = new Supplier();
         _supplier.Delete(supID);
         _supForm.Close();
     }
 }
Beispiel #3
0
        public void add_supplier_btn_click(object sender, EventArgs e)
        {
            if (false)
            {
                _supForm.Close();
            }
            else
            {
                // SupplierForm _supForm = new SupplierForm(this);
                _supForm = (SupplierForm)((Button)(sender)).GetContainerControl();
                String value = _supForm.GetInput1();


                bool okToSubmit = true;

                if (value == null)
                {
                    okToSubmit = false;
                }

                if (okToSubmit)
                {
                    if (MessageBox.Show("Are you sure you want to submit these changes?", "Confirm Submission", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {// if we are good, submit changes to dataBase
                        Supplier _supplier = new Supplier();
                        bool     check     = _supplier.Set1(value);
                        // _mainForm.SetClientBox(MClient.GetList());
                        if (check)
                        {
                            _supForm.Close();
                        }
                    }
                }

                else
                {
                    MessageBox.Show("Some Fields Have Errors", "Errors");
                }
            }
        }
        public void add_supplier_btn_click(object sender, EventArgs e)
        {
            if (false)
            {

                _supForm.Close();
            }
            else
            {

               // SupplierForm _supForm = new SupplierForm(this);
                _supForm = (SupplierForm)((Button)(sender)).GetContainerControl();
                String value = _supForm.GetInput1();

                bool okToSubmit = true;

                    if (value == null)
                        okToSubmit = false;

                if (okToSubmit)
                {
                    if (MessageBox.Show("Are you sure you want to submit these changes?", "Confirm Submission", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {// if we are good, submit changes to dataBase

                        Supplier _supplier = new Supplier();
                        bool check = _supplier.Set1(value);
                        // _mainForm.SetClientBox(MClient.GetList());
                        if(check)
                            _supForm.Close();
                    }
                }

                else
                    MessageBox.Show("Some Fields Have Errors", "Errors");
            }
        }
Beispiel #5
0
 private void btnSupplier_Click(object sender, EventArgs e)
 {
     MaintainClientController c = new MaintainClientController();
     SupplierForm supplier_form = new SupplierForm(c);
     supplier_form.TopLevel = false;
     pnlPage.Controls.Add(supplier_form);
     supplier_form.Show();
 }
 public void delete_supplier_btn_click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want Delete this Supplier", "Confirm Deletion", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         _supForm = (SupplierForm)((Button)(sender)).GetContainerControl();
         String supID = _supForm.GetSupplierBox();
         Supplier _supplier = new Supplier();
         _supplier.Delete(supID);
         _supForm.Close();
     }
 }