Пример #1
0
        private void button_CusMore_Click(object sender, EventArgs e)
        {
            FrmCustomer cus = new FrmCustomer();

            if (cus.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                textBox_CusName.Tag   = cus.SelectedCus.CustomerID;
                textBox_CusName.Text  = cus.SelectedCus.CustomerName;
                textBox_CusPhone.Text = cus.SelectedCus.Phone;
                textBox_CusPID.Text   = cus.SelectedCus.PID;
                textBox_CusAddr.Text  = cus.SelectedCus.Addr;
            }
        }
Пример #2
0
        private void CustomerManagement(IEquatable <string> operationRequest)
        {
            using (var frmCustomer = new FrmCustomer())
            {
                frmCustomer.CommonService   = _commonService;
                frmCustomer.CustomerService = _customerService;

                if (operationRequest.Equals(Resources.OperationRequestUpdate))
                {
                    if (dgvCustomer.CurrentRow != null)
                    {
                        frmCustomer.Customer = _customerList[dgvCustomer.CurrentRow.Index];
                    }
                }

                if (frmCustomer.ShowDialog(this) == DialogResult.OK)
                {
                    try
                    {
                        ThreadStart threadStart = UpdateControlContent;
                        var         thread      = new Thread(threadStart);
                        thread.Start();

                        if (operationRequest.Equals(Resources.OperationRequestInsert))
                        {
                            _customerList.Add(frmCustomer.Customer);
                        }

                        dgvCustomer.Refresh();
                        SetCustomerInfo();
                        UpdateResultInfo();
                        EnableActionButton();
                    }
                    catch (Exception exception)
                    {
                        FrmExtendedMessageBox.UnknownErrorMessage(
                            Resources.MsgCaptionUnknownError,
                            exception.Message);
                    }
                }
            }

            SetFocusToCustomerList();
        }
Пример #3
0
        private void Customer_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmCustomer customer = new FrmCustomer();

            customer.ShowDialog();
        }