Exemple #1
0
        private void GridViewWorker_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (GridViewWorker.CurrentRow == null)
            {
                MessageBox.Show("Ничего не выбрано",
                                "Внимание",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }

            WorkerInformation information = new WorkerInformation();

            information.tbName.Text        = GridViewWorker.CurrentRow.Cells[0].Value.ToString().Split(' ')[0] + " " + GridViewWorker.CurrentRow.Cells[0].Value.ToString().Split(' ')[2];
            information.tbSurname.Text     = GridViewWorker.CurrentRow.Cells[0].Value.ToString().Split(' ')[1];
            information.tbPhone.Text       = GridViewWorker.CurrentRow.Cells[1].Value.ToString();
            information.tbExperience.Text  = GridViewWorker.CurrentRow.Cells[2].Value.ToString();
            information.DateBirthday.Value = DateTime.Parse(GridViewWorker.CurrentRow.Cells[3].Value.ToString());
            information.labelSex.Text      = $" ({GridViewWorker.CurrentRow.Cells[4].Value.ToString()})";
            information.tbStreet.Text      = GridViewWorker.CurrentRow.Cells[5].Value.ToString().Split(',')[0];
            information.tbHome.Text        = GridViewWorker.CurrentRow.Cells[5].Value.ToString().Split(',')[1];
            information.tbFlat.Text        = GridViewWorker.CurrentRow.Cells[5].Value.ToString().Split(',')[2];
            information.lastDate           = DateTime.Parse(GridViewWorker.CurrentRow.Cells[3].Value.ToString());
            information.oldWorker          = GridViewWorker.CurrentRow.Cells[0].Value.ToString();
            information.ShowDialog();
        }