Example #1
0
        private void btnAddContract_Click(object sender, EventArgs e)
        {
            AddEditContractForm editForm = new AddEditContractForm(new CommonContract(), new CommonMol());

            if (editForm.ShowDialog() == DialogResult.OK)
            {
                LoadDataContracts();
            }
        }
        private async void btnAddContractS_Click(object sender, EventArgs e)
        {
            AddEditContractForm editForm = new AddEditContractForm(new CommonContract(), new CommonMol());

            if (editForm.ShowDialog() == DialogResult.OK)
            {
                AllContacts = await SAContract.GetAllContracts(cbSearchContract.Text);

                cbSearchContract.DataSource    = AllContacts;
                cbSearchContract.SelectedIndex = -1;
            }
        }
Example #3
0
//        private void tbSearchContracts_KeyDown(object sender, KeyEventArgs e)
//        {
//            if (e.KeyCode != Keys.Enter)
//            {
//                return;
//            }
//
//            LoadDataContracts();
//        }

        private async void btnEditContract_Click(object sender, EventArgs e)
        {
            if (dgvContracts.SelectedRows.Count == 1 && dgvContracts.SelectedRows[0] != null)
            {
                CommonContract   selectedItem = (CommonContract)dgvContracts.SelectedRows[0].DataBoundItem;
                List <CommonMol> mols         = await SAOwner.getAllMols(selectedItem.PartnerId);

                CommonMol           mol  = mols.Count == 0 ? new CommonMol() : mols.First();
                AddEditContractForm form = new AddEditContractForm(selectedItem, mol);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    LoadDataContracts();
                }
            }
        }