Пример #1
0
        private void toolStripButton_Edit_Click(object sender, EventArgs e)
        {
            if (dataGridView_Contract.CurrentRow == null)
            {
                Prompt.Warning("未选择相应的记录!");
                return;
            }

            string contractId = dataGridView_Contract.CurrentRow.Cells["ColContractID"].Value.ToString();

            int iResult = int.Parse(SqlHelper.ExecuteScalar(string.Format("select count(ContractID) from ContractMain where ConfirmDate is not null and ContractID = {0}", contractId)).ToString());

            if (iResult > 0)
            {
                Prompt.Warning("签约已确权,不允许变更!");
                return;
            }

            FrmContractAdd contractAdd = new FrmContractAdd();

            contractAdd.Owner   = this;
            contractAdd.FrmMode = FormMode.modify;

            contractAdd.ContractID = contractId;
            if (contractAdd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Search(" and  ContractMain.ContractID = " + dataGridView_Contract.CurrentRow.Cells["ColContractID"].Value.ToString());
                Prompt.Information("操作成功!数据已更新。");
            }
        }
Пример #2
0
        private void toolStripButton_Add_Click(object sender, EventArgs e)
        {
            FrmContractAdd contractAdd = new FrmContractAdd();

            contractAdd.Owner = this;
            contractAdd.ShowDialog();
        }
Пример #3
0
        private void ViewContract()
        {
            if (dataGridView_Contract.CurrentRow == null)
            {
                Prompt.Warning("未选择相应的记录!");
                return;
            }

            FrmContractAdd contractAdd = new FrmContractAdd();

            contractAdd.FrmMode    = FormMode.view;
            contractAdd.ContractID = dataGridView_Contract.CurrentRow.Cells["ColContractID"].Value.ToString();
            contractAdd.ShowDialog();
        }
Пример #4
0
        private void toolStripButton_Exchange_Click(object sender, EventArgs e)
        {
            if (dataGridView_Contract.CurrentRow == null)
            {
                Prompt.Warning("未选择相应的记录!");
                return;
            }

            FrmContractAdd contractAdd = new FrmContractAdd();

            contractAdd.FrmMode    = FormMode.exchange;
            contractAdd.ContractID = dataGridView_Contract.CurrentRow.Cells["ColContractID"].Value.ToString();
            if (contractAdd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Search("and ContractMain.ContractID = " + contractAdd.ContractID);
                Prompt.Information("操作成功!数据已更新");
            }
        }