Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
0
 private void Button1_Click(object sender, EventArgs e)
 {
     ctx.SaveChanges();
     MessageBox.Show("Kaydedildi");
     SaveAndGetQuestions();
 }