コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            int index = Convert.ToInt32(txtName.Text);

            RandomAccess.FindFromFile("Student.txt", index);
            this.Close();
        }
コード例 #2
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary>   Event handler. Called by btnRAF for click events. </summary>
        ///
        /// <remarks>   Jaege, 6/09/2018. </remarks>
        ///
        /// <param name="sender">   Source of the event. </param>
        /// <param name="e">        Event information. </param>
        ///-------------------------------------------------------------------------------------------------

        private void btnRAF_Click(object sender, EventArgs e)
        {
            int    columnHeader = Convert.ToInt32(dataGridClass.SelectedCells[0].OwningColumn.HeaderCell.ColumnIndex);
            int    rowHeader    = Convert.ToInt32(dataGridClass.SelectedCells[0].OwningRow.HeaderCell.RowIndex);
            int    studentIndex = 0;
            string name         = "";

            foreach (Students student in GridPosition.StudentList)
            {
                if (student.Column == columnHeader && student.Row == rowHeader)
                {
                    studentIndex = GridPosition.StudentList.IndexOf(student);
                    name         = student.Names;
                }
            }
            RandomAccess.MainMethod(name, rowHeader, columnHeader, studentIndex);
            GridPosition.DisplayGrid(dataGridClass);
        }