コード例 #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            int searchID = int.Parse(txtSearchContract.Text);

            Bussiness_Logic.Contract contract = new Bussiness_Logic.Contract();
            bsContracts.DataSource       = contract.SearchContract(searchID);
            dgvClientContract.DataSource = bsContracts;
        }
コード例 #2
0
        private void btnUpdateContract_Click(object sender, EventArgs e)
        {
            int contractID = int.Parse(txtContractID.Text);
            int state      = cmbUpdate.Text == "Active" ? 1 : 0;

            Bussiness_Logic.Contract contract = new Bussiness_Logic.Contract();
            contract.UpdateContract(contractID, state);
            int searchID = int.Parse(txtSearchContract.Text);

            bsContracts.DataSource = contract.SearchContract(searchID);
            bsContracts.ResetBindings(true);
        }