Exemplo n.º 1
0
        public static DBStudents GetInstance()
        {
            if (dBStudents == null)
            {
                dBStudents = new DBStudents();
            }

            return(dBStudents);
        }
Exemplo n.º 2
0
        private void addRecordButton_Click(object sender, EventArgs e)
        {
            string name    = textNameBox.Text;
            int    groupId = ((Group)comboGroupBox.SelectedItem).Id;

            (int, int)result          = DBStudents.GetInstance().AddNewStudent(name, groupId);
            form.addedLabel.Visible   = true;
            form.idLabel.Visible      = true;
            form.addedInputLabel.Text = result.Item1.ToString();
            form.idInputLabel.Text    = result.Item2.ToString();
            DialogResult = DialogResult.OK;
            Close();
        }
Exemplo n.º 3
0
 private void countButton_Click(object sender, EventArgs e)
 {
     countInputLabel.Text = DBStudents.GetInstance().GetCount().ToString();
     countLabel.Visible   = true;
 }
Exemplo n.º 4
0
        private void readButton_Click(object sender, EventArgs e)
        {
            IEnumerable <StudentGroupRecord> records = DBStudents.GetInstance().GetAllStudents();

            FillTable(records);
        }