//report bug
        public bool ReportBug(BugModel bug)
        {
            Bitmap img   = new Bitmap(bug.getImageLocation());
            var    image = imageToByte(img);

            try
            {
                //query to insert bug report to the database

                MySqlConnection conn = DBUtils.GetDBConnection();

                conn.Open();

                MySqlCommand cmd = new MySqlCommand();

                String sql = "INSERT INTO `tbl_bug`( `component_id`, `summary`, `version`, `severity`, `os`," +
                             " `class`, `method`, `linenofrom`, `linenoto`, " +
                             "`vcrurl`, `screenshot`, `bugdesc`, `code`,`submittedby`,`submitteddate`) VALUES (@component_id,@summary,@version,@severity,@os,@class,@method," +
                             "@linenofrom,@linenoto,@vcrurl,@screenshot,@bugdesc,@code,@submittedby,@submitteddate)";


                //adding values to the parameters
                cmd.Parameters.AddWithValue("@component_id", bug.getComponentID());
                cmd.Parameters.AddWithValue("@summary", bug.getSummary());
                cmd.Parameters.AddWithValue("@version", bug.getVersion());
                cmd.Parameters.AddWithValue("@severity", bug.getSeverity());
                cmd.Parameters.AddWithValue("@os", bug.getOS());
                cmd.Parameters.AddWithValue("@class", bug.getClass());
                cmd.Parameters.AddWithValue("@method", bug.getMethod());
                cmd.Parameters.AddWithValue("@linenofrom", bug.getlinenofrom());
                cmd.Parameters.AddWithValue("@linenoto", bug.getlinenoto());
                cmd.Parameters.AddWithValue("@vcrurl", bug.getVCURL());

                //getting image
                var paramUserImage = new MySqlParameter("@screenshot", MySqlDbType.Blob, image.Length);
                paramUserImage.Value = image;

                cmd.Parameters.Add(paramUserImage);

                cmd.Parameters.AddWithValue("@bugdesc", bug.getbugdesc());
                cmd.Parameters.AddWithValue("@code", bug.getCode());
                cmd.Parameters.AddWithValue("@submittedby", submittedby);
                cmd.Parameters.AddWithValue("@submitteddate", DateTime.Now.ToString("yyyy-MM-dd H:mm:ss"));

                cmd.Connection = conn;

                cmd.CommandText = sql;
                int rowCount = cmd.ExecuteNonQuery();
                if (rowCount >= 1)
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine("Error Message: " + e);
                Debug.WriteLine(e.StackTrace);
            }

            return(flag);
        }