private void ThreadDBInsert() { int id = db.AddCandidate("Shaun", "Hutchy", random.Next(1, 6).ToString()); if (id == 0) { throw new ApplicationException("Unable to insert candidate."); } }
public HttpStatusCodeResult AddCandidate(string firstName, string lastName, string skillList) { try { DB db = DB.Instance(Global.dbPath); int newCandidateId = db.AddCandidate(firstName, lastName, skillList); if (newCandidateId > 0) { return(new HttpStatusCodeResult(HttpStatusCode.OK, newCandidateId.ToString())); } else { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Candidate unable to be inserted into DB.")); } } catch (SQLiteException ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.Message)); } }
public void InsertBadCandidateData() { db = DB.Instance(@"C:\Users\Shaun\Desktop\GeekHunters\GeekHunters\GeekHunters.Web\GeekHunters.Web\"); int result = db.AddCandidate(null, null, null); }