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

            selectedGrpSch    = db.Group_schedule.Find(id);
            grp_sch_name.Text = selectedGrpSch.group_schedule_name;
            sch_start.Value   = selectedGrpSch.group_begin_time;
            sch_end.Value     = selectedGrpSch.group_end_time;
        }
Пример #2
0
        private void sch_add_Click(object sender, EventArgs e)
        {
            Group_schedule grp_sch = new Group_schedule();

            grp_sch.group_schedule_name = grp_sch_name.Text;
            grp_sch.group_begin_time    = sch_start.Value;
            grp_sch.group_end_time      = sch_end.Value;
            db.Group_schedule.Add(grp_sch);
            db.SaveChanges();
            fillDataGrpSch();
        }