public void DeleteMeaningAndRelation(Meanings meaning) { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("@MeaningId", meaning.Id); processor.ExecuteNonQuery("DELETE FROM UserMeanRelation WHERE MeaningId=@MeaningId", dic); processor.ExecuteNonQuery("DELETE FROM Meanings WHERE ID=@MeaningId", dic); }
public bool InsertOrUpdateMeaning(Dictionary <string, object> dic, DbTransaction tran) { string desc = (string)dic["Desc"]; Meanings m = GetMeaningByName(desc); if (m == null || m.Id == 0) { return(this.InsertMeaning(dic, tran)); } return(true); }
public void InsertOrUpdateMeaning(Meanings meaning) { Meanings MeaningGotFromDbById = this.GetMeaningById(meaning.Id); if (MeaningGotFromDbById.Id != 0) { processor.Update <Meanings>(meaning, null); } else { processor.Insert <Meanings>(meaning, null); } }
public bool InsertMeaning(Dictionary <string, object> dic, DbTransaction tran) { Meanings m = new Meanings(); if (dic.Keys.Contains("ID")) { m.Id = (int)dic.First(p => { return(p.Key == "ID"); }).Value; } else { int id = this.GetMeaningPKValue(); m.Id = id + 1; } m.Desc = (string)dic.First(p => { return(p.Key == "Desc"); }).Value; m.Remark = (string)dic.First(p => { return(p.Key == "Remark"); }).Value; return(processor.Insert <Meanings>(m, tran)); }
public bool InsertMeaning(Meanings m, DbTransaction tran) { return(processor.Insert <Meanings>(m, tran)); }
public bool InsertMeaning(Meanings m) { return(InsertMeaning(m, null)); }