Пример #1
0
        private void select_grptype(object sender, DataGridViewCellMouseEventArgs e)
        {
            int id = Convert.ToInt32(dataGridGrpType.Rows[e.RowIndex].Cells[0].Value);

            selectedGrpType = db.Group_types.Find(id);
            g_type.Text     = selectedGrpType.group_type_name;
            g_schedule.Text = selectedGrpType.Group_schedule.group_schedule_name;
        }
Пример #2
0
        private void add_gtype_btn_Click(object sender, EventArgs e)
        {
            int         grp_id   = db.Group_schedule.Where(g => g.group_schedule_name == g_schedule.Text).First().id;
            Group_types grp_type = new Group_types();

            grp_type.group_type_name   = g_type.Text;
            grp_type.group_schedule_id = grp_id;
            db.Group_types.Add(grp_type);
            db.SaveChanges();
            fillDataGrpType();
        }