public void Insert(NewPhrase newPhrase) { using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["MyDbConn1"].ConnectionString)) { db.Query ("INSERT INTO NewPhrase(Name, StopList) " + "VALUES(@Name, @StopList)", new { Name = newPhrase.Name, StopList = newPhrase.StopList }); } }
public bool MoveToStopList(int newPhraseID) { NewPhraseRepository newPhraseRepository = new NewPhraseRepository(); NewPhrase newPhrase = newPhraseRepository.Get(newPhraseID); newPhrase.StopList = true; newPhraseRepository.Update(newPhrase); return(true); }
public void Update(NewPhrase newPhrase) { using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["MyDbConn1"].ConnectionString)) { db.Query <bool> ("UPDATE NewPhrase SET Name = @Name, StopList = @StopList " + "WHERE Id = @Id", new { Id = newPhrase.ID, Name = newPhrase.Name, StopList = newPhrase.StopList }); } }
public bool MoveToGroup(int groupID, int newPhraseID) { NewPhraseRepository newPhraseRepository = new NewPhraseRepository(); NewPhrase newPhrase = newPhraseRepository.Get(newPhraseID); PhraseRepository phraseRepository = new PhraseRepository(); Phrase phrase = new Phrase(); phrase.GroupID = groupID; phrase.Name = newPhrase.Name; phrase.Frequency = newPhrase.Frequency; phraseRepository.Insert(phrase); newPhraseRepository.Delete(newPhrase.ID); return(true); }
public bool IsNewDifferent() { return(!NewPhrase.Equals(OldPhrase, StringComparison.OrdinalIgnoreCase)); }