/// <summary>
        /// Edit current customer in dialog window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridView_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                e.Handled = true;

                var countries = _operations.GetCountries();
                countries.Insert(0, new CountryItem()
                {
                    CountryIdentifier = 0, CountyName = "Select"
                });

                var contactTitles = _operations.GetContactTypes();
                contactTitles.Insert(0, new ContactType()
                {
                    ContactTypeIdentifier = 0, ContactTitle = "Select"
                });

                var f = new CustomerEditorForm(countries, contactTitles);
                try
                {
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                    }
                }
                finally
                {
                    f.Dispose();
                }
            }
        }
コード例 #2
0
        protected void EditBy(Customer customer)
        {
            EditorFormTitle = "EDIT";
            Customer        = customer;

            CustomerEditorForm.Show();
        }
コード例 #3
0
        protected void btnCreate_Click()
        {
            EditorFormTitle = "ADD";
            Customer        = new Customer();

            CustomerEditorForm.Show();
        }
コード例 #4
0
        void CustomerViewer_Open(object sender, EventArgs e)
        {
            Customer           customer = customerList[listView.SelectedIndices[0]];
            CustomerEditorForm editor   = GetEditor <CustomerEditorForm>(customer);

            editor.SetUpdateMode(customer);
            ShowEditorAsync(editor);
        }
コード例 #5
0
        void CustomerViewer_New(object sender, EventArgs e)
        {
            Customer           customer = new Customer(RhspDataID.Generate());
            CustomerEditorForm editor   = new CustomerEditorForm();

            editor.SetCreateMode(customer);
            ShowEditorAsync(editor);
        }
コード例 #6
0
        protected async void SaveOrUpdated()
        {
            CustomerEditorForm.Close();

            await DisplayData();

            StateHasChanged();
        }
コード例 #7
0
        private void btnNewCustomer_Click(object sender, EventArgs e)
        {
            CustomerEditorForm editor = Bootstrapper.Resolve <CustomerEditorForm>();

            editor.ShowDialog(this);

            btnSearch.PerformClick();
        }
コード例 #8
0
        private void cmsEditData_Click(object sender, EventArgs e)
        {
            if (_selectedCustomer != null)
            {
                CustomerEditorForm editor = Bootstrapper.Resolve <CustomerEditorForm>();
                editor.SelectedCustomer = _selectedCustomer;
                editor.ShowDialog(this);

                btnSearch.PerformClick();
            }
        }