private void BugDetailView_Load(object sender, EventArgs e)
        {
            databaseConnection con = new databaseConnection();
            string             sql_BugDetailView  = "Select B_Subject, B_Describe, B_Code,B_Update, Date from tbl_bug where B_Id ='" + lbl_BGDBugid.Text + "'";
            string             sql_BugDetailView1 = "Select tbl_userlogin.UserName from tbl_userlogin left join tbl_bug on tbl_bug.User_Id = tbl_userlogin.User_Id where tbl_bug.B_Id ='" + lbl_BGDBugid.Text + "'";
            MySqlCommand       cmd  = new MySqlCommand(sql_BugDetailView, con.Db_Connect());
            MySqlCommand       cmd1 = new MySqlCommand(sql_BugDetailView1, con.Db_Connect());
            MySqlDataReader    r    = cmd.ExecuteReader();
            MySqlDataReader    r1   = cmd1.ExecuteReader();

            if (r.Read() && r1.Read())
            {
                lbl_BGDSubject.Text      = r.GetString("B_Subject");
                rtxt_BugDescribtion.Text = r.GetString("B_Describe");
                rtxt_BGDBugProblem.Text  = r.GetString("B_Code");
                lbl_BGDTrackUser.Text    = r1.GetString("UserName");
                rtxt_BGDBugSolution.Text = r.GetString("B_Update");
                lbl_BGDDate.Text         = r.GetString("Date");
            }
            else
            {
                MessageBox.Show("error !!!!!!   UserName aand Usr_Type not shown");
            }
            con.CloseConnection();
        }
        private void btn_ListDone_Click(object sender, EventArgs e)
        {
            databaseConnection con           = new databaseConnection();
            string             sql_updateBug = "UPDATE tbl_Bug SET B_Subject= '" + txt_ListSubject.Text + "', B_Code='" + rtxt_ListCode.Text + "', B_Describe='" + rtxt_ListDescribtion.Text + "' WHERE B_Id= '" + lbl_BugIdDisplay.Text + "'";
            MySqlCommand       cmd           = new MySqlCommand(sql_updateBug, con.Db_Connect());

            cmd.ExecuteNonQuery();


            MessageBox.Show("Update Successful");
            txt_ListSubject.Clear();
            rtxt_ListCode.Clear();
            rtxt_ListDescribtion.Clear();



            string       sql_Buglist = "Select B_Id,B_Subject from tbl_bug";
            MySqlCommand cmd1        = new MySqlCommand(sql_Buglist, con.Db_Connect());

            DataTable        dt   = new DataTable();
            MySqlDataAdapter msda = new MySqlDataAdapter(cmd1);

            dt.Clear();
            msda.Fill(dt);
            dataGridView_Bug.DataSource = dt;
            con.CloseConnection();
        }
