Exemple #1
0
        private void T03addButton_Click(object sender, EventArgs e)
        {
            if (T03_id_task_name.Text == "" || T03_comment_view_duration_sec.Text == "" || T03_max_passing_duration_sec.Text == "" || T03_additional_teaching_material.Text == "")
            {
                MessageBox.Show("Заполните поля!");
            }
            else
            {
                var person = new T03_testing_task_modules()
                {
                    id_track                  = int.Parse(T03_id_track.SelectedValue.ToString()),
                    id_av_track               = int.Parse(T03_id_av_track.SelectedValue.ToString()),
                    code_instruction          = int.Parse(T03_code_instruction.SelectedValue.ToString()),
                    id_task                   = IDTZ,
                    code_variant              = int.Parse(T03_code_variant.SelectedValue.ToString()),
                    id_comment                = IDCV, // ???
                    comment_view_duration_sec = int.Parse(T03_comment_view_duration_sec.Text),
                    max_passing_duration_sec  = int.Parse(T03_max_passing_duration_sec.Text),
                    code_action               = int.Parse(T03_code_action.SelectedValue.ToString()),
                    note = T03_note.Text == "" ? " " : T03_note.Text,
                    additional_teaching_material = IDaddTM,
                };
                bd.T03_testing_task_modules.Add(person);
                bd.SaveChanges();
            }
            T03_id_task_name.Clear();
            T03_comment_view_duration_sec.Clear();
            T03_max_passing_duration_sec.Clear();
            T03_additional_teaching_material.Clear();
            T03_note.Clear();

            updateT03();
        }
Exemple #2
0
 public void fillTZ(int id, string name)
 {
     IDTZ = id;
     T03_id_task_name.Clear();
     T03_id_task_name.Text = name;
 }