示例#1
0
        private void dgvResults_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //Ask the user for confirmation on viewing the record
            DialogResult dialogResult = MessageBox.Show("View the record for " + dgvResults.Rows[e.RowIndex].Cells[1].Value.ToString() + " " + dgvResults.Rows[e.RowIndex].Cells[2].Value.ToString() + "?", "Confirmation", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                //Gather the information (Gathers the row clicked, then chooses the first cell's data
                string strStudent_ID = dgvResults.Rows[e.RowIndex].Cells[0].Value.ToString();


                //Convert the string over to an integer
                int intStudent_ID = Convert.ToInt32(strStudent_ID);

                //Create the editor form, passing it one EBook's ID and show it
                // NOTE THAT THE ID BEING PASSED WILL CALL THE OVERLOADED VERSION
                // OF THE CONSTRUCTOR...TELL IT, IN ESSENCE THAT WE ARE PULLING UP
                // RATHER THAN ADDING DATA
                AddRecord Editor = new AddRecord(intStudent_ID);
                Editor.ShowDialog();
            }
            else if (dialogResult == DialogResult.No)
            {
                //Do nothing since the user canceled the action
            }
        }
示例#2
0
文件: Start.cs 项目: Krypton091/SE245
        private void btnAddRecord_Click(object sender, EventArgs e)
        {
            AddRecord temp = new AddRecord();

            temp.Show();
        }