예제 #1
0
 private void TxtAddQuestion_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         ctx.Question.Add(new Question {
             QuestionTitle = txtAddQuestion.Text
         });
         ctx.SaveChanges();
         dgvQuestions.DataSource = ctx.Question.ToList();
     }
 }
예제 #2
0
        private void TxtAddQuestion_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                string question = txtAddQuestion.Text.Trim();

                if (string.IsNullOrWhiteSpace(question))
                {
                    MessageBox.Show("Soru girmediniz!");
                    return;
                }
                ctx.Question.Add(new Question {
                    QuestionTitle = txtAddQuestion.Text
                });
                ctx.SaveChanges();
                ListQuestions();
            }
        }
예제 #3
0
        private void BtnAddProject_Click(object sender, EventArgs e)
        {
            try
            {
                MessageBox.Show("Kaydedildi");
                var report = new Models.Report {
                    ReportDescription = txtReportDescription.Text,
                    EmployeeFK        = (long)cboEmplooyeFK.SelectedValue
                };
                ctx.Report.Add(report);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Kayıt işlemi başarısız");
            }



            ctx.SaveChanges();
        }
예제 #4
0
 private void Button1_Click(object sender, EventArgs e)
 {
     ctx.SaveChanges();
     MessageBox.Show("Kaydedildi");
     SaveAndGetQuestions();
 }