Ejemplo n.º 3
0
        private void btn_Submit_Click(object sender, EventArgs e)
        {
            databaseConnection con             = new databaseConnection();
            string             sql_PpupdateBug = "UPDATE tbl_Bug SET B_Update='" + rtxt_PpUpdateCode.Text + "' WHERE B_Id= '" + lbl_PpBugId.Text + "'";
            MySqlCommand       cmd             = new MySqlCommand(sql_PpupdateBug, con.Db_Connect());

            cmd.ExecuteNonQuery();


            MessageBox.Show("Submitted Successfully!!");
            rtxt_PpErrorCode.Clear();
            rtxt_PpUpdateCode.Clear();


            string       sql_Buglist = "Select B_Id,B_Subject from tbl_bug";
            MySqlCommand cmd1        = new MySqlCommand(sql_Buglist, con.Db_Connect());

            DataTable        dt   = new DataTable();
            MySqlDataAdapter msda = new MySqlDataAdapter(cmd1);

            dt.Clear();
            msda.Fill(dt);
            dataGridView_Bug.DataSource = dt;
            con.CloseConnection();
        }
        private void btn_Submit_Click(object sender, EventArgs e)
        {
            try
            {
                //converting image to byte
                byte[] images = null;
                //first declare using system.io; then
                FileStream   streem = new FileStream(imglocation, FileMode.Open, FileAccess.Read);
                BinaryReader brs    = new BinaryReader(streem);
                images = brs.ReadBytes((int)streem.Length);


                if (rtxt_Code.Text != "" && rtxt_Describe.Text != "" && txt_Subject.Text != "" && txt_Imageurl.Text != "")
                {
                    //Inserting data to the database
                    databaseConnection con           = new databaseConnection();
                    String             sql_insertbug = "INSERT INTO tbl_bug(User_Id,B_Subject,B_Describe,B_Code,B_Image,B_Update,Date, Project) VALUES ('" + lbl_UserIdDisplay.Text + "','" + txt_Subject.Text + "','" + rtxt_Describe.Text + "','" + rtxt_Code.Text + "','" + images + "','','" + dateTimePicker_Tracker.Text + "','" + comboBox_Project.Text + "')";
                    MySqlCommand       cmd1          = new MySqlCommand(sql_insertbug, con.Db_Connect());
                    cmd1.ExecuteNonQuery();

                    MessageBox.Show("Bug have been reported");
                    con.CloseConnection();

                    //clearing all the values from the field
                    pictureBox_Bug.Image = null;
                    txt_Imageurl.Clear();
                    txt_Subject.Clear();
                    rtxt_Describe.Clear();
                    rtxt_Code.Clear();
                }
                else
                {
                    MessageBox.Show("Fill all the empty Field!!");
                }

                try
                {
                    databaseConnection con         = new databaseConnection();
                    string             sql_Buglist = "Select B_Id,B_Subject from tbl_bug";
                    MySqlCommand       cmd1        = new MySqlCommand(sql_Buglist, con.Db_Connect());

                    DataTable        dt   = new DataTable();
                    MySqlDataAdapter msda = new MySqlDataAdapter(cmd1);
                    dt.Clear();
                    msda.Fill(dt);
                    dataGridView_Bug.DataSource = dt;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void AdminPanelfun()
        {
            try
            {
                //loading data in datagrid view in page load
                databaseConnection con1        = new databaseConnection();
                string             sql_Usrlist = "Select User_Id,UserName from tbl_userlogin";
                MySqlCommand       cmd1        = new MySqlCommand(sql_Usrlist, con1.Db_Connect());

                DataTable        dt    = new DataTable();
                MySqlDataAdapter msda1 = new MySqlDataAdapter(cmd1);
                dt.Clear();
                msda1.Fill(dt);
                dataGridView_ApUserList.DataSource = dt;
                con1.CloseConnection();



                //loading new buglist with no solution reply
                databaseConnection con         = new databaseConnection();
                string             sql_Buglist = "Select B_Id,B_Subject from tbl_bug where B_Update=''";
                MySqlCommand       cmd         = new MySqlCommand(sql_Buglist, con.Db_Connect());

                DataTable        dt1  = new DataTable();
                MySqlDataAdapter msda = new MySqlDataAdapter(cmd);
                dt1.Clear();
                msda.Fill(dt1);
                dataGridView_APBGL.DataSource = dt1;
                con.CloseConnection();


                //loading solved buglist with  solution reply
                databaseConnection con2             = new databaseConnection();
                string             sql_BuglistSolve = "Select B_Id,B_Subject from tbl_bug where B_Update!=''";
                MySqlCommand       cmd2             = new MySqlCommand(sql_BuglistSolve, con2.Db_Connect());

                DataTable        dt2   = new DataTable();
                MySqlDataAdapter msda2 = new MySqlDataAdapter(cmd2);
                dt2.Clear();
                msda2.Fill(dt2);
                dataGridView_APBGS.DataSource = dt2;
                con2.CloseConnection();
            }
            catch (Exception)
            {
            }
        }
        private void TrackerPanel_Load(object sender, EventArgs e)
        {
            try
            {
                databaseConnection con         = new databaseConnection();
                string             sql_Buglist = "Select B_Id,B_Subject from tbl_bug";
                MySqlCommand       cmd1        = new MySqlCommand(sql_Buglist, con.Db_Connect());

                DataTable        dt   = new DataTable();
                MySqlDataAdapter msda = new MySqlDataAdapter(cmd1);
                dt.Clear();
                msda.Fill(dt);
                dataGridView_Bug.DataSource = dt;
                con.CloseConnection();
            }
            catch (Exception)
            {
                throw;
            }
        }