Пример #1
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();
     }
 }
Пример #2
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");
                }
            }
        }
Пример #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");
            }
        }
Пример #4
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();
     }
 }