예제 #1
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            if (_mode == Operation.Search)
            {
                if (listView1.SelectedItems.Count == 0)
                {
                    MessageBox.Show("Please select " + _entityText + " from the list",
                                    "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    _isClosed = false;
                    this.Close();
                }
            }
            else
            {
                DialogParam param = MakeParameter(Operation.Add);
                SupplierOrCustomerDialog sDialog = new SupplierOrCustomerDialog(param);
                sDialog.ShowDialog();

                LoadSupplierOrCustomer();
                Search();
            }
        }
예제 #2
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select " + _entityText + " from the list",
                                "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            DialogParam param = MakeParameter(Operation.Edit);
            SupplierOrCustomerDialog sDialog = new SupplierOrCustomerDialog(param);

            sDialog.ShowDialog();
            Search();
        }