Beispiel #1
0
        public Boolean Get(long id)
        {
            //retreives information about bug with ID
            DataSet       ds     = new DataSet();
            SqlConnection sqlCon = new SqlConnection(Settings.AzureBugTrackingConnectionString);
            SqlCommand    sqlCom = new SqlCommand("Select * From BugLocations where Id = @ID", sqlCon);

            sqlCom.Parameters.Add(new SqlParameter("@ID", id));

            try
            {
                sqlCon.Open();

                SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCom);

                sqlDa.Fill(ds);
            }
            finally
            {
                sqlCon.Close();
            }

            if (ds.Tables[0].Rows.Count == 1)
            {
                EndlineNumber = 0;

                if (ds.Tables[0].Rows[0]["EndlineNumber"] != DBNull.Value)
                {
                    EndlineNumber = (int)ds.Tables[0].Rows[0]["EndlineNumber"];
                }



                if (ds.Tables[0].Rows[0]["StartlineNumber"] != DBNull.Value)
                {
                    StartlineNumber = (int)ds.Tables[0].Rows[0]["StartlineNumber"];
                }



                long applicationID = (int)ds.Tables[0].Rows[0]["applicationID"];

                long formID = (int)ds.Tables[0].Rows[0]["formID"];

                long controlID = (int)ds.Tables[0].Rows[0]["controlID"];

                action = (String)ds.Tables[0].Rows[0]["action"];

                relatedMethod = (String)ds.Tables[0].Rows[0]["relatedMethod"];

                relatedParameter = (String)ds.Tables[0].Rows[0]["relatedParameter"];

                application = new App(applicationID);

                form = new AppForm(formID);

                control = new FormControl(controlID);

                return(true);
            }
            else
            {
                return(false);
            }
        }