Example #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            this.Enabled = false;
            this.isEdit  = false;
            RegForm reg = new RegForm();

            reg.Show(this);
        }
Example #2
0
        private void editButton_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count != 0)
            {
                this.Enabled = false;

                RegForm reg = new RegForm();
                reg.IsEditMode = true;
                reg.UserID     = (int)dataGridView1.SelectedRows[0].Cells["ID_Employee"].Value;
                reg.FillFieldsWithData(dataGridView1.SelectedRows[0]);
                reg.Show(this);
            }
        }