private void SymptonsAndAssign_Load(object sender, EventArgs e) { BugInfoDAO bugInformationDAO = new BugInfoDAO(); BugInfo bugInformation = bugInformationDAO.GetById(Program.bugId); if (bugInformation != null) { button1.Hide(); button2.Show(); textBox1.Text = bugInformation.Symptoms; textBox2.Text = bugInformation.Cause; } else { button1.Show(); button2.Show(); } ProgrammerDAO programmerDAO = new ProgrammerDAO(); List <Programmer> list = programmerDAO.GetAll(); foreach (var l in list) { comboBox1.Items.Add(l.ProgrammerId + "," + l.FullName); //comboBox1.DisplayMember = l.FullName; //comboBox1.ValueMember = l.ProgrammerId.ToString(); } assignedUser(); }
private void button1_Click(object sender, EventArgs e) { BugInfoDAO bugInformationDAO = new BugInfoDAO(); BugInfo bugInformation = new BugInfo { Cause = textBox2.Text, Symptoms = textBox1.Text, BugId = Program.bugId }; if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("You must add symptons and cause"); } else { try { bugInformationDAO.Insert(bugInformation); MessageBox.Show("Added"); button1.Hide(); button2.Show(); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }