public void FillDB() { for (var i = 1; i <= 50; i++) { var apiHandler = new apiHandler(); var root = apiHandler.Root(i); foreach (var fugitive in root.items) { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); NpgsqlCommand cmd = queryBuilder.FillCommand(fugitive, con); try { cmd.ExecuteNonQuery(); } catch { //TODO: logging throw; } } } } }
public void UpdateAProfile(Item2 item) { using (var con = new NpgsqlConnection(cs)) { con.Open(); var querymaker = new queryBuilder(); NpgsqlCommand cmd = querymaker.UpdateOneEditedRecord(con, item); cmd.ExecuteNonQuery(); } }
public void SelfDestruct() { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); var cmd = queryBuilder.Nuke(con); cmd.ExecuteNonQuery(); } }
public void updateDB() { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); var cmd = queryBuilder.updateCommand(con); cmd.ExecuteNonQuery(); FillDB(); } }
public void addProfile(Item item, Image image) { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); var cmd = queryBuilder.addProfile(item, image, con); try { cmd.ExecuteNonQuery(); } catch { throw; } } }
public void DeleteSighting(int sid) { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); var cmd = queryBuilder.deleteReport(con, sid); try { cmd.ExecuteNonQuery(); } catch { throw; } } }
public void approveSighting(int report) { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); var cmd = queryBuilder.verifyReport(con, report); try { cmd.ExecuteNonQuery(); } catch { throw; } } }
public void ReportSighting(ReportModel report) { using (var con = new NpgsqlConnection(cs)) { con.Open(); var queryBuilder = new queryBuilder(); var cmd = queryBuilder.AddReport(con, report); try { cmd.ExecuteNonQuery(); } catch { throw; } } }