Exemple #1
0
        private void Add_Employee_Click(object sender, EventArgs e)
        {
            Add_Employee add = new Add_Employee();

            add.Text = "Добавить сотрудника";
            add.pictureBox1.Image = Properties.Resources.add_user;
            add.Form = 0;

            if (add.ShowDialog() == DialogResult.OK)
            {
                Refresh_Employee();
                MessageBox.Show("Данные успешно добавлены", "Уведомление", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
0
        private void Edit_Employee_Click(object sender, EventArgs e)
        {
            Add_Employee edit = new Add_Employee();

            edit.Text = "Редактировать сотрудника";
            edit.pictureBox1.Image = Properties.Resources.edit;
            edit.Form = 1;

            edit.ID = EmployeeGridView.CurrentRow.Cells[0].Value.ToString();
            string[] FIO = EmployeeGridView.CurrentRow.Cells[1].Value.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            edit.FullEmployeeName.Text = FIO[0];
            edit.textBox1.Text         = FIO[1];
            edit.textBox2.Text         = FIO[2];
            edit.EmployeePost.Text     = EmployeeGridView.CurrentRow.Cells[2].Value.ToString();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                Refresh_Employee();
                MessageBox.Show("Данные успешно изменены", "Уведомление", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }