/// <summary> /// list of Controls from application /// </summary> /// <param name="AppID">Application ID</param> /// <returns>list of controls</returns> public static List <FormControl> Get(long AppID) { List <FormControl> formControls = new List <FormControl>(); //retreives information about bug with ID DataSet ds = new DataSet(); SqlConnection sqlCon = new SqlConnection(Settings.AzureBugTrackingConnectionString); SqlCommand sqlCom = new SqlCommand("SELECT * FROM controls where Applicationid = @ID", sqlCon); sqlCom.Parameters.Add(new SqlParameter("@ID", AppID)); try { sqlCon.Open(); SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCom); sqlDa.Fill(ds); }catch (Exception e) { } finally { sqlCon.Close(); } if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { bool Active; if ((long)row["Active"] == 1) { Active = true; } else { Active = false; } //Active = (bool)row["Active"]; FormControl formControl = new FormControl((long)row["Id"], (String)row["Label"], (String)row["name"], Active, AppID); formControls.Add(formControl); } } return(formControls); }
public BugLocation(long applicationID, long formID, long controlID, string action, string relatedMethod, string relatedParameter, long startLineNumber, long endlineNumber) { this.applicationID = applicationID; application = new App(applicationID); this.formID = formID; form = new AppForm(formID); this.controlID = controlID; control = new FormControl(controlID); this.action = action; this.relatedMethod = relatedMethod; this.relatedParameter = relatedParameter; this.EndlineNumber = endlineNumber; this.StartlineNumber = startLineNumber; }
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); } }