Пример #1
0
        private void supplierToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmSupplier supplier = new FrmSupplier();

            supplier.GetUserID(TxtUserID.Text);
            supplier.ShowDialog();
        }
Пример #2
0
        private void SupplierManagement(IEquatable <string> operationRequest)
        {
            using (var frmSupplier = new FrmSupplier())
            {
                frmSupplier.CommonService   = _CommonService;
                frmSupplier.SupplierService = _SupplierService;

                if (operationRequest.Equals(Resources.OperationRequestUpdate))
                {
                    if (dgvSupplier.CurrentRow != null)
                    {
                        frmSupplier.Supplier = _SupplierList[dgvSupplier.CurrentRow.Index];
                    }
                }

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

                        if (operationRequest.Equals(Resources.OperationRequestInsert))
                        {
                            _SupplierList.Add(frmSupplier.Supplier);
                        }

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

            SetFocusToSupplierList();
        }