Beispiel #1
0
        private void btnAddNew_Click(object sender, EventArgs e)
        {
            frmUserManagerEdit f = new frmUserManagerEdit();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                SetBtnEnabled("");
        }
Beispiel #2
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string KeyValue = this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString();
            if (KeyValue == "")
                return;
            if (e.ColumnIndex == 0)
            {
                frmUserManagerView f = new frmUserManagerView(KeyValue);

                f.ShowDialog();
                SetBtnEnabled("");
            }
            else if (e.ColumnIndex == 1)
            {
                if (this.dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Cells["Column13"].Value.ToString().Trim().Length > 0)
                {
                    MessageBox.Show("已被覆核,不可編輯!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                frmUserManagerEdit f = new frmUserManagerEdit(KeyValue);

                if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    SetBtnEnabled("");
            }
        }