Пример #1
0
        private void createUserToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            addemployee frm = new addemployee();

            frm.MdiParent = this;
            frm.Show();
        }
Пример #2
0
        private void DataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (p1 == 0)
            {
                addemployee r = null;

                foreach (Form f in Application.OpenForms)
                {
                    if (f is addemployee)
                    {
                        r = (addemployee)f;
                        break;
                    }
                }

                if (r == null)
                {
                    return;
                }

                DataGridViewRow row = DataGridView3.Rows[e.RowIndex];
                r.label7.Text   = row.Cells[0].Value.ToString();
                r.textBox1.Text = row.Cells[1].Value.ToString();
                if (row.Cells[2].Value.ToString() == "Male")
                {
                    r.radioButton1.Checked = true;
                }
                else
                {
                    r.radioButton2.Checked = true;
                }

                r.textBox2.Text = row.Cells[3].Value.ToString();
                r.dpdob.Text    = row.Cells[4].Value.ToString();
                r.dpdoj.Text    = row.Cells[5].Value.ToString();
                r.textBox3.Text = row.Cells[6].Value.ToString();
                r.textBox4.Text = row.Cells[7].Value.ToString();
                r.textBox5.Text = row.Cells[8].Value.ToString();

                r.groupBox1.Enabled = true;
                r.Button5.Enabled   = true;
                r.Button6.Enabled   = true;
                r.Button2.Enabled   = false;

                this.Dispose();
            }
        }