Пример #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            addProfile add = new addProfile();

            add.prevform = this;
            add.ShowDialog();
            show();
        }
Пример #2
0
        private void btnView_Click(object sender, EventArgs e)
        {
            int rowIndex = dtgView.CurrentCell.RowIndex;

            if (rowIndex >= 0)
            {
                int    id;
                string fn, mi, ln, gen, cn, email, add, type;
                id    = int.Parse(dtgView.Rows[rowIndex].Cells["prof_id"].Value.ToString());
                fn    = dtgView.Rows[rowIndex].Cells["fn"].Value.ToString();
                ln    = dtgView.Rows[rowIndex].Cells["ln"].Value.ToString();
                mi    = dtgView.Rows[rowIndex].Cells["mi"].Value.ToString();
                gen   = dtgView.Rows[rowIndex].Cells["sex"].Value.ToString();
                email = dtgView.Rows[rowIndex].Cells["email"].Value.ToString();
                cn    = dtgView.Rows[rowIndex].Cells["cn"].Value.ToString();
                add   = dtgView.Rows[rowIndex].Cells["address"].Value.ToString();
                type  = dtgView.Rows[rowIndex].Cells["user_type"].Value.ToString();
                addProfile view = new addProfile();
                view.edit(id, fn, mi, ln, gen, cn, email, add, type);
                view.ShowDialog();
                show();
            }
        }
Пример #3
0
        private void dtgView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int usrType = 0;

            if (e.RowIndex >= 0)
            {
                int    id;
                string fn, mi, ln, gen, cn, email, add, type;
                type  = usrType.ToString();
                id    = int.Parse(dtgView.Rows[e.RowIndex].Cells["prof_id"].Value.ToString());
                fn    = dtgView.Rows[e.RowIndex].Cells["fn"].Value.ToString();
                ln    = dtgView.Rows[e.RowIndex].Cells["ln"].Value.ToString();
                mi    = dtgView.Rows[e.RowIndex].Cells["mi"].Value.ToString();
                gen   = dtgView.Rows[e.RowIndex].Cells["sex"].Value.ToString();
                email = dtgView.Rows[e.RowIndex].Cells["email"].Value.ToString();
                cn    = dtgView.Rows[e.RowIndex].Cells["cn"].Value.ToString();
                add   = dtgView.Rows[e.RowIndex].Cells["address"].Value.ToString();
                type  = dtgView.Rows[e.RowIndex].Cells["user_type"].Value.ToString();
                addProfile view = new addProfile();
                view.edit(id, fn, mi, ln, gen, cn, email, add, type);
                view.ShowDialog();
                show();
            }
        }