Ejemplo n.º 1
0
        private void RedactUser(int numberOfUsers)
        {
            AddEditUsers form = new AddEditUsers(GetObject().student[numberOfUsers]);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                var newStudent = form.GetObject();
                dataGridViewUsers.Rows[numberOfUsers].Cells[0].Value = newStudent.Name + " " + newStudent.Surname;
                dataGridViewUsers.Rows[numberOfUsers].Cells[1].Value = newStudent.NumberOfTicket;
                dataGridViewUsers.Rows[numberOfUsers].Cells[2].Value = newStudent.Vidacha.ToString("d");
                dataGridViewUsers.Rows[numberOfUsers].Cells[3].Value = newStudent.Sdacha.ToString("d");
                students[numberOfUsers] = newStudent;
            }
        }
Ejemplo n.º 2
0
        private void AddUser()
        {
            var form = new AddEditUsers();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                dataGridViewUsers.Rows.Add();
                int numberOfUsers = Convert.ToInt32(dataGridViewUsers.Rows.Count.ToString()) - 1;
                var newStudent    = form.GetObject();
                students.Add(newStudent);
                dataGridViewUsers.Rows[numberOfUsers].Cells[0].Value = newStudent.Name + " " + newStudent.Surname;
                dataGridViewUsers.Rows[numberOfUsers].Cells[1].Value = newStudent.NumberOfTicket;
                dataGridViewUsers.Rows[numberOfUsers].Cells[2].Value = newStudent.Vidacha.ToString("d");
                dataGridViewUsers.Rows[numberOfUsers].Cells[3].Value = newStudent.Sdacha.ToString("d");
            }
            ProverkaNalichia();
        }