private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            //button4.Show();
            AssignDAO bugInformationDAO = new AssignDAO();
            string    value             = comboBox1.SelectedItem.ToString();

            string[] s = value.Split(',');

            id = Convert.ToInt32(s[0]);

            //Assign assign = new Assign
            //{
            //    AssignBy = Program.userId,
            //    AssignTo = id,
            //    Description = textBox3.Text.ToString()
            //};

            //try
            //{
            //    bugInformationDAO.Insert(assign);
            //    MessageBox.Show("Task assigned");
            //} catch(Exception ex)
            //{
            //    Console.WriteLine(ex.Message);
            //}
        }
        private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            AssignDAO bugInformationDAO = new AssignDAO();
            string    value             = comboBox1.SelectedItem.ToString();

            string[] s = value.Split(',');

            id = Convert.ToInt32(s[0]);
        }
        //private void SymptonsAndAssign_Load(object sender, EventArgs e)
        //{


        //}

        private void assignedUser()
        {
            //listBox1.Items.Clear();
            AssignDAO     assignDAO  = new AssignDAO();
            List <string> assignList = assignDAO.GetAllAssignedUsersByBugId(Program.bugId);

            foreach (var a in assignList)
            {
                //listBox1.Items.Add(a);
            }
        }
        private void SymptomsAndCause_Load(object sender, EventArgs e)
        {
            if (!Program.isTester)
            {
                comboBox1.Hide();
                label3.Hide();
/*                textBox3.Hide()*/;
                button3.Hide();
                //listBox1.Hide();
                button1.Hide();
                button2.Hide();
                button2.Enabled  = false;
                textBox1.Enabled = false;
                textBox2.Enabled = false;
                button1.Enabled  = false;
                AssignDAO       showMessage = new AssignDAO();
                AssignViewModel message     = showMessage.GetById(Program.bugId);
                textBox3.Text    = message.Description;
                textBox3.Enabled = false;
            }

            BugInformationDAO       bugInformationDAO = new BugInformationDAO();
            BugInformationViewModel bugInformation    = bugInformationDAO.GetById(Program.bugId);

            if (bugInformation != null)
            {
                button1.Hide();
                button2.Show();
                textBox1.Text = bugInformation.Symptons;
                textBox2.Text = bugInformation.Cause;
            }
            else
            {
                button1.Show();
                button2.Show();
            }

            ProgrammerDAO programmerDAO     = new ProgrammerDAO();
            List <ProgrammerViewModel> 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 button4_Click_1(object sender, EventArgs e)
        {
            AssignDAO assignDAO = new AssignDAO();

            try
            {
                bool res = assignDAO.RemoveAssignedUser(Program.bugId, id);

                if (res)
                {
                    assignedUser();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            assignedUser();
            Assign assign = new Assign {
                AssignBy    = Login.userId,
                AssignTo    = id,
                Description = textBox3.Text,
                BugId       = Program.bugId
            };

            AssignDAO assignDAO = new AssignDAO();

            try
            {
                assignDAO.Insert(assign);
                MessageBox.Show("Task assigned");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }